<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kadriye Taylan on Medium]]></title>
        <description><![CDATA[Stories by Kadriye Taylan on Medium]]></description>
        <link>https://medium.com/@kadriyetaylan?source=rss-93cb980be12b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*MO9sTdnQa7G3qzfRySu4Iw.jpeg</url>
            <title>Stories by Kadriye Taylan on Medium</title>
            <link>https://medium.com/@kadriyetaylan?source=rss-93cb980be12b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 01:11:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kadriyetaylan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[OpenSearch Node Management and Certificates in Docker Rootless]]></title>
            <link>https://kadriyetaylan.medium.com/opensearch-node-management-and-certificates-in-docker-rootless-fd9c6719eca5?source=rss-93cb980be12b------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd9c6719eca5</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[configuration]]></category>
            <category><![CDATA[opensarch]]></category>
            <category><![CDATA[certificate]]></category>
            <category><![CDATA[tls]]></category>
            <dc:creator><![CDATA[Kadriye Taylan]]></dc:creator>
            <pubDate>Fri, 16 Feb 2024 16:47:53 GMT</pubDate>
            <atom:updated>2024-02-16T18:31:14.088Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi Everyone!</p><p>It’s been a long time! :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/0*MQBWhvsI8i_TLL2w" /></figure><p>I will explain OpenSearch installation and configuration with Docker in rootless mode. I have some experience on this topic and I thought I might be helpful for someone.</p><p>I will not explain what OpenSearch is because if you’re here, you probably already know some basic things about it. :)</p><p>Let’s dive in! 🌊</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*fPrT_0yvRIzti9wO.png" /></figure><p>Actually, installing OpenSearch on Docker is quite straightforward. You can find detailed documentation on the OpenSearch website. However, depending on the Docker mode you’re using, some things might become a bit confusing.</p><p>In my case, I’m using Docker in rootless mode on a Linux Rocky 8 server. Additionally, I’m working within a specific user scope, so I have encountered various restrictions during installation and configuration.</p><p>The docker version I use is 24.0.4. Furthermore, during the installation, I define a different bridge IP range in the daemon.json file, in addition to using Docker in rootless mode.</p><p>The reason for defining a bridge IP is because I’m using Docker in rootless mode, which means I can’t use the Docker host network. So I’m using Docker bridge network. In this scenario, by specifying the desired IP block, I enable my container to access other applications over the desired network. This allows me to achieve the desired network setup and connectivity for my container despite using Docker in rootless mode.</p><p>My purpose is to create 2 nodes on different servers. So, I have 2 different servers for that purpose. I configured them exactly the same because I’m using automation for configuration :)</p><p>My docker compose for installation of opensearch:</p><pre>version: &#39;3.8&#39;</pre><pre>services:<br>  opensearch:<br>    container_name: ${containerName}<br>    image: ${opensearch_application_image_repo}:${opensearch_application_image_tag}<br>    environment:<br>      - RUN_USER=root<br>      - RUN_GROUP=root<br>      - RUN_UID=0<br>      - RUN_GID=0<br>      - DISABLE_INSTALL_DEMO_CONFIG=true<br>    volumes:<br>      - ${opensearch_application_directory}/data:/usr/share/opensearch/data:Z<br>      - ${opensearch_application_directory}/certs:/usr/share/opensearch/config/certificates<br>      - ${opensearch_application_directory}/config/opensearch.yml:/usr/share/opensearch/config/opensearch.yml<br>      - ${opensearch_application_directory}/config/security/internal_users.yml:/usr/share/opensearch/plugins/opensearch-security/securityconfig/internal_users.yml<br>      - ${opensearch_application_directory}/config/security/roles_mapping.yml:/usr/share/opensearch/plugins/opensearch-security/securityconfig/roles_mapping.yml<br>      - ${opensearch_application_directory}/config/security/config.yml:/usr/share/opensearch/plugins/opensearch-security/securityconfig/config.yml<br>    ports:<br>      - &quot;${opensearch_ports}:${opensearch_ports}&quot;<br>    deploy:<br>      resources:<br>        limits:<br>          memory: ${container_memory}</pre><p>I am executing same docker-compose file on both servers (with automation tool).</p><p>Now, lets look at the opensearch configs:</p><pre>---<br>cluster.name: opensearch-cluster-#{env}<br>network.host: 0.0.0.0<br>network.publish_host: #{Octopus.Machine.Hostname}</pre><pre>bootstrap.memory_lock: false </pre><pre>node.name: #{Octopus.Machine.Hostname}</pre><pre>discovery.seed_hosts: #{each node in opensearch_nodes}<br>   - #{node} #{/each}<br>cluster.initial_master_nodes: #{each node in opensearch_nodes}<br>   - #{node} #{/each}<br>   <br>action.auto_create_index: &quot;.watches,.triggered_watches,.watcher-history-*&quot;</pre><pre>cluster.routing.allocation.disk.threshold_enabled: true<br>cluster.routing.allocation.disk.watermark.low: 93%<br>cluster.routing.allocation.disk.watermark.high: 95%</pre><pre># Disable ssl http. Cannot use securityadmin when disabled<br># Bitbucket results in http error once enabled<br>plugins.security.ssl.transport.pemcert_filepath: /usr/share/opensearch/config/certificates/#{Octopus.Machine.Hostname}.pem<br>plugins.security.ssl.transport.pemkey_filepath: /usr/share/opensearch/config/certificates/#{Octopus.Machine.Hostname}-key.pem<br>plugins.security.ssl.transport.pemtrustedcas_filepath: /usr/share/opensearch/config/certificates/root-ca.pem<br>plugins.security.ssl.http.pemcert_filepath: /usr/share/opensearch/config/certificates/#{Octopus.Machine.Hostname}.pem<br>plugins.security.ssl.http.pemkey_filepath: /usr/share/opensearch/config/certificates/#{Octopus.Machine.Hostname}-key.pem<br>plugins.security.ssl.http.pemtrustedcas_filepath: /usr/share/opensearch/config/certificates/root-ca.pem<br>plugins.security.ssl.http.enabled: false<br>plugins.security.ssl.transport.enabled: true<br>plugins.security.ssl.transport.enforce_hostname_verification: false<br>plugins.security.allow_default_init_securityindex: true<br>plugins.security.allow_unsafe_democertificates: false<br>plugins.security.restapi.roles_enabled: [&quot;all_access&quot;]</pre><pre>plugins.security.ssl.transport.enabled_protocols:<br>  - &quot;TLSv1.2&quot;<br>plugins.security.ssl.http.enabled_protocols:<br>  - &quot;TLSv1.2&quot;<br>  <br>plugins.security.authcz.admin_dn:<br>  - &#39;CN=ADMIN,O=YOURORG,L=YOURCITY,ST=YOURSTATE,C=YOURCOUNTRY&#39;<br>plugins.security.nodes_dn: #{each node in opensearch_nodes}<br>  - &#39;CN=#{node},O=YOURORG,L=YOURCITY,ST=YOURSTATE,C=YOURCOUNTRY&#39; #{/each}</pre><p>A parameterized structure has been created using parameters starting with ‘Octopus,’ indicating that the YAML file above was deployed with Octopus.</p><p>The most important parameters to pay attention to here are as follows:</p><pre>network.publish_host: #{Octopus.Machine.Hostname} #ContainerHostname<br>node.name: #{Octopus.Machine.Hostname} #ContainerHostname<br>discovery.seed_hosts: #{each node in opensearch_nodes}<br>   - #{node} #ContainerHostname #{/each}<br>cluster.initial_master_nodes: #{each node in opensearch_nodes}<br>   - #{node} #ContainerHostname #{/each}</pre><p>The reason for defining the network.publish_host is as follows: In Docker, when using bridge IP and both servers have the same IP range, if the same two containers are launched with the same configurations on both servers, they will receive the same private IP address and won’t be able to communicate with each other. Therefore, to enable containers to access each other via publish host, I set the hostname of the container to its running host using the network.publish_host parameter.</p><p>The primary function of node configurations is to manage the creation of an OpenSearch cluster and communication between nodes. These configurations are used to specify the initial master nodes of the cluster and ensure the discovery of nodes when the cluster is being formed.</p><p>First, let’s take a look at the technical details of these cluster settings.</p><p>node.name:</p><blockquote><strong>Description:</strong> Specifies the unique name of the OpenSearch node within the cluster.</blockquote><blockquote><strong>Purpose: </strong>Identifies the node within the cluster and is used for communication and coordination among cluster nodes.</blockquote><p>discovery.seed_hosts:</p><blockquote><strong>Description:</strong> Specifies the initial list of host addresses that a new OpenSearch node should connect to in order to discover other nodes in the cluster.</blockquote><blockquote><strong>Purpose: </strong>Facilitates the discovery of existing cluster nodes by new nodes during cluster formation.</blockquote><p>cluster.initial_master_nodes:</p><blockquote><strong>Description: </strong>Specifies the initial list of nodes that should serve as master nodes when forming a new OpenSearch cluster.</blockquote><blockquote><strong>Purpose: </strong>Defines the initial master nodes of the cluster during its initial setup.</blockquote><p>I provided the hostname to the node.name parameter for both clarity and discovery purposes. The discovery seed hosts and cluster initial master nodes parameters should contain the same value as specified in the node name. Otherwise, the nodes won’t be able to discover each other.</p><p>Simply put, if you’re using Docker rootless mode and have OpenSearch nodes running on different servers, and encounter connectivity issues between the nodes, you may try configuring as shown in the example below.</p><p>Node1</p><pre>network.host: 0.0.0.0<br>network.publish_host: containerhostname123<br>node.name: containerhostname123<br>discovery.seed_hosts:<br>   - containerhostname123<br>   - containerhostname456<br>cluster.initial_master_nodes: <br>   - containerhostname123<br>   - containerhostname456</pre><p>Node2</p><pre>network.host: 0.0.0.0<br>network.publish_host: containerhostname456<br>node.name: containerhostname456<br>discovery.seed_hosts:<br>   - containerhostname123<br>   - containerhostname456<br>cluster.initial_master_nodes: <br>   - containerhostname123<br>   - containerhostname456</pre><p>Another essential point is if you want your nodes to connect securely, OpenSearch requires you to create self-signed certificates and use them on the nodes. There’s a very important aspect to be mindful of here. The detailed configuration of OpenSearch TLS is explained in <a href="https://opensearch.org/docs/latest/security/configuration/generate-certificates/">this link</a>, and you can follow it. However, I want to emphasize a critical point that might easily be overlooked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/266/0*vPXSvkpx4dKLzhbb" /></figure><p>Maybe it’s not that important, but I’ve spent a lot of time on it! 😅</p><p>When creating certificates, you generate a separate certificate for each node or administrator, and when creating these certificates, you provide subject information.</p><p>Sample code:</p><p>openssl req -new -key node2-key.pem -subj &quot;/C=<strong>YOURCOUNTRY</strong>/ST=<strong>YOURSTATE</strong>/L=<strong>YOURCITY</strong>/O=<strong>YOURORG</strong>/CN=<strong>YOURCOMMONNAMEFORNODE</strong>&quot; -out node2.csr</p><p>You must absolutely define the exact same subject information used here in the OpenSearch YAML configuration file where your OpenSearch configurations are located.</p><p>If you have used the following script for your configuration with two nodes:</p><pre>openssl req -new -key admin-key.pem -subj &quot;/C=CA/ST=ONTARIO/L=TORONTO/O=ORG/CN=ADMIN&quot; -out admin.csr<br>openssl req -new -key node1-key.pem -subj &quot;/C=CA/ST=ONTARIO/L=TORONTO/O=ORG/CN=NODE1&quot; -out node1.csr<br>openssl req -new -key node2-key.pem -subj &quot;/C=CA/ST=ONTARIO/L=TORONTO/O=ORG/CN=NODE2&quot; -out node2.csr</pre><p>For your OpenSearch YAML file configuration, it should look like this:</p><pre>plugins.security.authcz.admin_dn:<br>   - &#39;CN=ADMIN,O=ORG,L=TORONTO,ST=ONTARIO,C=CA&#39;<br>plugins.security.nodes_dn:<br>  - &#39;CN=NODE1,OU=UNIT,O=ORG,L=TORONTO,ST=ONTARIO,C=CA&#39;<br>  - &#39;CN=NODE2,OU=UNIT,O=ORG,L=TORONTO,ST=ONTARIO,C=CA&#39;</pre><p>This may not seem like a big deal, but even a small typo here can cause you hours of frustration because you may not realize the error is coming from here. 😄</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*DXVe1fopBkZecnDS" /></figure><p>In this article, I’ve explained managing an OpenSearch nodes with Docker rootless networking, detailing configuration, certificate creation, and tips for secure connectivity between nodes.</p><p>I hope it’s been helpful. Feel free to ask any questions.</p><p>Have a great day 😊🌸</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd9c6719eca5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The AppServiceConsoleLogs query Issue in Azure Monitor]]></title>
            <link>https://medium.com/kocsistem/the-appserviceconsolelogs-query-issue-in-azure-monitor-82c5d4e7e33c?source=rss-93cb980be12b------2</link>
            <guid isPermaLink="false">https://medium.com/p/82c5d4e7e33c</guid>
            <category><![CDATA[koçsistem]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[azure-monitoring]]></category>
            <category><![CDATA[azure-web-app]]></category>
            <dc:creator><![CDATA[Kadriye Taylan]]></dc:creator>
            <pubDate>Fri, 21 Oct 2022 08:55:59 GMT</pubDate>
            <atom:updated>2023-05-02T18:44:32.860Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*M-VJ_ygq665Dqm3Z.png" /></figure><p>Hi everyone,</p><p>In this article, I will tell you about a problem we have with the monitoring solution we use for Web App Container from Azure Services and the solution of Microsoft.</p><h4>What is the issue?</h4><p>We have a java application that runs as a Web App Container. The logs of this application are kept in the database. It is also shown in Azure Monitor as container log.</p><p>Since the application keeps more than 300 payment transactions during the day, the logs were very critical and it was necessary to view them on Azure Monitor during the day. However, the number of logs received in Azure monitor and the number in the database did not match.</p><p><strong><em>Summary</em></strong></p><p><em>The </em><strong><em>AppServiceConsoleLogs</em></strong><em> query in Azure Monitor was not displaying all records rendered by the Web App mywebapp Application Logs.</em></p><h4><strong>What is the reason of issue?</strong></h4><p>In order to provide real time logs, the platform streams the Docker logs from the Web App container. When configuring the container, the size of the log file that is used internally by Docker can have several values. On App Service Linux the default size was 1MB, however, the application was found to have individual log lines that were larger than 1MB.</p><h4>What is the solution?</h4><p>All current instances from the mywebapp Web App were patched to use 25MB for the Docker max-size file limit. Microsoft have applied a global platform change as well to increase the default for this setting (5MB) and added a new App Setting to override this value for individual Web Apps. In order to take advantage of this new feature, as Microsoft recommended, you can add the following App Settings. Also, it will be available with the platform update in all regions by the first week of November.</p><pre>WEBSITE_CONTAINER_LOG_MAX_FILE_SIZE=25m</pre><p>We would like to thank Microsft team for all their support during this process.</p><p>We would also like to thank <a href="https://medium.com/u/853bf1b442b9">Nevin Cansel Efendioglu</a> for identifying the problem and following it carefully at the beginning of the process. :)</p><p>I hope it was an useful article. Have a nice day everybody :) Stay healthy!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82c5d4e7e33c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kocsistem/the-appserviceconsolelogs-query-issue-in-azure-monitor-82c5d4e7e33c">The AppServiceConsoleLogs query Issue in Azure Monitor</a> was originally published in <a href="https://medium.com/kocsistem">KoçSistem</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ELK Installation with ECK Operator]]></title>
            <link>https://kadriyetaylan.medium.com/elk-installation-with-eck-operator-56e8a0a501fa?source=rss-93cb980be12b------2</link>
            <guid isPermaLink="false">https://medium.com/p/56e8a0a501fa</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[elk]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Kadriye Taylan]]></dc:creator>
            <pubDate>Wed, 20 Jul 2022 17:20:28 GMT</pubDate>
            <atom:updated>2024-01-10T13:15:24.665Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*R4IcjWsebOQrfHxd.png" /></figure><p>Hi everyone, In this article, I will talk about ELK stack installations using the ECK operator developed by Elastic company for elastic search installations.</p><p>Before we start the installations, let’s examine a little bit of ECK Operator.</p><h3>What is ECK Operator?</h3><p>Elastic Cloud on Kubernetes (ECK) automates the deployment, provisioning, management, and orchestration of Elasticsearch, Kibana, APM Server, Enterprise Search, Beats, Elastic Agent, and Elastic Maps Server on Kubernetes based on the operator pattern.</p><p>Built using the Kubernetes Operator pattern, ECK installs into your Kubernetes cluster and goes beyond just simplifying the task of deploying Elasticsearch and Kibana on Kubernetes. It focuses on streamlining all those critical operations, such as:</p><ul><li>Managing and monitoring multiple clusters</li><li>Upgrading to new stack versions with ease</li><li>Scaling cluster capacity up and down</li><li>Changing cluster configuration</li><li>Dynamically scaling local storage (includes Elastic Local Volume, a local storage driver)</li><li>Scheduling backups</li></ul><p>But ECK is much more than a Kubernetes Operator. In addition to automating all the operational and cluster administration tasks, it focuses on streamlining the entire Elastic Stack on Kubernetes experience. The vision for ECK is to provide an official way to orchestrate Elasticsearch on Kubernetes and provide a SaaS-like experience for Elastic products and solutions on Kubernetes.</p><h4>Features</h4><ul><li>Elasticsearch, Kibana, APM Server, Enterprise Search, and Beats deployments</li><li>TLS Certificates management</li><li>Safe Elasticsearch cluster configuration &amp; topology changes</li><li>Persistent volumes usage</li><li>Custom node configuration and attributes</li><li>Secure settings keystore updates</li></ul><h4>Supported versions</h4><ul><li>Kubernetes 1.20–1.24</li><li>OpenShift 4.6–4.10</li><li>Elasticsearch, Kibana, APM Server: 6.8+, 7.1+, 8+</li><li>Enterprise Search: 7.7+, 8+</li><li>Beats: 7.0+, 8+</li><li>Elastic Agent: 7.10+ (standalone), 7.14+, 8+ (Fleet)</li><li>Elastic Maps Server: 7.11+, 8+</li></ul><h4>Custom Resource Definitions</h4><ul><li>Elastic Agent</li><li>APM Server</li><li>Beats</li><li>Elastic Maps Server</li><li>Elasticsearch Cluster</li><li>Enterprise Search</li><li>Kibana</li></ul><p>Let’s get started!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*qRAerOUex-qfRmJI" /></figure><p>The applications I use while making these installations.</p><ul><li>Azure Kubernetes Service</li><li>Terraform</li><li>Helm</li></ul><p>I only added the configurations that I consider important. You can access the whole configuration from <a href="https://github.com/kdryetyln/ELK-with-ECK-Operator">this github link</a>.</p><h3>Installation</h3><h4>Install Operator</h4><p>Here, the installations were made with terraform scripts using the helm chart prepared for the operator.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2989fc52c3c5845e3e02ebff0729caea/href">https://medium.com/media/2989fc52c3c5845e3e02ebff0729caea/href</a></iframe><blockquote>However, Installations can also be done by applying manifest files directly.</blockquote><pre>kubectl create -f https://download.elastic.co/downloads/eck/2.2.0/crds.yaml</pre><pre>kubectl apply -f https://download.elastic.co/downloads/eck/2.2.0/operator.yaml</pre><p>Here are the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ug4KezKK6_yqBJvRANoDTg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K2A3OZ-_Rp9JUdzWonJA2g.png" /></figure><h3>Install Resources</h3><p>Resource installations were made by applying manifest files. Here, custom resource definitions created by the operator are used.</p><h4>ElasticSearch</h4><p>The storage class to be used for elastic search can be changed if desired.</p><blockquote>Elasticsearch is installed with 3 master nodes by default. The number of master replicas can be changed as needed.</blockquote><blockquote>However, for elastic, it should be a node machine with at least 4 cores.</blockquote><p><a href="https://github.com/kdryetyln/ELK-with-ECK-Operator/blob/main/filesformedium/elasticsearch.yaml">Elastic Search Manifest file link</a></p><h4>Filebeat</h4><p>In my construction, logs will be collected by Filebeat, sent to logstash, filtered, and indexed needed in logstash will be made and sent to elasticsearch.</p><p>So I made changes in some manifest files.</p><ul><li>I disabled the elastic and kibana reference parameters in the filebeat configuration below. If these are turned on, my logs cannot be sent to logstash.</li><li>I made different namespace restriction definitions with drop_event.when.</li><li>In order to send my logs to logstash, I have given the address of the logstash service that I will create below using the output.logstash parameter.</li></ul><p><a href="https://github.com/kdryetyln/ELK-with-ECK-Operator/blob/main/filesformedium/filebeat.yaml">Filebeat Manifest file link</a></p><h4>Kibana</h4><p><a href="https://github.com/kdryetyln/ELK-with-ECK-Operator/blob/main/filesformedium/kibana.yaml">Kibana Manifest file link</a></p><h4>Logstash</h4><p>The ECK operator does not contain any specific resource definitions for Logstash. Therefore, we will install logstash using the classic deployment object.</p><p><a href="https://github.com/kdryetyln/ELK-with-ECK-Operator/blob/main/filesformedium/logstash.yaml">Logstash Manifest file link</a></p><p>The config maps defined in the following yaml file are given as volume in the logstash deployment yaml file.</p><p><a href="https://github.com/kdryetyln/ELK-with-ECK-Operator/blob/main/filesformedium/logstashconfigmap.yaml">Logstash Configmap file link</a></p><h4>Apply Manifests</h4><p>I used the provider named kubectl to be able to apply the custom manifest files prepared with Terraform into a single folder collectively.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/934d190d898bdad06cce62b1085af6ba/href">https://medium.com/media/934d190d898bdad06cce62b1085af6ba/href</a></iframe><h3>All Results</h3><p><strong>Terraform results</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n3oESoIFHO2A4e1wTT_lfQ.png" /></figure><p><strong>Pod results</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*ufCeGWaDbC0Ci6RNVbM-ZA.png" /></figure><p><strong>Kibana Interface</strong></p><p>Username: elastic</p><p>Password: The password can be accessed by running the command below.</p><pre>kubectl get secret -n logging elasticsearch-es-elastic-user -o=jsonpath=&#39;{.data.elastic}&#39; | base64 --decode; echo</pre><p>Indexes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IyfIf2jUbvxbJBeAbHii2Q.png" /></figure><p>Logs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YBwp39u2RaWbr1qxcJQP7g.png" /></figure><p>That’s it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*HcHKXpCWFb94LvTC" /></figure><p>Thanks to this operator that Elastic has released, it only takes a few minutes to set up a fully secure elastic cluster :)</p><p>I hope it was an useful article. Have a nice day everybody :) Stay healthy!</p><p>If you would like to show your support, tap on the image 👇🎉</p><figure><a href="https://www.buymeacoffee.com/kdryegns"><img alt="" src="https://cdn-images-1.medium.com/max/454/0*PAlUPgUiVGObcKLh.png" /></a></figure><p><strong>Reference Links</strong></p><p><strong>Reference Links</strong></p><p><a href="https://github.com/elastic/cloud-on-k8s">https://github.com/elastic/cloud-on-k8s</a></p><p><a href="https://www.elastic.co/blog/introducing-elastic-cloud-on-kubernetes-the-elasticsearch-operator-and-beyond?elektra=products&amp;storm=sub1">https://www.elastic.co/blog/introducing-elastic-cloud-on-kubernetes-the-elasticsearch-operator-and-beyond?elektra=products&amp;storm=sub1</a></p><p><a href="https://www.elastic.co/elasticsearch/service">https://www.elastic.co/elasticsearch/service</a></p><p><a href="https://operatorhub.io/operator/elastic-cloud-eck">https://operatorhub.io/operator/elastic-cloud-eck</a></p><p><a href="https://github.com/elastic/cloud-on-k8s/tree/main/config/recipes/logstash">https://github.com/elastic/cloud-on-k8s/tree/main/config/recipes/logstash</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56e8a0a501fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installation Internal Nginx Ingress for a Private AKS Cluster]]></title>
            <link>https://kadriyetaylan.medium.com/installation-internal-nginx-ingress-for-a-private-aks-cluster-7b6386492d56?source=rss-93cb980be12b------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b6386492d56</guid>
            <category><![CDATA[ingress]]></category>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[azure-kubernetes-service]]></category>
            <dc:creator><![CDATA[Kadriye Taylan]]></dc:creator>
            <pubDate>Sat, 18 Jun 2022 21:40:41 GMT</pubDate>
            <atom:updated>2024-01-10T13:15:32.111Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YES4pILxYzEyJ_UyTh4jZQ.png" /></figure><p>Hi everyone, in this article, I will talk about how to install Internal Nginx Ingress Controller for a Private AKS Cluster using terraform and helm.</p><p>Before continuing, you can take a look at <a href="https://medium.com/kocsistem/what-is-the-difference-nginx-ingress-annotations-2fe6825ced1f">my article</a> about ingress controllers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*q6lRiG4f9LUNsz38" /></figure><p>Let’s get started!</p><h3>Prerequisites</h3><ul><li>Azure Subscription</li><li>Private AKS Cluster</li><li>Kubernetes Admin Service Account</li><li>Azure CLI</li><li>Terraform</li></ul><h3>Kubernetes Service Account</h3><p>Role Based Access Control is comprised of four layers:</p><ol><li><strong>ClusterRole</strong> - permissions assigned to a role that apply to an entire cluster</li><li><strong>ClusterRoleBinding </strong>- binding a ClusterRole to a specific account</li><li><strong>Role</strong> - permissions assigned to a role that apply to a specific namespace</li><li><strong>RoleBinding </strong>- binding a Role to a specific account</li></ol><p>In order for RBAC to be applied to an ingress-nginx-controller, that controller should be assigned to a ServiceAccount. That <strong>ServiceAccount </strong>should be bound to the <strong>Roles</strong> and <strong>ClusterRoles </strong>defined for the ingress-nginx-controller.</p><p><strong>Create Service Account with Terraform</strong></p><p>Terraform needs to Kubernetes and Azure terraform provider for RBAC creation.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/26306e5caa8927fe06c67501a98446c3/href">https://medium.com/media/26306e5caa8927fe06c67501a98446c3/href</a></iframe><p>Configurations in the serviceaccountmain.tf file are parametric.</p><p>You can access the variables and provider versions from <a href="https://github.com/kdryetyln/InternalNginxController/tree/main/service-accounts">this github link</a>.</p><h3>Internal Nginx-Ingress Controller</h3><p>You can access the service account ouputs to be used for installations from local state files or remote state files. Below are examples of both configurations. If you want to access from remote state, you need to open the backend configurations in the serviceaccountmain.tf file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/33204d58d80e7cd5b6e2566b68d3c0dd/href">https://medium.com/media/33204d58d80e7cd5b6e2566b68d3c0dd/href</a></iframe><blockquote>Instead of the configs used in the helm charts, it should be configured as follows to be able to use its own values.The file to be referenced here should be values.yaml in the relevant helm chart. The required parameters in the <a href="https://github.com/nginxinc/kubernetes-ingress/blob/main/deployments/helm-chart/values.yaml">values.yaml</a> file are given our own values in accordance with their usage styles.</blockquote><p>By default, an NGINX ingress controller is created with a dynamic public IP address assignment. A common configuration requirement is to use an internal, private network and IP address. This approach allows you to restrict access to your services to internal users, with no external access.</p><p>For internal ingress, the <em>service.beta.kubernetes.io/azure-load-balancer-internal</em>annotation should be used.</p><blockquote>Here, the ingress will be created in the system node pool. If there is more than one subnet, it is necessary to get an ip from the subnet used by the node pool where ingress will be created for the internal ingress load balancer ip. Otherwise, it will get an error because it cannot get a rope from the appropriate place and ingress will not work. The service.beta.kubernetes.io/azure-load-balancer-internal-subnetannotation must be added for this configuration.</blockquote><p><strong>Tips:</strong> LoadBalancerIP can be left empty. If left blank, an unused ip from the relevant subnet will be assigned. If it is not desired to be left blank, one of the unused threads in the relevant subnet should be checked and given to the loadbalancer ip parameter.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f0c909440bdfc930544e07394571cc8a/href">https://medium.com/media/f0c909440bdfc930544e07394571cc8a/href</a></iframe><p>Provide your own internal IP address for use with the ingress controller. Make sure that this IP address isn’t already in use within your virtual network. Also, if you’re using an existing virtual network and subnet, you must configure your AKS cluster with the correct permissions to manage the virtual network and subnet. For more information, see <a href="https://docs.microsoft.com/en-us/azure/aks/configure-kubenet">Use kubenet networking with your own IP address ranges in Azure Kubernetes Service (AKS)</a> or <a href="https://docs.microsoft.com/en-us/azure/aks/configure-azure-cni">Configure Azure CNI networking in Azure Kubernetes Service (AKS)</a>.</p><p>You can access the variables and provider versions from <a href="https://github.com/kdryetyln/InternalNginxController/tree/main/ingress">this github link</a>.</p><h3>Terraform Execute</h3><p>Don’t forget to review <a href="https://docs.microsoft.com/en-us/azure/developer/terraform/get-started-windows-powershell?tabs=bash#5-authenticate-terraform-to-azure">this document </a>to login to Azure from Terraform.</p><pre>az login<br>az account set --subscription &quot;&lt;subscription_id_or_name&gt;</pre><pre>#If a new provider is added to the module, it should be run by adding -upgrade.<br>terraform init</pre><pre>#Optional. It can be used if it is desired to look at the changes before installation.<br>terraform plan <br></pre><pre>#If you want changes to be applied without requiring an additional confirmation, it can be run by adding -auto-approve.<br>terraform apply</pre><pre>#If you want to undo the changes made, this command can be run. But when this is run all processes are destroyed. At the same time, auto approve can be used as in apple.<br>terraform destroy</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*s2D1wXxwNMYe7ZuR" /></figure><p>If you would like to show your support, tap on the image 👇🎉</p><figure><a href="https://www.buymeacoffee.com/kdryegns"><img alt="" src="https://cdn-images-1.medium.com/max/454/0*PAlUPgUiVGObcKLh.png" /></a></figure><p><strong>Reference Links</strong></p><p><a href="https://github.com/kdryetyln/InternalNginxController">https://github.com/kdryetyln/InternalNginxController</a></p><p><a href="https://kubernetes.github.io/ingress-nginx/deploy/rbac/">https://kubernetes.github.io/ingress-nginx/deploy/rbac/</a></p><p><a href="https://docs.microsoft.com/en-us/azure/aks/internal-lb">https://docs.microsoft.com/en-us/azure/aks/internal-lb</a></p><p><a href="https://docs.microsoft.com/en-us/azure/aks/ingress-basic?tabs=azure-cli#use-an-internal-ip-address">https://docs.microsoft.com/en-us/azure/aks/ingress-basic?tabs=azure-cli#use-an-internal-ip-address</a></p><p><a href="https://github.com/nginxinc/kubernetes-ingress/blob/main/deployments/helm-chart/values.yaml">https://github.com/nginxinc/kubernetes-ingress/blob/main/deployments/helm-chart/values.yaml</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b6386492d56" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to deploy docker image to AWS App Runner with Terraform?]]></title>
            <link>https://medium.com/kocsistem/how-to-deploy-docker-image-to-aws-app-runner-with-terraform-5048eecff047?source=rss-93cb980be12b------2</link>
            <guid isPermaLink="false">https://medium.com/p/5048eecff047</guid>
            <category><![CDATA[azure-pipelines]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[apprunner]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Kadriye Taylan]]></dc:creator>
            <pubDate>Thu, 17 Mar 2022 07:20:48 GMT</pubDate>
            <atom:updated>2022-03-17T13:47:13.801Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OW6Na5RFaY9qvK7zBw3N_w.png" /></figure><p>Hi everyone, in this article I will talk about how to create AWS App Runner service with terraform and how to automate it with Azure Pipeline.</p><p>Before we start, let’s leave a few explanations below for those who do not know terraform and app runner.</p><h4>What is terraform and why do we need terraform?</h4><p>HashiCorp Terraform is an open-source infrastructure as code tool that lets you define both cloud and on-prem resources in human-readable configuration files that you can version, reuse, and share. You can then use a consistent workflow to provision and manage all of your infrastructure throughout its lifecycle. Users define and provide data center infrastructure using a declarative configuration language known as HashiCorp Configuration Language (HCL), or optionally JSON. Terraform can manage low-level components like compute, storage, and networking resources, as well as high-level components like DNS entries and SaaS features. You can access the details from <a href="https://www.terraform.io/docs">this link</a>.</p><p><strong>Some open-source infrastructure as code tools that can be used outside of terraform:</strong></p><ul><li>Chef</li><li>Puppet</li><li>CFEngine</li><li>Ansible</li><li>Otter</li></ul><h4>What is App Runner?</h4><p>AWS App Runner is a fully managed service that makes it easy for developers to quickly deploy containerized web applications and APIs, at scale and with no prior infrastructure experience required. Start with your source code or a container image. App Runner builds and deploys the web application automatically, load balances traffic with encryption, scales to meet your traffic needs, and makes it easy for your services to communicate with other AWS services and applications that run in a private Amazon VPC. With App Runner, rather than thinking about servers or scaling, you have more time to focus on your applications. You can access the details from <a href="https://docs.aws.amazon.com/apprunner/latest/dg/what-is-apprunner.html">this link</a>.</p><p><strong>Similar services that we can use in other cloud technologies:</strong></p><ul><li>Azure App Service</li><li>Google Cloud Run</li></ul><p>Let’s begin!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*sOodojzxboNOa1rN" /></figure><p><strong>Requirements for AWS App Runner:</strong></p><ul><li>AWS IAM keys (access key and secret key) for access AWS resources</li><li>AWS IAM role and policy for create App Runner service (only required for Private ECR)</li><li>Public or Private ECR for docker images</li><li>Terraform CLI</li></ul><h4>Create App Runner</h4><p>There are two registries that App runner supports for docker images and both are AWS services. These are ECR and ECR Public, and App Runner configurations differ for both. I will show you how I did it in both.</p><p>I already had an image and pushed it into a private ecr. However, if you do not have an image and you want to push it to your ecr, you can take a look at <a href="https://medium.com/kocsistem/the-mystery-is-solved-between-azure-devops-and-aws-ecr-public-50a7204c0254">this medium post</a>. Also, the terraform files I used while creating the ecr are as follows.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7944cfd617f2bd7b436dd270f58c75a7/href">https://medium.com/media/7944cfd617f2bd7b436dd270f58c75a7/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/04742ee2cdbb6bd5848f0fc8987ee982/href">https://medium.com/media/04742ee2cdbb6bd5848f0fc8987ee982/href</a></iframe><p><strong>App Runner with Private ECR</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/698f7b2df21a504a0dc68e9cfb91f007/href">https://medium.com/media/698f7b2df21a504a0dc68e9cfb91f007/href</a></iframe><p><strong>Region</strong></p><p>App Runner is only supported in 5 regions. <a href="https://docs.aws.amazon.com/general/latest/gr/apprunner.html">Details</a></p><ul><li>US East (Ohio) : us-east-2</li><li>US East (N. Virginia) : us-east-1</li><li>US West (Oregon) : us-west-2</li><li>Asia Pacific (Tokyo) : ap-northeast-1</li><li>Europe (Ireland) : eu-west-1</li></ul><h4>Resources</h4><p><strong>aws_iam_role</strong></p><p>Provides an IAM role.</p><p>The IAM role is an IAM entity that defines a set of <a href="https://aws.amazon.com/iam/details/manage-permissions/">permissions</a> for making AWS service requests. IAM roles are not associated with a specific user or group.</p><p><strong>aws_iam_role_policy_attachment</strong></p><p>Attaches a Managed IAM Policy to an IAM role.</p><p>Attaches the specified managed policy to the specified IAM role. When you attach a managed policy to a role, the managed policy becomes part of the role’s permission (access) policy.</p><p><strong><em>We need these two resources as we will be using images from Private ECR.</em></strong></p><p><strong>time_sleep</strong></p><p>Manages a resource that delays creation and/or destruction, typically for further resources. This prevents cross-platform compatibility and destroy-time issues with using the <a href="https://www.terraform.io/docs/provisioners/local-exec.html">local-exec provisioner</a>.</p><p><strong>aws_apprunner_service</strong></p><p>Manages an App Runner Service.</p><p>I used the arguments above as a basic example, but you can find other arguments you can use for this resource from <a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/apprunner_service#argument-reference">this link</a>.</p><h4>Why am I using time sleep?</h4><p>Before using Sleep, I was getting an error as below while creating the app runner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mJMFMA3m0ZQD9BG6Bi4odg.png" /></figure><pre><strong>Error: error creating App Runner Service (demo_apprunner): InvalidRequestException: Error in assuming access role arn:aws:iam::&lt;account-id&gt;:role/&lt;role-name&gt;</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*Bptmt9inrsB1t8ia" /><figcaption>spongebob is sad</figcaption></figure><p>While investigating the cause of the error, I came across a <a href="https://github.com/pulumi/pulumi-aws/issues/1697">github issue</a>.</p><blockquote>Creating the access role and immediately creating the service afterwards results in that same error.</blockquote><p>AWS IAM Role is an essential resource for the App runner. However, the role must be successfully created before the App runner. Since this process will take some time, you need to wait for a while before creating the app runner.</p><p>I set it to 60 sec. However, this period can be reduced.</p><p><em>However, it seemed a little strange to me that such an error occurs when creating resources that are dependent on each other or that the solution is provided with a delay. But it was the only solution I could find :)</em></p><p><em>If you know of a more effective solution, I would appreciate it if you let me know in the comments :)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*ZrOgxrxAg16fwyGh" /></figure><p><strong>App Runner with Public ECR</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a30d5faa057f8b67dd56bffb92d119f9/href">https://medium.com/media/a30d5faa057f8b67dd56bffb92d119f9/href</a></iframe><p><em>auto_deployments_enabled is an argument that you can only use in the private registry. Since the default value is true, you need to set it back to false when using public ecr.</em></p><p><strong>If you want to run these terraform scripts in your local without using any CI/CD tool, you can add your aws access keys to your terraform file as follows.</strong></p><pre>provider &quot;aws&quot; {<br>  region     = &quot;us-east-1&quot;<br>  access_key = &quot;&lt;your-aws-access-key&gt;&quot;<br>  secret_key = &quot;&lt;your-aws-secret-key&gt;&quot;<br>}</pre><p>You can reach access key and secret key by following <a href="https://docs.aws.amazon.com/powershell/latest/userguide/pstools-appendix-sign-up.html">this document</a>.</p><p><strong>Pipeline</strong></p><p>My terraform repo structure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/413/1*3eozvICJuLfGFKVgTlSYXA.png" /></figure><p>I am using Azure Pipeline for CI/CD tool.</p><p><strong>Requirements for Pipeline:</strong></p><ul><li>Terraform tasks for Azure Pipeline. You can look <a href="https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform">this link</a>.</li><li>AWS Service Connection. From the Project in Azure DevOps, go to Project Settings &gt; Service Connection &gt; AWS for Terraform and write the connection information (You should use aws access key and secret key here).</li></ul><p>You can see my terraform scripts in my yaml file that I run with azure pipeline below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8056b6337db4820d09a11d2e75d60d29/href">https://medium.com/media/8056b6337db4820d09a11d2e75d60d29/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-i9UQl7D5IiNVkKENDrz4Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*eu4RM8wU0Wf3l8Lx" /><figcaption>spongebob is happy now</figcaption></figure><p>I hope it was an useful article. Have a nice day everybody :) Stay healthy!</p><p><strong>References</strong></p><p><a href="https://www.terraform.io/intro">https://www.terraform.io/intro</a></p><p><a href="https://en.wikipedia.org/wiki/Terraform_(software)">https://en.wikipedia.org/wiki/Terraform_(software)</a></p><p><a href="https://aws.amazon.com/apprunner/">https://aws.amazon.com/apprunner/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5048eecff047" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kocsistem/how-to-deploy-docker-image-to-aws-app-runner-with-terraform-5048eecff047">How to deploy docker image to AWS App Runner with Terraform?</a> was originally published in <a href="https://medium.com/kocsistem">KoçSistem</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The mystery is solved between Azure DevOps and AWS ECR Public]]></title>
            <link>https://medium.com/kocsistem/the-mystery-is-solved-between-azure-devops-and-aws-ecr-public-50a7204c0254?source=rss-93cb980be12b------2</link>
            <guid isPermaLink="false">https://medium.com/p/50a7204c0254</guid>
            <category><![CDATA[aws-ecr]]></category>
            <category><![CDATA[azure-devops-pipeline]]></category>
            <category><![CDATA[koçsistem]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Kadriye Taylan]]></dc:creator>
            <pubDate>Sat, 12 Mar 2022 15:02:38 GMT</pubDate>
            <atom:updated>2022-03-12T15:30:24.826Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*5NaK0MfqoSFw7rvbosBBJQ.png" /></figure><p>Hi everyone, In this article I will talk about the error I got while pushing images to the AWS ECR Public with the Azure Pipeline and a simple solution for this error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*osUXrDwRGTj4lbBs" /></figure><p>First of all, I would like to explain the image repository services of AWS. There are two different types of AWS’s ECR service. These are AWS ECR(Private) and AWS ECR Public.</p><blockquote>Amazon Elastic Container Registry (Amazon ECR) is an AWS managed container image registry service that is secure, scalable, and reliable. Amazon ECR supports private repositories with resource-based permissions using AWS IAM.</blockquote><blockquote>Amazon Elastic Container Registry Public is a managed AWS container image registry service that is secure, scalable, and reliable. Amazon ECR supports public image repositories with resource-based permissions using AWS IAM so that specific users can access your public repositories to push images.</blockquote><p>If you define a private ecr, your ecr address will be as follows : https://&lt;<em>aws_account_id&gt;</em>.dkr.ecr.&lt;<em>region&gt;</em>.amazonaws.com</p><p>If you define a public ecr, your ecr address will be as follows : https://<em>public.ecr.aws/&lt;registry_alias&gt;</em></p><p>Now we will create a service connection in azure devops to send an image to the public ecr address.</p><p>From the Project in Azure DevOps, go to Project Settings &gt; Service Connection &gt; Docker Registry &gt; Others and write the connection information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dhKiDkTHgt3KI1Ki3x1YNQ.png" /></figure><p>You can access the AWS Public ECR docker login information as in the image below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9fLTwK0EXeSqzJ_tAEWInA.png" /></figure><p>The Azure Pipeline yaml file from which the docker image is pushed to the Registry is as follows.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/50a3104bbc605f826462a1d9d3bac6b2/href">https://medium.com/media/50a3104bbc605f826462a1d9d3bac6b2/href</a></iframe><p>When The pipeline runs with its configurations like this, an error as follows appears.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*KvkcGvI4-EmDxNoq6NXjow.png" /></figure><pre>error parsing HTTP 404 response body: invalid character ‘p’ after top-level value: “404 page not found\n”</pre><pre>##[error]error parsing HTTP 404 response body: invalid character ‘p’ after top-level value: “404 page not found\n”</pre><pre>##[error]The process ‘/usr/bin/docker’ failed with exit code 1</pre><p>Solving the error I looked at some places like stackoverflow, github and tried various solutions but none of them worked.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FUS0y4X7FONHaM%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fwhat-gross-US0y4X7FONHaM&amp;image=https%3A%2F%2Fmedia1.giphy.com%2Fmedia%2FUS0y4X7FONHaM%2Fgiphy.gif%3Fcid%3D790b7611ed0a91215969646412e3af9037677611f93dc3ee%26rid%3Dgiphy.gif%26ct%3Dg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="243" frameborder="0" scrolling="no"><a href="https://medium.com/media/895f2f98a55e3f3d7f79ec3705d65404/href">https://medium.com/media/895f2f98a55e3f3d7f79ec3705d65404/href</a></iframe><p>Then, when I examined the error detail, I saw that my registry url was as follows.</p><pre>The push refers to repository [public.ecr.aws/myimagerepositoryname]</pre><p>But the url should have been:</p><pre>public.ecr.aws/<strong><em>&lt;registry_alias&gt;</em></strong>/myimagerepositoryname</pre><p>As a solution, I updated my repository parameter in the pipeline yaml file as follows and I was able to successfully push my image to my public ecr repository.</p><pre>- task: Docker@2<br>  enabled: true  <br>  inputs:    <br>    containerRegistry: &#39;AWS Public ECR&#39;    <br>   <strong> repository: &#39;</strong><strong><em>&lt;registry_alias&gt;</em>/myimagerepositoryname&#39;</strong><br>    command: &#39;buildAndPush&#39;<br>    Dockerfile: &#39;app/Dockerfile&#39;<br>    tags: &#39;$(Build.BuildId)&#39;</pre><p>Even though I applied a workaround in this way, I was quite surprised that azure devops did not detect the id after the / sign in the url I gave in the service connection and threw such an error.</p><p>I will open an issue with microsoft on the subject. If it’s a bug they will fix it.</p><p>I hope it was an useful article. Have a nice day everybody :) Stay healthy!</p><p><strong>References</strong></p><p><a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/what-is-ecr.html">https://docs.aws.amazon.com/AmazonECR/latest/userguide/what-is-ecr.html</a></p><p><a href="https://docs.aws.amazon.com/AmazonECR/latest/public/what-is-ecr.html">https://docs.aws.amazon.com/AmazonECR/latest/public/what-is-ecr.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50a7204c0254" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kocsistem/the-mystery-is-solved-between-azure-devops-and-aws-ecr-public-50a7204c0254">The mystery is solved between Azure DevOps and AWS ECR Public</a> was originally published in <a href="https://medium.com/kocsistem">KoçSistem</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NGINX Ingress? Kubernetes Ingress?]]></title>
            <link>https://kadriyetaylan.medium.com/what-is-the-difference-nginx-ingress-annotations-2fe6825ced1f?source=rss-93cb980be12b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2fe6825ced1f</guid>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[ingress]]></category>
            <category><![CDATA[annotations]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Kadriye Taylan]]></dc:creator>
            <pubDate>Sun, 20 Feb 2022 14:45:45 GMT</pubDate>
            <atom:updated>2024-01-10T12:52:41.119Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, I will explain why I got the ERR_FAILED 413 error and the solutions I used to solve it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/267/0*jcoMjgfzhObAakuK" /></figure><p>The ERR_FAILED 413 error may occur when uploading a large file.</p><p>On web servers, file size limits are defined to prevent users from bottlenecking the server and unnecessary use of storage space. It may vary depending on the default settings of the web server, proxy or load balancer used for this application. For example, these limits are 1mb for Nginx and 2mb for Apache Server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*nzDI2bww9QGZKQWQIK1Mow.png" /></figure><p>In my case, my application is running on Kubernetes and application network traffic is routed by Nginx Ingress.</p><blockquote><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#ingress-v1-networking-k8s-io">Ingress</a> exposes HTTP and HTTPS routes from outside the cluster to <a href="https://kubernetes.io/docs/concepts/services-networking/service/">services</a> within the cluster. Traffic routing is controlled by rules defined on the Ingress resource.</blockquote><p>I mentioned above that the Nginx default upload limit is 1 mb. There are many default values like these in Nginx. You can change these values in your ingress yaml file via annotaions.</p><h4>What do annotations do?</h4><p>Annotations applied to an Ingress resource allow you to use advanced NGINX features and customize/fine tune NGINX behavior for that Ingress resource.</p><p>Before the solution there was only one annotation in my ingress yaml file.</p><pre>apiVersion: networking.k8s.io/v1<br>kind: Ingress<br>metadata:<br>  name: &lt;ingress-name&gt;<br>  namespace: &lt;namespace-name&gt;<br>  annotations:<br>     kubernetes.io/ingress.class: &quot;nginx&quot;</pre><p>But,<strong><em> </em></strong><em>kubernetes.io/ingress.class</em> annotation was deprecated.</p><blockquote>Before the IngressClass resource and ingressClassName field were added in Kubernetes 1.18, Ingress classes were specified with a kubernetes.io/ingress.class annotation on the Ingress. This annotation was never formally defined, but was widely supported by Ingress controllers.</blockquote><h4>What is the solution?</h4><p>Actually this error was fixed with just a single ingress annotation. However, while researching the solution for this error, I saw different annotation prefixes. The two different solutions I tried are as follows.</p><pre>nginx.org/client-max-body-size: &quot;1024m&quot;<br>nginx.ingress.kubernetes.io/proxy-body-size: &quot;1024m&quot;</pre><p><em>nginx.org annotation solved my problem.</em></p><p><strong>However, what is the difference between these two annotations?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/267/0*W8OQ78RQmA5jnN29" /></figure><p>I learned that there are two different nginx ingress controller options that can be used in kubernetes. These are NGINX and Kubernetes Community Ingress Controller.</p><p>If you are using<strong> the community version</strong>, you need to specify your nginx annotations with the <strong>nginx.ingress.kubernetes.io </strong>prefix. <a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/">Other Annotations</a></p><p>If you are using the <strong>nginx version</strong>, you should use <strong>the nginx.org</strong> prefix. <a href="https://docs.nginx.com/nginx-ingress-controller/configuration/ingress-resources/advanced-configuration-with-annotations/">Other Annotations</a></p><p><em>You can examine the differences and comparisons in detail from the links in the reference section below.</em></p><p>There is much to learn from even a simple error. And if you are using Kubernetes it is possible to learn something new every day :)</p><p>If you would like to show your support, tap on the image 👇🎉</p><figure><a href="https://www.buymeacoffee.com/kdryegns"><img alt="" src="https://cdn-images-1.medium.com/max/454/1*LzUflYPGVvt9VR53A6KY_w.png" /></a></figure><p><a href="https://medium.com/flant-com/comparing-ingress-controllers-for-kubernetes-9b397483b46b">Comparing Ingress controllers for Kubernetes</a></p><p><a href="https://www.nginx.com/blog/guide-to-choosing-ingress-controller-part-4-nginx-ingress-controller-options/">NGINX Ingress Controller Options</a></p><p><a href="https://docs.nginx.com/nginx-ingress-controller/configuration/ingress-resources/advanced-configuration-with-annotations/">NGINX Annotations</a></p><p><a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/">Community version Annotations</a></p><p><a href="https://kubernetes.io/docs/concepts/services-networking/ingress/">Kubernetes Ingress</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2fe6825ced1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SonarQube and Azure DevOps Branch Policies]]></title>
            <link>https://medium.com/kocsistem/sonarqube-and-azure-devops-branch-policies-e6058527ad15?source=rss-93cb980be12b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6058527ad15</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[sonarqube]]></category>
            <category><![CDATA[yaml]]></category>
            <category><![CDATA[azure-pipelines]]></category>
            <category><![CDATA[branch-policies]]></category>
            <dc:creator><![CDATA[Kadriye Taylan]]></dc:creator>
            <pubDate>Sun, 09 Jan 2022 21:44:33 GMT</pubDate>
            <atom:updated>2022-01-10T09:13:50.847Z</atom:updated>
            <content:encoded><![CDATA[<p>This article explains how to use SonarQube and branch policies on Azure DevOps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*tfGso5bRZxe_3UznGP2x5Q.png" /></figure><blockquote><a href="http://www.sonarqube.org/">SonarQube</a> is an automatic code review tool to detect bugs, vulnerabilities, and code smells in your code. It can integrate with your existing workflow to enable continuous code inspection across your project branches and pull requests.</blockquote><blockquote>Branch policies help you protect important branches and enforce code quality. When a branch has a policy set to it, it is no longer possible to commit directly to it. All changes need to be done through a Pull Request (PR).</blockquote><p>While developing code, various practices are operated to ensure quality. Examples of these are performing Static and Dynamic Code Analysis and operating Branch Policies. These practices, on the other hand, are operated in the DevOps lifecycle, ensuring that the products are of higher quality.</p><h4>Azure DevOps Branch Policies</h4><p>There are some branch policies in Azure DevOps that we can use to protect important branches.</p><p>In order to apply a branch policy to a branch, you must go to the branches page of the code repo under Azure Repo and go to the policies page as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-wOZN6CFy5VjKWFJP3_vSg.png" /></figure><p>There are 7 policies that can be applied here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dg4r9l_C3R_UvFuIqtRnig.png" /></figure><p><strong>Require a minimum number of reviewers</strong></p><p>Code reviews are important for software development projects. To ensure that teams review and approve PRs, you can require approval from a minimum number of reviewers. The basic policy requires that a specified number of reviewers approve the code, with no rejections.</p><p><strong>Check for linked work items</strong></p><p>For <a href="https://docs.microsoft.com/en-us/azure/devops/boards/backlogs/connect-work-items-to-git-dev-ops?view=azure-devops">work item management tracking</a>, you can require associations between PRs and work items. Linking work items provides more context for changes, and ensures that updates go through your work item tracking process.</p><p><strong>Check for comment resolution</strong></p><p>The Check for comment resolution policy checks whether all PR comments are resolved.</p><p><strong>Limit merge types</strong></p><p>Azure Repos has several merge strategies, and by default, all of them are allowed. You can maintain a consistent branch history by enforcing a merge strategy for PR completion.</p><p><strong>Build validation</strong></p><p>You can set a policy requiring PR changes to build successfully before the PR can complete. Build policies reduce breaks and keep your test results passing. Build policies help even if you’re using <a href="https://docs.microsoft.com/en-us/devops/develop/what-is-continuous-integration">continuous integration</a> (CI) on your development branches to catch problems early.</p><p>A build validation policy queues a new build when a new PR is created or changes are pushed to an existing PR that targets the branch. The build policy evaluates the build results to determine whether the PR can be completed.</p><p><strong>Status checks</strong></p><p>External services can use the PR <a href="https://docs.microsoft.com/en-us/rest/api/azure/devops/git/pull%20request%20statuses">Status API</a> to post detailed status to your PRs. The branch policy for additional services enables those third-party services to participate in the PR workflow and establish policy requirements.</p><p><strong>Automatically include code reviewers</strong></p><p>You can automatically add reviewers to pull requests that change files in specific directories and files, or to all pull requests in a repo.</p><p>After developing a code, a pull request is issued to get this development to the main branch. However, if the new developments contain any bugs, it will be much more difficult and costly to resolve the issues after taking these codes to the main branch. Therefore, it is better to go through a code scan of these improvements before merging the code.</p><p>To avoid this problem, Build Validation policy can be used.</p><p>Here is my solution;</p><p>To add a build validation policy</p><ol><li>Select the + button next to Build validation.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*BBiZywrvQ1X9BS9w" /></figure><p>2. Fill out the Set build policy form:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/0*Xw_svxW_rvUV85ts" /></figure><ul><li>Select the Build pipeline to validate.</li><li>Optionally set a Path filter.</li><li>Under Trigger, select Automatic (whenever the source branch is updated) or Manual.</li><li>Under Policy requirement, select Required or Optional. If you choose Required, builds must complete successfully to complete PRs. Choose Optional to provide a notification of the build failure but still allow PRs to complete.</li></ul><h4>Azure Pipelines YAML</h4><p>In my solution, I include the newly developed codes in the new code scan on SonarQube with the branch validation policy I applied for master branch. For my master branch, I include it in full code scan at certain time intervals. Thus, I don’n waste time scanning my master branch for each pipeline by scanning each new code before the merge into my main branch.</p><p>In the pipeline below, 3 separate prepare sonarqube steps with different configurations have been added for PR , Scheduled and Manual triggering options. However, a single step has been added for analysis and publishing. If the reason for triggering is PR, if the scan result does not pass through SonarQube Quality Gate, the build is broken with the buildbreaker task and the merge process is prevented.</p><p>Here is my pipeline yaml:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/59f163e5e0dc0b8b5ea139cb7d171c91/href">https://medium.com/media/59f163e5e0dc0b8b5ea139cb7d171c91/href</a></iframe><blockquote>My sonarqube version is 8.9.2 community.</blockquote><p>I hope it was a useful article. See you in my next post :)</p><h4>Reference</h4><p><a href="https://dev.to/evdbogaard/branch-policies-in-azure-repos-11c5">https://dev.to/evdbogaard/branch-policies-in-azure-repos-11c5</a><br> <a href="https://docs.sonarqube.org/latest/">https://docs.sonarqube.org/latest/</a><br> <a href="https://www.sonarqube.org/microsoft-azure-devops-integration/">https://www.sonarqube.org/microsoft-azure-devops-integration/</a><br> <a href="https://docs.microsoft.com/en-us/azure/devops/repos/git/branch-policies?view=azure-devops&amp;tabs=browser">https://docs.microsoft.com/en-us/azure/devops/repos/git/branch-policies?view=azure-devops&amp;tabs=browser</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6058527ad15" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kocsistem/sonarqube-and-azure-devops-branch-policies-e6058527ad15">SonarQube and Azure DevOps Branch Policies</a> was originally published in <a href="https://medium.com/kocsistem">KoçSistem</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multiple Artifact Usage in Azure Pipelines Release]]></title>
            <link>https://medium.com/kocsistem/multiple-artifact-usage-in-azure-pipelines-release-3cc095ce0334?source=rss-93cb980be12b------2</link>
            <guid isPermaLink="false">https://medium.com/p/3cc095ce0334</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[azure-pipelines-releases]]></category>
            <category><![CDATA[error]]></category>
            <category><![CDATA[azure-pipelines]]></category>
            <category><![CDATA[koçsistem]]></category>
            <dc:creator><![CDATA[Kadriye Taylan]]></dc:creator>
            <pubDate>Tue, 14 Dec 2021 22:15:58 GMT</pubDate>
            <atom:updated>2021-12-15T10:07:51.472Z</atom:updated>
            <content:encoded><![CDATA[<p>Azure Pipelines Release feature allows us to use more than one Artifact. These artifacts can be of the same type or of different types. Thus, we can easily perform deployments using different artifact types within a release pipeline. However, this feature requires us to pay attention to small details when preparing release pipelines. In this article, I will share an error that I got related to this issue, along with its solution.</p><p>Before explaining the error, let’s briefly talk about Azure Pipelines Artifact types.</p><p><strong>Azure Pipelines Artifact Types</strong></p><p>The artifact types you can add to the release pipeline on Azure Pipeline are as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m52yGVjTi6ni2SbtdsMhSw.png" /></figure><p>Here, the artifact type can be selected according to the need.</p><p>E.g; If you want to use the output of a build pipeline created on Azure Pipeline, the <strong>Build type </strong>must be selected as the source type. If there is a need to use a file in a repo in Azure Repos instead of any build output, <strong>Azure Repos Git type</strong> should be selected as the source type. Azure Pipelines supports not only Azure DevOps components but also external services. Examples of these are the services of popular tools such as Jenkis, Github, Gitlab.</p><p><strong>Here is my example:</strong></p><p>I have a release pipeline where I use Build and Azure Repos Git artifact types at the same time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*94vyqDaXWCKB3-aieYQJZg.png" /></figure><p>When I first run the Release pipeline, I got an error like the one below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*nJbu2bxzYleYkAPvATES8A.png" /></figure><p>It was saying ‘No Package found with specified pattern’ even though I used two artifacts and these artifacts were full. I looked through the task configurations in the release pipeline and at first I couldn’t understand the error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4OZfxVrj4rMh_j7Bv4L1fA.png" /></figure><p>According to the above configuration, a file in the Build Number folder in the drop folder of the _IPS.Build-Dev build will be deployed to IIS.</p><p><strong>Solution</strong></p><p>However, when I researched the error here, I realized that when using the BuildNumber parameter, it is necessary to specify which build it belongs to separately.</p><p>I successfully resolved the error by changing the BuildNumber parameter I gave in the file path as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9FdHJQCorDrq0za3lmSQwQ.png" /></figure><p>For each artifact that is referenced in a release, you can use the following artifact variables. Not all variables are meaningful for each artifact type. Replace the {alias} placeholder with the value you specified for the artifact alias or with the default value generated for the release pipeline.</p><pre><br>Release.Artifacts.{<a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/release/artifacts?view=azure-devops#source-alias">alias</a>}.BuildNumber</pre><p>You can find the alias information from the place I marked in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nYXlkqbZNYb0TrZpdTwogA.png" /></figure><h4>Reference</h4><p><a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/release/variables?view=azure-devops&amp;tabs=batch#general-artifact">https://docs.microsoft.com/en-us/azure/devops/pipelines/release/variables?view=azure-devops&amp;tabs=batch#general-artifact</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3cc095ce0334" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kocsistem/multiple-artifact-usage-in-azure-pipelines-release-3cc095ce0334">Multiple Artifact Usage in Azure Pipelines Release</a> was originally published in <a href="https://medium.com/kocsistem">KoçSistem</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CI/CD süreçlerinde Test Otomasyonu]]></title>
            <link>https://medium.com/kocsistem/ci-cd-s%C3%BCre%C3%A7lerinde-test-otomasyonu-a4f6ef376e92?source=rss-93cb980be12b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4f6ef376e92</guid>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[quality]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Kadriye Taylan]]></dc:creator>
            <pubDate>Sun, 07 Nov 2021 12:55:57 GMT</pubDate>
            <atom:updated>2021-11-07T13:08:03.099Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*TA6CfgytbugEPzM-7yU8bw.png" /></figure><p>Agile ile birlikte aslında test süreçleri kısaldığı için daha kısa zamanda daha etkin bir test süreci oluşturmamız gerekiyor. Agile yazılım yaşam döngüsünde, gereksinimlerin hazırlanma hızı ve bunlara ait geliştirmelerin de hızlanması ile birlikte, bu hıza test açısından da aynı şekilde yanıt vermek gerekmektedir. Aslında test, yazılım yaşam döngüsünden bağımsız gerçekleştirilen bir süreç değil, aksine döngünün her adımında işletilmesi gereken bir süreç. Bununla birlikte test otomasyonu otomasyon scriptleri yazıyoruz ancak elbette işimiz script yazmakla bitmiyor. Yukarıda söylediğim gibi bu hıza ayak uydurmamız gerekiyor. Yazılan scriptlerin CI/CD süreçlerine entegre ederek, continious testing kültürünü ekip ya da şirket içerisinde oluşturmamız gerekir. Böylelikle uygulama güncellemelerinin ve altyapı değişikliklerinin kalitesinden emin olarak hem daha hızlı daha güvenilir şekilde teslimat gerçekleştirilebilir. Bunun yanında da son kullanıcı deneyiminin olumlu kalmasını sağlayabiliriz.</p><p>Ben de bu yazımda sizlere test otomasyon süreçlerinin CI/CD hattına nasıl entegre edilebileceğinden bahsetmek istiyorum.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zryz5FS1n-RDG2nt99Ib6g.png" /></figure><p>Yazıma CI/CD süreçlerine geçiş yapmadan önce Test Süreçleri için öne çıkan bir kültürden bahsederek başlayacağım.</p><h4>Ideal Test Pyramid</h4><p>Ideal Test Pyramid’i testleri kapsam ve boyutuna göre sınıflandırmak için kullanılır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GpspjvF7zceNg059y6FA1A.png" /></figure><p>Bu patternden kısaca bahsetmek gerekirse;</p><p>Mike Cohn’un Succeeding with Agile adlı kitabında tasarlamış olduğu ideal test piramidinde gösterildiği gibi :</p><ol><li>Daha hızlı ve daha fazla izolasyona sahip olduğu için çok sayıda Unit Test yazılmalı. Unit Testler : Başka bir bağımlılık içermeden yapılabilmektedir.</li><li>Low-Level’dır, sistemin küçük bir kısmına odaklanırlar. Böylelikle çok sıklıkla çalıştırılabilirler.</li><li>Orta düzeyde izolasyona sahip olduğu ve çok hızlı olmadıkları için bazı servis testleri yazılmalı. Servis (API/Integration/Component) Testleri : Servis testleri, REST APIS ve veri tabanı gibi diğer sistemlerle entegre olan testlerdir.</li><li>Daha yavaş oldukları ve daha fazla entegrasyona sahip oldukları için çok az UI Testi yazılmalı.</li><li>Piramitte yukarı doğru çıkıldıkça <em>Coverage, Maintenance, Fragility, Duration, Cost</em> artmaktadır.</li></ol><p><strong><em>Biraz da Kod Kalitesinin Sağlanmasından bahsedelim</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/1*rKtb57ZbNSvxdDdNCk3Pzw.png" /></figure><h4>Continuous Code Quality Nedir?</h4><p>Kod kalitesinin sürekli olarak denetim altında tutulması, projeye eklenen yeni kodlarda mevcut olabilecek bug, güvenlik zafiyeti, anti-pattern, gereksiz veya tekrarlı kod vb. gibi olumsuz durumların otomatik olarak gözlemlenmesi ve raporlanabilmesidir.</p><p>Continuous Code Quality’i Continuous Integration sürecine eklenebilen yan bir süreçtir. Yazımın konusu ise bu sürecin nasıl eklenebileceğidir.</p><p>DevOps kültürünün benimsendiği ve uygulandığı ekiplerde, bu kültürün bir sonucu olarak, işleri otomasyona bağlamaya olan eğilim, ekibi bir kod kalite analiz yazılımını CI hattı içerisine dahil etmeye yöneltmektedir.</p><p>Continuous Quality’i CI hattına dahil edilmesi ile yazılım deployment süreçlerinin hızlı, kararlı , performanslı, güvenli ve kaliteli bir şekilde gerçekleştirebilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XFWKTvycJE-UM8E57qfQTQ.png" /><figcaption>Continuous Quality Pipeline of KoçSistem</figcaption></figure><p>Peki Continuous Quality süreçlerinde kullanabileceğimiz araçlar neler ve bunları hangi aşamada kullanmalıyız?</p><h4>Static Code Analysis</h4><p>Statik kod analizi, derlenebilir durumdaki bir uygulamanın kaynak kodları taranarak güvenlik zafiyetlerinin tespit edilmesidir.</p><p>Statik Kod Analizi, clean kod yazmanın en önemli bacağı olarak değerlendirilmelidir. Statik kod analiz araçları ile tekrarlı kodlardan kaçınma, kodlama standartlarına uyma, Unit Test’lerin yeterliliği, karmaşık kodların doğru bir şekilde tasarlanması gibi kriterleri karşılamak daha kolay olmaktadır.</p><p>Kullanılacak araç, uygulama geliştirirken kullandığınız programlama dili ve teknolojilere göre seçilmelidir. Bazı Statik Kod Analiz Araçları : SonarQube , CodeScene , Checkstyle , FindBugs , PMD, …</p><p><strong>Nerede Kullanmalıyım?</strong></p><p>Statik Kod Analizi’ni CI hattında uygulama build edildikten sonra, uygulama artifactleri çıkmadan önce çalıştırılmalıdır.</p><ol><li>Uygulama başarılı bir şekilde build olmalı.</li><li>Build sonrası uygulama kodları belirlenen standartlar doğrultusunda analizden başarılı geçmeli. Başarılı geçmesi durumunda 3. adıma geçilmeli. Eğer standartları karşılamıyor ise CI hattının çalıştırılması durdurulmalıdır. (Build Breaker) . Gerekli düzenlemeler yapıldıktan sonra tekrar işlemler tekrar etmeli.</li><li>Deployment işlemleri (CD) için uygulama artifactleri çıkartılmalı ve CD hattı tetiklenmelidir.</li></ol><h4>Unit Test</h4><p>Unit Test, uygulama kodlarında bulunan en küçük birimlerin test edilmesidir. Birim (Unit) kelimesini ise yazılımlarda test edilebilecek en küçük yapı olarak tanımlayabiliriz.</p><p>Unit test geliştirmenin temel faydası hataları bulmaktan değil, yazılan kodun daha kaliteli yazılmasını sağlamasıdır. Test-Driven Development yazılım geliştirme tekniğini benimsenmiş bir geliştirmede yazılımda önce Unit testler geliştirilmektedir. Doğru bir şekilde geliştirilen unit testler ile birlikte yazılımın bileşenleri arasındaki karmaşıklığın önüne geçilerek henüz geliştirme aşamasında daha kaliteli bir yazılım ortaya koymaya yardımcı olacaktır.</p><p>Kullanılacak araç, uygulama geliştirirken kullandığınız programlama dili ve teknolojilere göre seçilmelidir. Bazı Unit Test Araçları : XUnit, JUnit, Emma, TestNG, …</p><h4>Nerede Kullanmalıyım?</h4><p>CI hattında uygulama build edildikten sonra, uygulama artifactleri çıkmadan önce çalıştırılmalıdır.</p><ol><li>Uygulama başarılı bir şekilde build olmalı.</li><li>Build sonrası uygulama yazılmış unit testler çalıştırılmalıdır. Eğer tüm unit testler başarılı bir şekilde çalışıyor ise aşağıdaki adıma geçilir.</li><li>Deployment işlemleri (CD) için uygulama artifactleri çıkartılmalı ve CD hattı tetiklenmelidir.</li></ol><p>Azure Pipeline’da kurgulanmış örnek bir CI pipeline görüntüsü:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*ozgOqxKyVvV7ZQ4rPN1HZQ.png" /></figure><p>Unit testlerimizi başarılı bir şekilde çalıştırdık, kodlarımızı static kod analizinden geçirdik ve pipeline sonucunda uygulamaya ait artifactleri başarılı bir şekilde çıkarttık. Sırada yeni geliştirilmiş bir uygulamanın deploy edildikten sonra temel özelliklerinin çalışıp çalışmadığını test etmemiz gerekiyor.</p><h4>API/Performance Testing</h4><p>API testi, uygulama programlama arayüzlerini doğrudan ve işlevsellik, güvenilirlik, performans ve güvenlik beklentilerini karşılayıp karşılamadıklarını belirlemek için entegrasyon testinin bir parçası olarak test etmeyi içeren bir tür yazılım testidir.</p><p>Performans testi genel olarak bir sistemin belirli bir iş yükü altında yanıt verme ve kararlılık açısından nasıl performans gösterdiğini belirlemek için gerçekleştirilen bir test uygulamasıdır.</p><p>Eğer tüm deployment süreçleriniz otomatik bir şekilde pipeline aracılığı ile gerçekleşiyor ise uygulamaya ait servislerin yeni geliştirilen bir özellik sonrası servislerin başarılı bir şekilde çalışıp çalışmadığını ya da belli bir yük altında nasıl tepki verdiğini production deployment öncesinde test etmemiz gerekmektedir.</p><p>Bazı API Test Araçları : Karate DSL, Postman, Rest Assured, SoapUI, JMeter, …</p><p>Bazı Performance Test Araçları : Gatling, JMeter, WebLOAD, LoadNinja, …</p><h4>Nerede Kullanmalıyım?</h4><p>CD hattında uygulama test ortamına deploy edildikten sonra, test ortamında çalıştırılmalıdır.</p><ol><li>Uygulama test ortamına deploy edilir.</li><li>Test ortamında api/perfomance testleri çalıştırılır. Var ise bu aşamadan sonra fonksiyonel testlerde çalıştırılmalıdır.</li><li>Testlerden başarılı bir şekilde geçildiği taktirde production deployment işlemi gerçekleştirilir.</li></ol><p>Azure Pipeline’da kurgulanmış örnek bir CD pipeline görüntüsü:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*1cbj4QW-RxXAeM4p7s0KCw.png" /></figure><p>Sürekli olarak test otomasyonundan bahsederken aslında şu gerçeği unutmamak lazım; Test otomasyonunu yapmak için yapmaktansa bize fayda sağlayacağını düşüğümüz zamanlarda manuel testlerin yanına konumlandırdığımızda daha kaliteli çıktılar elde ediyor olacağız. Test vizyonunu oluşturmadan, manuel test süreçlerini oturtmadan, test senaryosu tasarımını öğrenmeden ve bunları uçtan uca işletmeden otomasyonda başarılı olmak çok da mümkün değil.</p><p>Umarım faydalı biz yazı olmuştur. Bir sonraki yazımda görüşmek dileğiyle. Sağlıkla kalın :)</p><p><a href="https://tr.wikipedia.org/wiki/%C4%B0nternet">https://tr.wikipedia.org/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4f6ef376e92" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kocsistem/ci-cd-s%C3%BCre%C3%A7lerinde-test-otomasyonu-a4f6ef376e92">CI/CD süreçlerinde Test Otomasyonu</a> was originally published in <a href="https://medium.com/kocsistem">KoçSistem</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>