<?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 Firat Yasar on Medium]]></title>
        <description><![CDATA[Stories by Firat Yasar on Medium]]></description>
        <link>https://medium.com/@firat.yasar?source=rss-e24afda8d807------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*Qm2S1v8oeC8rMhrzP6u24w.jpeg</url>
            <title>Stories by Firat Yasar on Medium</title>
            <link>https://medium.com/@firat.yasar?source=rss-e24afda8d807------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 07:38:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@firat.yasar/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[HashiCorp Vault — Kimlik Doğrulama Opsiyonları — TR]]></title>
            <link>https://medium.com/@firat.yasar/hashicorp-vault-kimlik-do%C4%9Frulama-opsiyonlar%C4%B1-tr-b80f04f92ba4?source=rss-e24afda8d807------2</link>
            <guid isPermaLink="false">https://medium.com/p/b80f04f92ba4</guid>
            <category><![CDATA[hashicorp-vault]]></category>
            <category><![CDATA[hashicorp]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[vault]]></category>
            <dc:creator><![CDATA[Firat Yasar]]></dc:creator>
            <pubDate>Thu, 31 Mar 2022 18:54:12 GMT</pubDate>
            <atom:updated>2022-03-31T18:54:12.745Z</atom:updated>
            <content:encoded><![CDATA[<h3>HashiCorp Vault — Kimlik Doğrulama Opsiyonları — TR</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rt9ZPqt7w-V-ifvBvVz2-A.png" /></figure><p>Selamlar, HashiCorp Vault ürünü ile ilgili ikinci yazıya kimlik doğrulama metodları ile devam edeceğim. İlk story’e aşağıdaki linki kullanarak ulaşabilirsiniz.</p><p><a href="https://medium.com/adessoturkey/getting-started-with-hashicorp-vault-658a3e523949">Getting started with Hashicorp Vault</a></p><p>Hashicorp Vault aşağıda gördüğünüz gibi çeşitli kimlik doğrulama metodlarına sahiptir. Bu kimlik doğrulama metodları binary ile birlikte bundle olarak gelir. Aynı anda bir den çok authentication metoduna da sahip olunabilir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IW6Ig9rpbav_zzTrSCoswA.png" /></figure><p>Authentication mekanizmaları internal ve external olarak gruplanabilirler. LDAP,Github,AWS IAM gibi kimlik doğrulama yöntemleri external mekanizmalar olarak tanımlanırken userpass ve approle ise internal olarak tanımlanabilir. Token metodu ise kurulum ile birlikte default olarak gelir.</p><p>Vault mimarisinde tüm kimlik doğrulama metodları path olarak mount edilirler. Temelde tüm kimlik doğrulama yöntemlerinin amacı Vault üzerinden token elde etmektir. Bu işlemin ardından token ile izin verilen secret’lara erişim sağlanır.</p><p><strong>Kimlik doğrulama metodu kategorileri</strong></p><p>Vault üzerinde kimlik doğrulama yöntemlerini belirli kategorilerde değerlendirebiliriz. Bunlara kısaca değinecek olursak,</p><blockquote><strong>Vault native kimlik doğrulama yöntemleri :</strong> UserPass,AppRole ve Token bu kategoride değerlendirilebilir.</blockquote><blockquote><strong>Cloud Provider’lar:</strong> Azure,AWS ve GCP gibi cloud provider’ları bu kategoride değerlendirebiliriz. Bu cloud provider’lara ait kimlik doğrulama pluginleri builtin olarak gelir. Kimlik doğrulama sürecinde bu providerlar hedef olarak kullanılırlar.</blockquote><blockquote><strong>Geleneksel kimlik doğrulama yöntemleri:</strong> Kerberos, LDAP veya RADIUS.</blockquote><blockquote><strong>Cloud native kimlik doğrulama yöntemleri: </strong>Kubernetes, Cloud foundry,JWT,GitHub vb.</blockquote><p>HashiCorp vault yukarıda bahsettim gibi çeşitli kimlik doğrulama yöntemlerini destekler. Ancak burada önemli olan soru hangisini kullanmanız gerektiği belirlemektir. Uygun kimlik doğrulama yönteminin seçilmesinde en önemli şey ihtiyacın belirlenmesidir.</p><p><strong>Uygun kimlik doğrulama metodu hangisi?</strong></p><p>Vault mimarisinde kimlik doğrulama yöntemleri hem CLI üzerinden hem de Vault UI kullanılarak yapılandırılabilir. Burada önemli olan uygun kimlik doğrulama metodunun belirlenmesidir. Burada verilecek karar ihtiyaca bağlı olarak değişim gösterecektir.</p><p>İhtiyacı belirlemek için basit sorular sormak yeterli olacaktır.</p><ul><li>Vault’a erişimde internal kullanıcılar mı kullanılacak yoksa external kullanıcılar mı?</li><li>Kullanıcılar şu anda yaygın olarak kimlik doğrulama süreçlerinde ne kullanıyorlar? Github? Active Directory?</li><li>Bağlanan kullanıcılar insan mı olacak yoksa uygulama yada makine mi?</li><li>Vault’a bağlanmak isteyen kullanıcılar erişimlerini nasıl sağlayacaklar?</li></ul><p>Bu şekilde basit sorular sorularak ihtiyaç kolaylılıkla belirlenir. Vault bizlere geniş yelpazede kimlik doğrulama yöntemleri sunduğu için kolaylıkla uygun olan kimlik doğrulama metodu seçilir.</p><p><strong>CLI ile kimlik metodu yönetimi</strong></p><p>Vault mimarisinde tüm kimlik doğrulama yöntemleri <strong>/sys/auth</strong> path’i altında etkinleştirilir. Eğer yeni bir kimlik doğrulama yöntemi eklemek isterseniz bu path’e erişim yetkiniz olması gerekir.</p><p>Tüm etkinleştirilen kimlik doğrulama yöntemleri bir path ismine sahiptir. Default olarak path ismi etkinleştirilen kimlik doğrulama metodu ismi ile aynıdır.</p><p>Bir path üzerinde etkinleştirilen kimlik doğrulama metodları başka bir path’e taşınamazlar. Ancak metodlar deaktif edilip tekrardan etkinleştirilebilirler.</p><p>Bir kimlik doğrulama metodunu deaktif ettiğinizde üzerindeki tüm bilgiler silinir.</p><p>Kimlik doğrulama metodları üzerinde yapabileceğiniz iki ana seçenek vardır. Bunlar;</p><ul><li><strong>Tune:</strong> Tüm kimlik doğrulama metodları için ortak olan konfigürasyon seçenekleridir. örn: kimlik doğrulama metodu açıklaması.</li><li><strong>Configuration:</strong> Bu seçenek kimlik doğrulama metodları için özel konfigürasyonları içerir.</li></ul><p><strong>Configuring Auth Method</strong></p><p>Vault mimarisinde tüm kimlik doğrulama yöntemlerinin<strong> /sys/auth</strong> path’i üzerinde etkinleştirildiğinden bahsetmiştik. Eğer yeni bir kimlik doğrulama yöntemi eklemek isterseniz bu path’e erişim yetkiniz olması gerekir.</p><p>Vault mimarisinde kimlik doğrulama yöntemleri hem CLI üzerinden hem de Vault UI kullanılarak konfigüre edilebilir.</p><p>Öncelikle CLI kullanarak kimlik doğrulama yöntemlerinin nasıl etkinleştirileceğine bir göz atalım.</p><p>Bu aşamada kolaylık olması açısından internal kimlik doğrulama yöntemlerinden birisi olan userpass’i kullanacağım. Buradaki amacımız bir kimlik doğrulama metodunun nasıl etkinleştirildiği update edildiği ve silindiğini göstermek. İlerideki story’lerde kimlik doğrulama yöntemlerini ayrıntılı ele almayı planlıyorum.</p><p>Vault üzerinde login işlemlerini gerçekleştirdikten sonra etkin olan kimlik doğrulama metodlarını listelemek için aşağıdaki komutu çalıştırabiliriz.</p><blockquote><strong>vault auth list</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mXLEv1JgsPzNqU9Zxsq3JQ.png" /></figure><p>Listeleme sonrasında vault üzerinde etkinleştirilmiş olan kimlik doğrulama metodlarını görebilirsiniz. Eğer yeni bir kimlik doğrulama metodunu etkinleştirmek isterseniz aşağıdaki komutu yazmanız yeterli olacaktır. path parametresi ile custom bir path belirleyebilirsiniz. Eğer bu parametreyi boş geçerseniz kimlik doğrulama metodunun ismi path olarak atanacaktır.</p><blockquote><strong>vault auth enable [options] TYPE</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SXe0QuLEeNO4WrW5n_2MwQ.png" /></figure><p>Kimlik doğrulama metodu etkinleştirildikten sonra yukarıda bahsedildiği gibi iki tip konfigürasyon ile metodu güncelleyebilirsiniz. (Tune &amp; Configuration)</p><p>Örnek olarak tune komutu ile tüm kimlik doğrulama metodlarında ortak olan açıklama alanını güncelleyelim. Bunun için komutu aşağıdaki gibi kullanabiliriz.</p><p>Örnekte frt-userpass isimli userpass kimlik doğrulama metodunun açıklama alanı güncellenecektir.</p><blockquote><strong>vault auth tune [options] PATH</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gkEtPDksqYT3a35dZcxwjg.png" /></figure><p>Kimlik doğrulama metodu etkinleştirildikten sonra test amaçlı bir userpass oluşturalım. Bu işlem için write komutunu kullanarak ilgili kimlik doğrulama metodu üzerinde kullanıcı adı ve parola oluşturabiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ni_R_c4gE29f02Lt8IEKVA.png" /></figure><p>Son olarak kimlik doğrulama metodunu deaktif etmek için yapmanız gereken aşağıdaki şekilde disable komutunu çalıştırmaktır. Bu işlem sonucunda içerisinde oluşturduğumuz veri de silinecektir.</p><blockquote><strong>vault auth disable [options] PATH</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*omSl_Wcbj0jBEuq6ULBJNg.png" /></figure><p>Yapılan bu işlemleri vault UI üzerinden de kolaylıkla yapmanız mümkün.</p><p>Sonuç</p><p>Özet olarak HashiCorp Vault üzerinde kullanabileceğiniz bir çok kimlik doğrulama metodu mevcuttur ve bu kimlik doğrulama metodları kurulum ile birlikte gelirler. Doğru sorular sorarak ihtiyacınızı belirleyip uygun olan kimlik doğrulama metodu yada metodlarını etkinleştirebilirsiniz. Kimlik doğrulama metodları CLI yada UI üzerinden etkinleştirilebilir. Deactivate edilen kimlik doğrulama metodları üzerindeki veriler silinecektir.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b80f04f92ba4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HashiCorp Vault — Vault Policies]]></title>
            <link>https://medium.com/adessoturkey/hashicorp-vault-vault-policies-9dbf8505a917?source=rss-e24afda8d807------2</link>
            <guid isPermaLink="false">https://medium.com/p/9dbf8505a917</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[hc-vault-policy-syntax]]></category>
            <category><![CDATA[vault-policies]]></category>
            <category><![CDATA[hashicorp-vault-policies]]></category>
            <category><![CDATA[hashicorp-vault]]></category>
            <dc:creator><![CDATA[Firat Yasar]]></dc:creator>
            <pubDate>Tue, 29 Mar 2022 21:02:00 GMT</pubDate>
            <atom:updated>2022-07-05T07:24:20.064Z</atom:updated>
            <content:encoded><![CDATA[<h3>HashiCorp Vault — Vault Policies</h3><p>Hi everyone. this is the 3rd article about HashiCorp Vault. You can view the previous stories using the links below.</p><ul><li><a href="https://medium.com/adessoturkey/getting-started-with-hashicorp-vault-658a3e523949">Getting started with Hashicorp Vault</a></li><li><a href="https://medium.com/adessoturkey/hashicorp-vault-authentication-options-465b5b8eb560">HashiCorp Vault — Authentication Options</a></li></ul><p>Today we’re gonna talk about vault policies. We’re gonna learn what is it and how to use it. Let’s start.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fkd8Dem8eY5M24fxljuMVQ.png" /></figure><p>Policies are typically used to define permissions in the HashiCorp vault.</p><p>You can use multiple options for policy assignments. These are;</p><ul><li><strong>Token</strong>: You can assign a policy to a token when created.</li><li><strong>Identity</strong>: You can assign a policy to an entity via the identity secret engine.</li><li><strong>Auth methods:</strong> Policy can be applied via an auth method.</li></ul><p>You can assign multiple policies at the same time. The most specific policy rules always win.</p><p>There are no versioning options on policies. So if you update any policy it automatically overrides the existing configuration.</p><p>When you spin up a vault server, it will automatically create a Default Policy on the vault. You can edit it but you cannot delete it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aMl8laNfopujTURo4vuSzg.png" /><figcaption>Default Policy</figcaption></figure><p><em>There is also another special policy that comes up with the newly created vault server. It is called root policy. It is associated with to root token. This policy has full control right on the vault server. You can assign root policy to another token by the way. It cannot be changed and it can not be deleted.</em></p><h3><strong>Policy Syntax</strong></h3><p>In HashiCorp Vault architecture policy syntax is defined either HCL or JSON format. In policy structure, you have to consider two main components when you define policy.</p><p>These are,</p><ul><li><strong>Path</strong>: where do you want to assign permission</li><li><strong>Capabilities</strong>: What permissions do you want to give at this path</li></ul><p>When you define a policy basically you need to define a path. You can define paths with various options.</p><h4>Assign policy to specific path</h4><blockquote>path “secret/database/config”</blockquote><h4>Assign policy to multiple path</h4><ul><li>Path1 : secrets/firat/app1</li><li>Path2: secrets/firat/app2/keys</li><li>Path3: secrets/firat/app3/configs</li></ul><blockquote>path “secrets/firat/app*”</blockquote><h4><strong>Using Path segment match</strong></h4><p>If we want to write a path definition like the below we can use “+” expression to match these two paths.</p><ul><li>Path1: secrets/firat/web1/keys</li><li>Path2: secret/firat/web2/keys</li></ul><blockquote>path “secrets/firat/+/keys”</blockquote><p>By using the two placeholders I mentioned above, it is possible to dynamically match the policies with the paths.</p><h4>Parameters</h4><p>Parameters can also be used in the path while defining the policy. This is very useful for identity and secret management engines.</p><p>For example, the following parameter can be used to resolve the entity name of the identity and use it in the path.</p><blockquote>path “identity/entity/name/{{identity.entity.name}}/*”</blockquote><p>You can see that kind of assignment on default policy.</p><p>For example, the rights of tokens to see their own entities are defined on the default policy as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sK5h11pU2FiNSEvut5U6GQ.png" /></figure><p><strong>Capabilities</strong></p><p>Capabilities mostly consist of crud operations like below.</p><ul><li>Create — create a new key</li><li>Read — read data from a key</li><li>Update — update value for a key</li><li>Delete — removal of a key</li></ul><p>There are also a few additional capabilities that are available. These are list,sudo, and deny capabilities.</p><p><strong>List —</strong> It let us enumerate keys. It just lists the keys. It doesn’t show us the key value.</p><p><strong>Sudo — </strong>Basically it allows us to define special permissions. A certain path can be root protected. Even you have write permissions you can not update values on that path. If you have root capabilities assigned you can update the value on that path.</p><p><strong>Deny — </strong>This capability allows us to disable access of path. It overrides all other actions. If I have deny access and write access on a particular path, deny would override the write capabilities. It also denies the full path.</p><p>Let’s take a look at some capabilities example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/1*uw3f2HXPF6e8_dQseSltBQ.png" /><figcaption>It assigns read access to a key.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*m11nubN-2Af5Y7rr8eUrKA.png" /><figcaption>It assigns both read and write access to a path</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*NZamcp8jq7XfSxMqWH5DiQ.png" /><figcaption>It assigns full access permission to myapp path.</figcaption></figure><p>If you want to assign full access permission to a specific path but you want to prevent access particular path under that path, you can write policy like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*PylbNXrcl4Ao3PKNdpTBYA.png" /></figure><p>Using the following command you can easily manage vault policies via CLI.</p><p>List existing policies</p><blockquote>vault policy list</blockquote><p>Read specific policy content</p><blockquote>vault policy read k8s-policy</blockquote><p>Create new policy</p><blockquote>vault policy write k8s-policy k8s-policy.hcl</blockquote><p>Delete existing policy</p><blockquote>vault policy delete k8s-policy</blockquote><p>When you create a policy you need to assign it to a token. You have three options to assign a policy to a token.</p><p>You can assign a policy to a token directly when you create it.</p><blockquote>vault token create -policy=”k8s-policy”</blockquote><p>You can assign a policy to an entity inside an identity engine.</p><blockquote>vault write identity/entity/user/firat policies=”k8s-policy”</blockquote><p>You can assign a policy to an authentication method.</p><blockquote>vault write auth/userpass/users/firat token_policies=”k8s-policy”</blockquote><h4>Conclusion</h4><p>The policies can be assigned to tokens directly. Or you can assign them to both identity engine and authentication method. There is a special policy called root policy. It can do anything. You can not modify or delete it. When you create new token, the default policy directly assigned to it. The default policy can be modified but it can not be deleted.</p><p>The policy contain two parts. Path define action location and the capabilities define the action.</p><p>Source:</p><ul><li><a href="https://app.pluralsight.com/library/courses/hashicorp-certified-vault-associate-getting-started/table-of-contents">Hashicorp Certified Vault Associate: Getting Started</a></li><li><a href="https://learn.hashicorp.com/tutorials/vault/policies">Vault Policies | Vault - HashiCorp Learn</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9dbf8505a917" width="1" height="1" alt=""><hr><p><a href="https://medium.com/adessoturkey/hashicorp-vault-vault-policies-9dbf8505a917">HashiCorp Vault — Vault Policies</a> was originally published in <a href="https://medium.com/adessoturkey">adessoTurkey</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[API Gateway Design Pattern]]></title>
            <link>https://medium.com/adessoturkey/api-gateway-design-pattern-facba5d0ae3b?source=rss-e24afda8d807------2</link>
            <guid isPermaLink="false">https://medium.com/p/facba5d0ae3b</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[api-gateway-design]]></category>
            <category><![CDATA[api-gateway-pattern]]></category>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[api-management]]></category>
            <dc:creator><![CDATA[Firat Yasar]]></dc:creator>
            <pubDate>Mon, 21 Mar 2022 23:03:28 GMT</pubDate>
            <atom:updated>2022-04-05T11:22:51.613Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wP6KPy-j-mvykMgq7PwZeQ.png" /></figure><p>When you want to develop a cloud-native application, your applications must be microservice-based and can be exposed with APIs. When the number of your microservices increases in the future, it will be difficult to manage APIs separately for each microservice. Integrating advanced options like authentication, security, authorization will result in both development effort and management overhead.<br>For this reason, it is preferred to manage APIs from a central point in large applications that have a large number of microservices.<br>Thanks to API Gateway technology, API management can be done easily from a central point.</p><p>In this article, I will try to explain the API gateway technology in detail. Let’s start with basic overview..</p><p>API gateway is a single entry point for backend APIs and microservices. These elements can be internal or external.</p><p>With this single entry point, you can apply security and authorization best practises, and also you can have scalability and high availability. API Gateway sits between a client and backend services. It works like a reverse proxy to accepts all API calls. It’s suitable for integrating legacy applications. You can also use it for building serverless applications.</p><p>This is a basic description of API Gateway. Before digging into it we need to understand the communication of microservice-based applications without API Gateway.</p><p>So let’s start with the client to microservice communication pattern first.</p><p><strong>Client-to-microservice direct communication</strong></p><p>This communication approach can fit small microservice-based applications with a few endpoints to interact with. If the number of microservices increases, this communication will start to be a problem.</p><p>If you prefer this approach,</p><ul><li>Each microservice will have a public endpoint.</li><li>Different TCP ports will be required by microservices.</li><li>There will be complex communication if the number of endpoint increase.</li></ul><p>if you have a complex microservice-based application and if the client apps are mobile apps or single-page web applications you can have a few problems with this approach.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BOdlV6RkAqz7RENP_wVt1A.png" /></figure><p>In client-to-microservice communication, there can be load-balancers between microservices and clients to distribute traffic to the microservices. These load balancers can be L7 or L3.</p><p>To reduce CPU usage of SSL termination and routing staff you can use an L7 load balancer.</p><p>When you decide to use this communication pattern with your applications you should take the questions below into consideration for the future;</p><p><strong>How do differentiate APIs for a different types of clients?</strong></p><p>The endpoints provided by microservices couldn’t be fit for a different types of clients. The requirements of mobile apps can be different from web apps. So the responses need to be optimized for client types. In that kind of situation, you need to position an API gateway between clients and microservices.</p><p><strong>How to handle authorization, security and data transformation for all microservices?</strong></p><p>It is hard to handle these requirements on each microservices. So it would be better to keep all microservices in a private docker or Kubernetes environment. All these requirements should be handled on a central point like API Gateway.</p><p><strong>How to manage request count when the number of microservices increases?</strong></p><p>The server-side should return an aggregated response to the client-side in such a case. it decreases the latency. So you have to position an API gateway in front of your microservices.</p><p><strong>How do your client applications interact with services which used non-internet-friendly ports? (Like AMQP)</strong></p><p>All requests that come from the client-side should use HTTP or HTTPS to interact with services and transform to accepted protocols. API gateway is a good option to handle this transformation process.</p><p>If you have any concerns about the questions above for future requirements you should consider using API Gateway in your infrastructure. Because probably you will have the problems like below;</p><ul><li>Client apps coupled with the microservices, maintenances will be hard.</li><li>There will be too many round trips between client &amp; server</li><li>All microservices will be public. There will be a lot of attack surfaces.</li><li>All Authorization &amp; SSL requirements should be handled on the microservices side. So there will be lots of development effort</li></ul><p><strong>API Gateway pattern</strong></p><p>If you want to design an application that includes many different client types and consists of many microservices, it is necessary to position the API gateway within the architecture. With the API gateway pattern, a single entry point for a complex application is integrated into the front of the application.</p><p>The API gateway is located between the client-side and the microservices and works as a kind of reverse proxy. It routes incoming requests to the microservices on its back.</p><p>In addition, there are advanced configuration options (known as cross-cutting features in some sources) such as authentication, SSL termination, and cache.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wr4pleuJ5XHjyfv28F_PiQ.png" /></figure><p>It is recommended to locate the API Gateway more than once, depending on the size of the application and the variety of client types. Positioning a single API Gateway in front of all microservices will cause a coupling problem. It’s not a good idea to have a single aggregator in front of the microservices. This is against the nature of the microservice architecture.</p><p><strong>What are these advanced features?</strong></p><p><strong><em>Offloading:</em></strong></p><p>Thanks to the advanced features offered by API gateway, you can transfer these functions to the API gateway from the microservice side. So such requirements are handled at a single point. In addition, the development effort required to integrate these features for each microservices is eliminated.</p><p><strong>Offload Features:</strong></p><ul><li>Authentication &amp; Authorization</li><li>Caching</li><li>Rate limiting &amp; throttling</li><li>Ip whitelisting</li><li>Retry rules</li><li>Data transformations</li></ul><p><strong><em>Reverse Proxy:</em></strong></p><p>API gateway receives HTTP requests from clients at layer 7 and forwards them to microservices. Clients access microservices via a single URL. In this way, it is ensured that the client-side and microservices are decoupled. When it is necessary to continue communication with monolithic APIs during application modernization, the client-side integrates with these legacy APIs thanks to the API Gateway. After the development of new microservices, monolithic structures are disabled with a simple traffic routing. In such transitions, since the API Gateway is positioned between the client and the services, the client-side is not affected in any way by these transactions.</p><p><strong><em>Request Aggregation:</em></strong></p><p>With this feature, multiple client requests that will call many microservices are collected in a single client request. This approach is usually used when the client-side will pull data from multiple microservices. For example, with this approach, a single request from the client is directed to more than one microservice, and the incoming responses are collected and directed to the client application. It is important to use this feature in mobile applications and single-page web applications that use javascript.</p><p><strong>Are there some cons to using API Gateway?</strong></p><ul><li>There will be a learning curve for both the infra and development sides.</li><li>API Gateway will be the single point between frontend and backend services. So it can be affected via single-point failure. (So you need to consider high availability options)</li><li>The application contains additional layers so it will bring difficulty for developers.</li><li>Performance should be a concern. Because API gateway needs to handle every request. If the load size is increased it affects the speed and reliability of the application. So you need to consider scaling of the API Gateway layer.</li><li>There will be an additional network layer which will be the cause of increased response time.</li></ul><p><strong>Conclusion</strong></p><p>In cloud-native architectures, APIs are the way of communication. If this layer’s complexity increased (related to the number of microservices endpoints) it wouldn’t be easy to manage this communication. The API Gateway is the way of simple management of APIs.</p><p>Resources:</p><ul><li><a href="https://docs.microsoft.com/en-us/azure/architecture/microservices/design/gateway">API gateways - Azure Architecture Center</a></li><li><a href="https://docs.microsoft.com/en-us/dotnet/architecture/microservices/architect-microservice-container-applications/direct-client-to-microservice-communication-versus-the-api-gateway-pattern">The API gateway pattern versus the direct client-to-microservice communication</a></li><li><a href="https://microservices.io/patterns/apigateway.html">Microservices Pattern: Pattern: API Gateway / Backends for Frontends</a></li><li><a href="https://www.digitalocean.com/community/tech_talks/building-an-api-gateway-to-get-out-of-the-monoliths">Building an API Gateway to Get Out of the Monoliths | DigitalOcean</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=facba5d0ae3b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/adessoturkey/api-gateway-design-pattern-facba5d0ae3b">API Gateway Design Pattern</a> was originally published in <a href="https://medium.com/adessoturkey">adessoTurkey</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Backup & Restore Kubernetes resources with VELERO]]></title>
            <link>https://medium.com/adessoturkey/backup-restore-kubernetes-resources-with-velero-b7fee14e7664?source=rss-e24afda8d807------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7fee14e7664</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[kubernetes-backup]]></category>
            <category><![CDATA[backup]]></category>
            <category><![CDATA[velero]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Firat Yasar]]></dc:creator>
            <pubDate>Sun, 13 Mar 2022 23:05:34 GMT</pubDate>
            <atom:updated>2022-04-14T08:52:59.137Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HhmyG4AY-vWsL2RMc21KtA.png" /></figure><p>Velero is an open-source tool to safely back up and restore, perform disaster recovery, and migrate Kubernetes cluster resources and persistent volumes. (Definition comes from Velero official site)</p><p>It’s easy to use and integration is so simple. You can manage backup&amp;restore tasks with it easily and also it would be fit your BCDR needs.</p><p>Key objectives for Velero;</p><ul><li>Velero extends Kubernetes APIs to manage backup &amp; restore operations. Each operation is defined ad CRD in Kubernetes and stored in ETCD.</li><li>Velero also has controllers to perform backups, restores, and all other operations defined in CRD.</li><li>Velero can backup all objects in the cluster or you can filter objects by namespace, label, or type.</li><li>It would be useful to use Velero for disaster recovery scenarios. And also it’s ideal to use it for snapshotting your workload state. (for upgrade operations etc.)</li></ul><p>After a short overview of Velero’s next move on to backup operations.</p><p><strong>Backup Operations</strong></p><ul><li>It keeps Kubernetes objects backup in cloud-based storage as a tarball.</li><li>to create disk snapshots of persistent volumes it communicates with cloud provider API.</li></ul><p>You can also configure backup hooks before or after backup operations. It would be great to have some jobs to prepare the database before or after backup operations. For example, you want to flush the database in memory buffers before backup operations. It would be useful for that kind of scenario.</p><p><strong>Scheduled backup option?</strong></p><p>Backup operations can be triggered with manual operations. But you may want to backup your data in scheduled recurring intervals. Velero allows you to schedule backup at any time. Backup intervals can be specified by Cron expression.</p><p><strong>Restore Operations</strong></p><p>With restore operations, you can restore objects and persistent volumes from backups. It also allows you to restore a specific subset of objects and persistent volumes.</p><p>By default Velero allows you to restore objects in different namespaces.</p><p>You can integrate restore hooks before or after restore operations. So maybe you want to restart the application containers that used the database after the restore operation.</p><p>After explaining some basic operations of Velero let’s dig into the backup workflow to understand the process of backup.</p><p><strong>Backup workflow</strong></p><p>Creating a backup file with velero, you can use this simple command to start the operation.</p><blockquote>velero backup create test-backup</blockquote><p>After this basic command the backup process continues with these steps:</p><ol><li>To start the backup process Velero client makes a call to the K8S API to create a backup object.</li><li>The backup controller is aware of that and starts the validation process.</li><li>After validation backup controller triggers the backup process. For object backup, it communicates K8S API server to collect data.</li><li>It also communicates with the cloud storage service to upload the backup file.</li></ol><p>You can see the detailed backup workflow in the picture below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xySCI7uYv2CjNK5Dr3CoaA.png" /></figure><p>By default, “<strong>velero backup create</strong>” creates disk snapshots of persistent volumes.</p><p>You can adjust the snapshots by specifying additional flags.</p><p>to see available flags;</p><blockquote>velero backup create — help</blockquote><p>Snapshots can be disabled with the option below.</p><blockquote>— snapshot-volumes=false</blockquote><p><strong>TTL for backup resources</strong></p><p>You can specify TTL for your backup resources. You have to use <strong>— ttl &lt;DURATION&gt;</strong> flag with the backup command. If backup resource expired it removes,</p><ul><li>The backup resource and backup file from cloud storage.</li><li>Persistent volumes and snapshots</li><li>All associated restores</li></ul><p>The default TTL duration for the backup files is 30 days. You can update it with a custom TTL configuration. the value assigned as TTL can be specified in hours, minutes, and seconds. ( — ttl 24h0m0s)</p><p><strong>What is the Object Storage Sync?</strong></p><p>Velero accepts cloud storage as the <strong>source of truth.</strong> So the situation of Kubernetes should be the same with backup resources. It continuously checks the storage to realize that the correct backup file exists over there. If it doesn’t find the correct backup resource in the Kubernetes API, it syncs the data from storage to Kubernetes. It allows using the restore function in a cluster migration scenario. If the backup object exists on Kubernetes but not in cloud storage, it will be deleted from Kubernetes by Velero.</p><p><strong>Conclusion</strong></p><p>Velero is an open-source backup tool that allows to backup Kubernetes resources to the cloud storage. It also supports disaster recovery scenarios for Kubernetes resources.</p><p>It’s easy to use and deployment is not complex. It also provides advanced options like backup TTL and synchronization. If you have a plan to integrate backup&amp;restore and disaster recovery capabilities for your Kubernetes cluster you should give it a chance to try it.</p><p>Source:</p><p><a href="https://velero.io/docs/v1.8/">Velero Docs - Overview</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7fee14e7664" width="1" height="1" alt=""><hr><p><a href="https://medium.com/adessoturkey/backup-restore-kubernetes-resources-with-velero-b7fee14e7664">Backup &amp; Restore Kubernetes resources with VELERO</a> was originally published in <a href="https://medium.com/adessoturkey">adessoTurkey</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HashiCorp Vault — Authentication Options]]></title>
            <link>https://medium.com/adessoturkey/hashicorp-vault-authentication-options-465b5b8eb560?source=rss-e24afda8d807------2</link>
            <guid isPermaLink="false">https://medium.com/p/465b5b8eb560</guid>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[hashicorp-vault]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[authentication-options]]></category>
            <category><![CDATA[management-secrets]]></category>
            <dc:creator><![CDATA[Firat Yasar]]></dc:creator>
            <pubDate>Mon, 10 Jan 2022 11:50:09 GMT</pubDate>
            <atom:updated>2022-01-15T21:56:06.047Z</atom:updated>
            <content:encoded><![CDATA[<h3>HashiCorp Vault — Authentication Options</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rt9ZPqt7w-V-ifvBvVz2-A.png" /></figure><p>The second story will be about authentication methods of HashiCorp Vault. You can view the first story using the link below.</p><p><a href="https://medium.com/adessoturkey/getting-started-with-hashicorp-vault-658a3e523949">Getting started with Hashicorp Vault</a></p><p>As you can see on the picture, HashiCorp Vault supports multiple authentication methods as out of box. This authentication methods come up with binary as bundle and you can have multiple authentication methods at the same time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IW6Ig9rpbav_zzTrSCoswA.png" /></figure><p>Authentication methods can be grouped as both internal and external. For instance authentication methods such as LDAP, Github, AWS IAM can be defined as external methods, while userpass and approle can be defined as internal methods.</p><p>All authentication methods are mounted as path in Vault architecture. Basically the main purpose of them is obtaining token from Vault. After this process client can access to allowed secrets via that token.</p><p><strong>Category of authentication methods</strong></p><p>We can evaluate authentication methods on Vault in certain categories,</p><p><strong>Vault native auth metods :</strong> User Pass,AppRole and Token.</p><p><strong>Cloud providers: </strong>Azure,AWS and GCP. This plugins come as builtin with binary. These providers use as target during authentication process.</p><p><strong>Traditional authentication methods:</strong> Kerberos,LDAP or Radius</p><p><strong>Cloud native authentication methods:</strong> Kubernetes,JWT,Github etc.</p><p>As you can see HashiCorp Vault supports various authentication methods. But the important part is decision of right authentication methods that fit your needs. So specifying your needs at the beginning will show you the right authentication methods.</p><p><strong>How can I specify right authentication methods?</strong></p><p>You can configure authentication methods via both CLI and Vault UI. The important thing is to determine the appropriate one.</p><p>You can specify your needs with asking some basic questions. Such as;</p><ul><li>Who will access to vault? Internal or external user?</li><li>What is the common authentication methods that is currently used by users.? (Github or Active Directory?)</li><li>What is the client type? (Human,application or machine?)</li><li>Which access method will be used by clients?</li></ul><p>With this basic questions, requirements can be specified easily. Because Vault provides us a wide range of authentication methods. For this reason, you can definitely find the right authentication method that suits you.</p><p><strong>Managing authentication method by CLI</strong></p><p>All authentication methods can be enabled under /sys/auth path. If you want to add a new one you should have required access permission to this path.</p><p>All enabled authentication methods have a name under under /sys/auth path. by default path name is the same with authentication method name but you can change it with your own.</p><p>The authentication methods that enabled on a path can’t migrate to another one but it can be deactivated. When you deactivate it all data will be removed. But don’t worry deactivated authentication methods can be activated again.</p><p>There are two main configuration options:</p><ul><li><strong>Tune:</strong> It contains common authentication methods configurations. (for example description)</li><li><strong>Configuration:</strong> It contains specific configurations for each authentication methods.</li></ul><p><strong>Configuring Authentication Methods:</strong></p><p>You can configure authentication methods both on CLI and Vault UI.</p><p>Let’s start with CLI first.</p><p>To keep example simple, I’m gonna use userpass authentication method. What I want to show is how can it be enabled, updated and deleted. I will also talk about others in future stories.</p><p>After Vault login process you can list enabled authentication methods using the command below.</p><blockquote><strong>vault auth list</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mXLEv1JgsPzNqU9Zxsq3JQ.png" /></figure><p>The command lists enabled authentication methods. If you want to enable another one you should use the command below. You can specify custom path with “-path” parameter. If you don’t use this parameter authentication methods name is assigned as path name.</p><blockquote><strong>vault auth enable [options] TYPE</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SXe0QuLEeNO4WrW5n_2MwQ.png" /></figure><p>After enable process you can update it with two type of configuration options.</p><p>First let’s use the tune option to configure common configs. So in the following example I’m gonna update description field of authentication method.</p><blockquote><strong>vault auth tune [options] PATH</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gkEtPDksqYT3a35dZcxwjg.png" /></figure><p>As you can see we’ve updated description field using the tune command.</p><p>Now let’s try to configure it using the “write” command. (For configuration option we can create a new user login credentials on userpass authentication method.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ni_R_c4gE29f02Lt8IEKVA.png" /></figure><p>Finally if you want to disable an authentication method via CLI you can use the command below. This process also will delete the data that has written on authentication method path.</p><blockquote><strong>vault auth disable [options] PATH</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*omSl_Wcbj0jBEuq6ULBJNg.png" /></figure><p>By the way it is possible to perform all of these operations via the vault UI.</p><p><strong>Conclusion</strong></p><p>There are multiple authentication methods as builtin feature on HashiCorp Vault. With asking right question you can easily specify and enable right one for your needs. Authentication methods can be configure either CLI or Vault UI. But when you disabled it, it deletes all information.</p><p>Resources:</p><ul><li><a href="https://www.vaultproject.io/docs">Documentation | Vault by HashiCorp</a></li><li><a href="https://www.pluralsight.com/courses/hashicorp-certified-vault-associate-getting-started">Hashicorp Certified Vault Associate: Getting Started</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=465b5b8eb560" width="1" height="1" alt=""><hr><p><a href="https://medium.com/adessoturkey/hashicorp-vault-authentication-options-465b5b8eb560">HashiCorp Vault — Authentication Options</a> was originally published in <a href="https://medium.com/adessoturkey">adessoTurkey</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting started with Hashicorp Vault]]></title>
            <link>https://medium.com/adessoturkey/getting-started-with-hashicorp-vault-658a3e523949?source=rss-e24afda8d807------2</link>
            <guid isPermaLink="false">https://medium.com/p/658a3e523949</guid>
            <category><![CDATA[hashicorp-vault]]></category>
            <category><![CDATA[hashicorp]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[devsecops]]></category>
            <dc:creator><![CDATA[Firat Yasar]]></dc:creator>
            <pubDate>Tue, 03 Aug 2021 12:35:26 GMT</pubDate>
            <atom:updated>2021-08-03T14:42:25.333Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*PXs6YyX4EFfTy6DZtFhn0w.png" /></figure><p>If you want to integrate the DevSecOps perspective in your environment, secrets management is one of the important security tasks. In this article series, I’m going to introduce you to the basics of using the Hashicorp Vault.</p><p>It’s a powerful tool for securing accessing secrets. And also the other big benefit is for governance that includes policies, audit logs, etc.</p><p>Let’s dig into it a little bit with a few simple questions.</p><p><strong>What really is Hashicorp Vault?</strong></p><p>Hashicorp vault describes in their official sites like,</p><blockquote>Vault secures, stores, and tightly controls access to tokens, passwords, certificates, API keys, and other secrets in modern computing.</blockquote><p>It’s a general definition of vault. So let&#39;s talk about vault features and some key points,</p><ul><li>It is a secret lifecycle manager. There are advanced options like versioning, encryption, etc.</li><li>That secrets can be static or dynamic.</li><li>It’s written in the go language.</li><li>You can use the same binary both for client and server.</li><li>You can use it in multiple operating systems (Windows, Linux,macOS, etc.)</li></ul><p>Now let&#39;s take a look at vault concept.</p><p>The key features of Hashicorp Vault.</p><ul><li><strong>Authentication </strong>— There are a lot of authentication options like Userpass, LDAP, or external providers.</li><li><strong>Policy </strong>— With the policy concept you can govern what you can do in vault system.</li><li><strong>Secrets </strong>— There is an advanced secrets engine that you can manage dynamic or static secrets.</li><li><strong>Audit </strong>— You can audit everything on vault system with the Audit concept.</li><li><strong>Data Encryption </strong>— It can encrypt and decrypt data without storing it.</li><li><strong>Leasing and Renewal </strong>— When a secret is created in vault, automatically a lease is associated with it and at the end of the lease that secret automatically is revoked or it can be renewed.</li></ul><p><strong>Who can access vault?</strong></p><p>Users, applications, or machines can access vault through an API that sits in front of vault using a token. All access methods interact with an API and all of that interactions involve a token that is granted by vault.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RQ2i1KTe20Hhv2SypDOVPw.png" /></figure><p><strong>Communicating with Vault</strong></p><p>For testing purposes, you can run vault in development mode. It can run as a service on a server or on your local desktop. There are a few steps to have vault up and running in dev mode;</p><ul><li>First, you need to download vault binary to the appropriate os.</li><li>Second, you need to start vault in development mode.</li><li>And last you need to access vault. (Through CLI, UI, and the API)</li></ul><p><strong>Dev Mode Installation</strong></p><p>Depending on your operating system you can install vault in a few ways. For Windows, you can use the chocolatey package manager.</p><blockquote>choco install vault</blockquote><p>For macOS Homebrew good option to install it.</p><blockquote>brew tap hashicorp/tap</blockquote><blockquote>brew install hashicorp/tap/vault</blockquote><p>For Linux, you can use a package manager related to your Linux distro.</p><p><strong>Development Mode Features</strong></p><p>You can configure Hashicorp Vault in your local machine in dev mode. After the installation vault will be running in memory and it will be fully functional.</p><p>The list of Developer mode key features,</p><ul><li>It runs on localhost without SSL</li><li>It uses in-memory storage for the storage backend. (In production persistent storage backend would be used)</li><li>When you shut down your server in development mode, everything is gone.</li><li>In development mode, it starts unsealed and initialized state.</li><li>Dev mode UI already enabled.</li><li>Key/value secret engine is also enabled.</li></ul><p><strong>Spin up Vault in Dev Mode</strong></p><p>You can start vault server in dev mode with the command below. It is so easy.</p><blockquote>vault server -dev</blockquote><p>After the start-up process, it prompts you to store vault server address in an environment variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dqz3Zx-ZAaKhAx1O5-Wjiw.png" /></figure><p>To store vault server address in environment variable you need to run the appropriate command.</p><p>For Linux and macOS</p><blockquote>export VAULT_ADDR=http://127.0.0.1:8200</blockquote><p>For Windows PowerShell</p><blockquote>$env:VAULT_ADDR=”ttp://127.0.0.1:8200&quot;</blockquote><p>Set root token to the environment variable</p><blockquote>root_token=ROOT_TOKEN_VALUE</blockquote><p>Note: Root token and root policy can do anything on the root server. So it’s a very effective token that controls everything on vault. So you should be extra careful using it.</p><p><strong>Vault login options</strong></p><p>You have 3 primary ways to interact with vault.</p><ul><li>CLI — Command-line interface for vault.</li><li>UI — Graphical interface for vault.</li><li>API — The last option is directly interacting with API</li></ul><p>CLI</p><p>It has a basic vault command structure.</p><blockquote>vault &lt;command&gt; &lt;subcommand&gt; [options] [arguments]</blockquote><p>Options and arguments are optional depending on what type of command you are running.</p><p>To display command help you can use these commands.</p><blockquote>vault &lt;command&gt; -help</blockquote><blockquote>vault path-help PATH</blockquote><p><strong>Environment Variables</strong></p><p>When the vault binary runs, it looks for a few environment variables that start with <strong>VAULT_</strong> prefix.</p><blockquote>VAULT_ADDR- Address of the vault server</blockquote><blockquote>VAULT_TOKEN- Token value for requests</blockquote><blockquote>VAULT_SKIP_VERIFY — No verify TLS cert</blockquote><blockquote>VAULT_FORMAT-Specify output format</blockquote><p><strong>Vault UI</strong></p><p>Graphical user interface for the vault server. It uses API to interact with vault. It’s not enabled by default. It runs on the same port with API. It provides a basic console for management.</p><p>You can connect to UI in dev mode using the URL below.</p><blockquote><a href="http://127.0.0.1:8200/ui/">http://127.0.0.1:8200/ui/</a></blockquote><p>Note: Please don’t forget to configure the necessary environment variables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*MKhNUQwAFTBokPadXivqrA.png" /></figure><p><strong>Vault API:</strong></p><p>The Vault API provides an HTTP endpoint for each access method.</p><p>You can control everything in vault with this API.</p><p>The Vault CLI also uses this API to interact with Vault.</p><p>Key features of Vault API:</p><ul><li>It’s a restful API.</li><li>It’s used by UI and the CLI.</li><li>There is no other option to interact with vault.</li><li>You can use curl with X-Vault-Token header to interact with it. (Because we need tokens to interact with API.)</li></ul><p><strong>Conclusion</strong></p><p>The vault uses a single binary for both client and server. You can use it in dev mode for local testing. To spin up a vault server in a local machine is super easy with a few commands. All vault communication goes through an API that sits in front of Vault server. You can interact with it using CLU, UI, or API calls. Before accessing the Vault server you need to configure environment variables like VAULT_ADDR, VAULT_TOKEN on CLI to interact with it.</p><p>Resources:</p><ul><li><a href="https://www.vaultproject.io/docs">Documentation | Vault by HashiCorp</a></li><li><a href="https://www.pluralsight.com/courses/hashicorp-certified-vault-associate-getting-started">Hashicorp Certified Vault Associate: Getting Started</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=658a3e523949" width="1" height="1" alt=""><hr><p><a href="https://medium.com/adessoturkey/getting-started-with-hashicorp-vault-658a3e523949">Getting started with Hashicorp Vault</a> was originally published in <a href="https://medium.com/adessoturkey">adessoTurkey</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Private Azure Kubernetes Service(AKS) Cluster]]></title>
            <link>https://medium.com/devopsturkiye/private-azure-kubernetes-service-aks-cluster-6dbd4ef32e37?source=rss-e24afda8d807------2</link>
            <guid isPermaLink="false">https://medium.com/p/6dbd4ef32e37</guid>
            <category><![CDATA[aks-privatecluster]]></category>
            <category><![CDATA[private-aks]]></category>
            <category><![CDATA[aks-security]]></category>
            <category><![CDATA[private-kubernetes]]></category>
            <category><![CDATA[aks-privatelink]]></category>
            <dc:creator><![CDATA[Firat Yasar]]></dc:creator>
            <pubDate>Fri, 10 Apr 2020 23:41:16 GMT</pubDate>
            <atom:updated>2020-04-11T05:51:49.399Z</atom:updated>
            <content:encoded><![CDATA[<p>Azure üzerinde AKS ile sahip olduğumuz Kubernetes cluster mimarisinde sadece worker node’lardan sorumlu oluruz ve uygulamamızı bu node’lar üzerinden yayınlarız. AKS yönetilen bir platform servisi olduğu için master node’ların yönetimi Microsoft tarafından yapılır ve bu kısımda herhangi bir sorumluluğumuz bulunmamaktadır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*ez7eAXepIzdcqgKBJ_53AA.jpeg" /></figure><p>AKS kullanılan mimarilerde worker node’lar Kubernetes API Server bileşeni ile public bir url üzerinden konuşur. Kendi AKS cluster’ımdan örnek vermek gerekirse, cluster’ımdaki API server URL’i aşağıdaki gibidir.</p><blockquote><strong>firatakscluster-dns-31c6f73e.hcp.westeurope.azmk8s.io</strong></blockquote><p>URL’in public olmasının sebebini şöyle açıklayabiliriz. Control plane bileşenlerinin kontrolünü Microsoft’ta olduğu için ve bu bileşenler Microsoft’un yönettiği private virtual network’lerde bulunmaktadır. Worker node’lar ise bizim yönettiğimiz virtual network’lere deploy edilirler. Bu iki ortamdaki node’lar bulundukları network’lerden private ip alırlar. Bu sebeple bu network’ler arasında bir routing mekanizması olmadığı için iletişim kuramazlar. Bu sebeple API server bileşeni public bir URL ile erişilebilir duruma gelir.</p><p>İşte bu noktada bazen AKS’nin en önemli bileşeninin public bir URL ile yayınlanması istenmeyen bir durum olabilir. Bu sebeple Microsoft’un yakın zamanda getirdiği Private Cluster özelliği ile API Server private bir URL üzerinden hizmet verebilir hale gelmiştir.</p><p>Microsoft’un yönettiği master ve bizim yönettiğimiz worker node’lar arasındaki bu private bağlantıyı sağlayan teknoloji ise yine yakın zamanda duyurulan <strong>Private link</strong> teknolojisidir. Private link için aşağıdaki link’i kullanarak ayrıntılı bilgi elde edebilir siniz.</p><p><a href="https://azure.microsoft.com/en-us/services/private-link/">Azure Private Link</a></p><p><strong>Azure platformu üzerinde private AKS konfigürasyonu nasıl yapılır?</strong></p><p>Private cluster konfigürasyonu oldukça basit. Eğer portal üzerinden kurulum yapılıyorsa default olarak disable gelen private cluster seçeneğini aşağıdaki şekilde olduğu gibi enable etmeniz yeterli olacaktır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*xXGePWAQhfXsMK0z-8KH1Q.jpeg" /></figure><p>Bu işlemin ardından normal kurulum seçenekleri takip edilerek private cluster kurulumunuzu tamamlayabilirsiniz.</p><p>Kurulum için Azure CLI kullanmak istediğinizde de komuta “<strong>–enable-private-cluster</strong>” parametresini eklemeniz yeterli olacaktır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/1*SLUyFy1AxeU44_xrdninfA.jpeg" /></figure><p>Kurulum işleminin ardından API server URL’ini kontrol ettiğimizde, URL’in aşağıdaki gibi değiştiğini görebiliriz.</p><blockquote>privateakscluster-dns-58d605e9.7b4b0103–57bc-40b7–8c21–64a8653d5062.privatelink.westeurope.azmk8s.io</blockquote><p>Kurulum aşamasının oldukça basit olduğu yukarıdaki adımlarda da görülmektedir. Şu anda cluster içerisindeki master ve worker node’lar private bir bağlantı üzerinden haberleşmektedir.</p><p><strong>Peki bir diğer önemli soru da şu, cluster’a nasıl bağlanabilirim?</strong></p><p>Private cluster konfigürasyonunda API server bileşeni public IP adresine sahip değildir. Bu sebeple cluster’ı yönetmek amaçlı api server ile iletişim kurmaya çalıştığınızda sorun yaşarsınız.</p><p>Örneğin aşağıdaki gibi cloud shell üzerinden cluster’ı yönetmek istediğinizde API Server’a bağlanamadığınızı belirten aşağıdaki hata ile karşılaşırsınız.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BQ2J55tBVkmVf9ewBA7Rsw.jpeg" /></figure><p>Bu bağlantı probleminin sebebi API server’ın public bir URL’e sahip olmamasıdır ve sizin kullandığınız cloudshell yada başka bir aracın master bileşenlerinin bulunduğu network’e özel bir bağlantısı bulunmamasıdır.</p><p>Budurumu çözmek için yapmanız gereken bir kaç farklı konfigürasyon vardır. Bunlar;</p><ul><li>AKS cluster’ın bulunduğu network’te management için bir VM yapılandırıp bu VM üzerinden cluster’ı yönetme.(Çünkü cluster’ın bulunduğu network master bileşenlerinin bulunduğu network ile özel bir bağlantıya sahiptir)</li><li>Farklı bir networkte VM yapılandırıp AKS Cluster’ın bulunduğu network ile peering işlemi yapma ve private DNS zone’a Vm virtual netowrk’ünü linkleme.</li><li>Express Route yada VPN bağlantısı ile AKS cluster’ın bulunduğu network’e bağlanma.</li></ul><p>Çok ihtiyaç olmadıkça AKS’in bulunduğu network’e VM deploy etmeyi pek doğru bulmuyorum. Bu sebeple management için ayrı bir network oluşturup bu network ile AKS network’ünü peer etmek daha mantıklı olacaktır.</p><p>peering sonrasında master’lar ile konuşabilen private bağlantıya sahip aks network’ü ile management VM’in bulunduğu network arasında connection aşağıdaki gibi sağlanacaktır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*Le4kKqOXHwFz2U3HUb3VPQ.jpeg" /></figure><p>Private AKS cluster deployment’ı yapılırken aynı zamanda private bir DNS zone’da deploy edilir. VM’in bulunduğu network üzerinden bu private zone’a DNS sorgusu yapabilmek için, VM’in bulunduğu network’ü özel bir bağlantı ile (yine budara da private link teknolojisi kullanılıyor) private DNS’e linklemek gerekir. Linkleme işlemi bir kaç adımda yapılabilen basit bir işlemdir.</p><p>Bunun için aşağıdaki gibi private DNS resource’u üzerine gelip virtual network links bölümünden VM network’ünü eklemek yeterli olacaktır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*-jVFrL9GXl8VtezlIklWqw.jpeg" /></figure><p>Bu işlemin ardından Add butonunu kullanarak aşağıdaki gibi VM’in bulunduğu network kolaylıkla linklenebilir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*zv59hO0HYnq8sE2p-qSooQ.jpeg" /></figure><p>Bu işlemler tamamlandıktan sonra, management için gerekli private bağlantıların yapıldığı network üzerinde bulunan VM ile cluster’a kolaylıkla erişim sağlanacaktır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*pPysqpSESHnZ7HQwMZSMRg.jpeg" /></figure><p>Private cluster preview durumda olduğu için buna bağlı seçeceğimiz resource’lara da dikkat edilmesi gerekiyor. Örneğin Sistem alt yapı olarak private link kullandığı için, basic load balancer kullanılamıyor. Bu yüzden load balancer’ın standard olması gerekiyor. Çünkü private link standard load balancer tarafından support ediliyor. (Private link teknolojisine biraz bağımlı durumdayız :) )</p><p>Ek olarak custom bir DNS server kullanmak isterseniz Azure DNS iplerinin (168.63.129.16) custom DNS Server’lara upstream DNS Server olarak girilmesi gerekiyor.</p><p>Private cluster’a ait limitasyonlar varmıdır?</p><p>Service yeni olduğu için bazı limitasyonlara sahip. Bunları özetlemek gerekirse;</p><ul><li>Ip authorization ranges private ip server’a uygulanamıyor.</li><li>Availability zone opsiyonu şu anlık belli region’larda mevcut.</li><li>Alt yapı olarak private link kullandığı için, bu servise ait limitasyonlar da private cluster’ı etkiliyor.</li><li>Virtual nodes desteklenmiyor.</li><li>Azure DevOps entegrasyonu out of box olarak desteklenmiyor.</li><li>Container Registry(ACR) kullanmak için, container registry virtual network’ü ile peering işlemleri yapılması gerekiyor.</li><li>Şu anda Azure Dev Spaces desteklenmiyor.</li><li>Var olan AKS Cluster’lar private cluster’a dönüştürülemiyor.</li><li>Azure Monitor for containers’ın live data özelliği şu anda desteklenmiyor.</li></ul><p><strong>Özetle;</strong></p><p>Yeni bir sevis olduğu için şu anlık limitasyonlar oldukça fazla görünüyor. Ancak bu limitasyonların çoğu private bir cluster olmasından ve public olarak diğer Azure servisleri ile direkt konuşamamasından kaynaklanıyor. Muhtemelen private link özelliği Azure platformu üzerindeki diğer service’ler ile entegre edilebilir hale geldikçe, private cluster’da yukarıda bahsettiğim limitasyonlardan kurtulacaktır.</p><p>Umarım herkes için faydalı olmuştur :)</p><p>Görüşmek üzere.</p><p>Kaynak: <a href="https://docs.microsoft.com/en-us/azure/aks/private-clusters">https://docs.microsoft.com/en-us/azure/aks/private-clusters</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6dbd4ef32e37" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devopsturkiye/private-azure-kubernetes-service-aks-cluster-6dbd4ef32e37">Private Azure Kubernetes Service(AKS) Cluster</a> was originally published in <a href="https://medium.com/devopsturkiye">Devops &amp; AI Türkiye☁️ 🐧 🐳 ☸️</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Azure Kubernetes Service(AKS) mimarisinde “Virtual Node” opsiyonu]]></title>
            <link>https://medium.com/devopsturkiye/azure-kubernetes-service-aks-mimarisinde-virtual-node-opsiyonu-550520da22b5?source=rss-e24afda8d807------2</link>
            <guid isPermaLink="false">https://medium.com/p/550520da22b5</guid>
            <category><![CDATA[ak]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[autoscaling]]></category>
            <category><![CDATA[aks-virtual-nodes]]></category>
            <category><![CDATA[azure-container-instances]]></category>
            <dc:creator><![CDATA[Firat Yasar]]></dc:creator>
            <pubDate>Sat, 28 Mar 2020 15:47:14 GMT</pubDate>
            <atom:updated>2020-03-28T15:54:06.627Z</atom:updated>
            <content:encoded><![CDATA[<p>Kubernetes mimarisinde cluster’ınız içerisinde pod’larınız genişleyecek alan bulamadıkları zaman cluster auto scaler çalışır ve cluster’ınıza bir node daha ekler. Sonrasında Kube Scheduler schedule edilmeyi bekleyen pod’ları yeni eklenen node üzerinde schedule eder. Tabi bu işlem çok hızlı olmaz ve node’un ayağa kalkması için bir süre beklenmesi gerekir. Bazı durumlarda çok kısa süreli çalışacak pod’lar için bu süreleri beklemek çok anlamlı değildir çünkü yeni node up duruma gelene kadar belki yük ortadan kalkabilir.</p><p>İşte tam bu noktada Azure üzerinde kullanabileceğiniz hızlı ve performanslı bir seçenek mevcuttur. “Virtual Nodes” :)</p><p><strong>Şimdi biraz daha bu virtual nodes opsiyonunu açıklayalım.</strong></p><p>Azure üzerinde Azure Container Instance(ACI) isminde container’larınızı çalıştırabileceğiniz, shared bir ortam kullanan ve saniye bazında ücretlendirildiğiniz bir servis mevcuttur. Bahsi geçen “Virtual nodes” özelliği de bu servis ile Azure Kubernetes Service(AKS)’in birbirlerine entegre edilmesi ile oluşturulmuştur.</p><p>Normalde ACI kullandığınızda container’ınız public bir ip alarak shared ortamdaki bir host üzerinde çalışmaya başlar. Fakat ACI’yi virtual node olarak kullandığınızda durum birazdaha farklı bir mimariye evrilir. Virtual node üzerinde çalışan pod’lar bu farklı mimari ile sizin belirleyeceğiniz private IP subnetinden IP alarak cluster ile güvenli bir biçimde iletişim kurarlar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*HMkascXzYEPW-7rz1oU16w.png" /></figure><p>Shared bir platform olan Azure container instance üzerinde çalıştırdığınız pod’lar için per/second şeklinde ücretlendirilirler.</p><p>Eğer pod’larınız çok kısa süreli genişlemeye ihtiyaç duyuyorsa, Azure Container Instance üzerinde horizontal olarak genişlemesi fiziksel bir node ayağa kaldırmaktan daha kullanışlıdır. Ya da kısa bir test işleminiz için yeni bir node eklemek istemiyorsanız, yine virtual node özelliğinden faydalanmak fiziksek bir node eklemekten daha efektif olacaktır.</p><p>Not: Şu anda Azure platformu üzerinde kullanabileceğimiz bu virtual node özelliği sadece Linux tabanlı pod ve node’lar için desteklenmektedir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*h5_SVb5dh9GyjcSJt--GJQ.png" /></figure><p><strong>Virtual Nodes özelliği nasıl entekre edilir?</strong></p><p>Virtual nodes özelliğini gerek portal üzerinden gerekse komut satırı ile entegre etmek oldukça kolaydır. Portal üzerinde aşağıdaki gibi “Virtual Nodes” opsiyonunu enable olarak işaretlemeniz yeterli olacaktır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*OhM1_h2zRdS9GWUbyZtQRg.png" /></figure><p>Azure Kubernetes Service(AKS) ile cluster provision etmek istediğinizde network opsiyonu olarak iki tip network seçebilirsiniz. Bunlar basic(Kubenet) ve advanced(cni) network seçenekleridir. En temel farkları advanced network pod’lar için node’ların bulunduğu ip havuzundan ip ataması yaparken, basic network seçeneği her nod üzerinde pod’lar için ayrı bir IP network’ü yapılandırır.</p><p>Virtual node yapılandırılacak olan AKS cluster’ın advanced network olarak konfigüre edilmiş olması gerekir. Böylece virtual nodes kendisine node network içerisinde bir subnet oluşturup, üzerindeki pod’lara bu subnetten ip ataması yapar hale gelir. Subnet sahip olduğu delegated permission ile Azure resource’ları ve AKS cluster arasındaki iletişimi sağlar. AKS cluster’ı oluştururken virtual nodes seçeneğini etkinleştirdiğinizde bu delegasyon işlemleri otomatik olarak tanımlanır.</p><p>Virtual node seçeneği etkinleştirildiğinde, network konfigürasyonu adımında artık basic network seçeneğinin seçilemediği görülmektedir. Şekilde işaretlediğim yerde bunun virtual node seçeneğinden kaynaklandığı da belirtilmektedir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*CuDX_0A94eg65CaVQNLLLQ.png" /></figure><p>Cluster kurulumunun ardından ilk kontroller yapıldığında network üzerinde virtual node için bir subnet oluşturulduğu görünür. Ayrıca aşağıdaki şekilde subnetin delegate edildiği servisin Azure Container Instance(ACI) olduğunu da görebilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yak-iOzM8X-c8vdCZM_VQA.png" /></figure><p>Bu işlemin ardından kubernetes cluster’a bağlanıp node’ları listelediğinizde virtual node’un listelendiğini görebilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*7gHEVTxxCnrT516iOE9MwA.png" /></figure><p>Virtual node entegrasyonu bu akdar basit. :) Şimdi bir adet test pod’u virtual node üzerinde schedule edelim.</p><p><strong>Schedule işlemi</strong></p><p>Test işlemi olarak aşağıdaki örnek yaml’ı kullanarak virtual node’un üzerinde bir pod schedule edebiliriz.</p><p>Resimde işaretlediğim kısımlar pod’un virtual node üzerinde schedule olabilmesi için gerekli node selector ve tolerations ayarlarıdır. Eğer cluster içerisinde bir pod’u direk virtual node üzerinde schedule etmek isterseniz, siz de kendi pod’larınız için bu ayarları yapılandırabilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/459/1*6RQhLaIE7tE_Q_e331JAVQ.png" /></figure><p>Pod’u deploy ettikten sonra aşağıdaki komut ile pod’un schedule işlemine ilişkin durumunu görüntüleyebilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y5O431L_qjihe1APp1L88w.png" /></figure><p>Kısa süre içinde pod aşağıdaki gibi running durumuna geçecektir. Burada dikkat etmenizi istediğim kısım, ip adresinin virtual node’un kullanması için oluşturulan subnetten alındığıdır ve bu pod artık per/saniye olarak çalıştığı süre boyunca ücretlendirilecektir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a-2eE0U_hO-CTZfGg4HvYA.png" /></figure><p>Platform üzerinden Azure container instance(ACI) kontrol edildiğinde, ilgili pod’u çalıştıracak olan ACI resource’unun deploy edildiğini görebilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*ROuwQ0MKNMPq6GKrl6jIoA.png" /></figure><p>Oluşturulan container instance resoure’unun overview kısmı bize çalıştırılan pod hakkında ayrıntılı bilgi verecektir. Örneğin aşağıdaki resimde alınan IP’nin private olduğu ve pod içerisinde bir adet container çalıştığını görebilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KPH18asQhsAZJ4Vgh-ocQw.png" /></figure><p>Uygulamayı örnek olarak internete açmak için, Kubernetes cluster üzerinde loadbalancer tipinde bir service oluşturabiliriz. Burada göstermek istediğim service Kubernetes üzerinde internetten expose edilirken, arkasındaki podların sorunsuz şekilde Azure Container Instance(ACI) üzerinde çalıştığı ve erişilebilir olduğudur.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*RRWx_0Tk9chk8LOJKpgxTQ.png" /></figure><p>İlgili IP’ye browser üzerinden gidildiğinde virtual cluster üzerindeki uygulamanın servis arkasında sorunsuz çalıştığı görülmektedir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HlHlHypWBhbRE_362h4fvA.png" /></figure><p><strong>Peki virtual node’un limitasyonları var mı?</strong></p><p>Mimari bakımından bize çok esneklik sağlasada şu anda bazı limitasyonları bulunuyor. Ancak bu limitasyonlar hızlı şekilde ortadan kaldırılıyor diyebilirim. Özellikle dikkat edilmesi gereken durumlar;</p><ul><li>Azure AD service principal authentication desteklenmiyor. Bu yüzden önerilen service principal’ların cluster içerisinde secret olarak saklanması.</li><li>Network konfigürasyonunda peering, Kubernetes network policy ve internete yapılan outbound trafik üzerinde uygulanmış nsg’ler desteklenmiyor.</li><li>Init container kullanılan pod’lar desteklenmiyor.</li><li>Host Alias desteklenmiyor.</li><li>DaemonSet’ler virtual node üzerine pod olarak deploy edilemiyor.</li><li>Windows Server node’lar virtual node ile birlikte kullanılamıyor.</li></ul><p><strong>Kısa bir özetlersek:</strong></p><p>Azure Container Instance(ACI) resource’u sayesinde ek bir infrastructure kaynağına ihtiyaç duymadan container’larınızı AKS cluster’a deploy edebilirsiniz. Üstelik deploy ettiğiniz bu virtual node private network’ünüz üzerindeki özel bir subnet’ten pod’larınıza ip ataması yapar. Bu sayede de AKS cluster ile ACI arasındaki iletişim güvenli bir biçimde sağlanmış olur. Bu mimaride virtual node üzerinde çalışan node’larınız per/second olarak ücretlendirilir.</p><p>Bir sonraki bölümde görüşmek üzere.</p><p>Kaynak: <a href="https://docs.microsoft.com/bs-latn-ba/azure/aks/virtual-nodes-portal">https://docs.microsoft.com/bs-latn-ba/azure/aks/virtual-nodes-portal</a></p><p>Kaynak 2: <a href="https://github.com/Azure-Samples/virtual-node-autoscale">https://github.com/Azure-Samples/virtual-node-autoscale</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=550520da22b5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devopsturkiye/azure-kubernetes-service-aks-mimarisinde-virtual-node-opsiyonu-550520da22b5">Azure Kubernetes Service(AKS) mimarisinde “Virtual Node” opsiyonu</a> was originally published in <a href="https://medium.com/devopsturkiye">Devops &amp; AI Türkiye☁️ 🐧 🐳 ☸️</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AKS Mimarisinde Kullanabileceğiniz Yönetilen L7 Loadbalancer — AGIC]]></title>
            <link>https://medium.com/devopsturkiye/aks-mimarisinde-kullanabilece%C4%9Finiz-y%C3%B6netilen-l7-loadbalancer-agic-229826199f25?source=rss-e24afda8d807------2</link>
            <guid isPermaLink="false">https://medium.com/p/229826199f25</guid>
            <category><![CDATA[application-gateway]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[app-gateway-ingress]]></category>
            <category><![CDATA[ak]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Firat Yasar]]></dc:creator>
            <pubDate>Sun, 22 Mar 2020 13:20:16 GMT</pubDate>
            <atom:updated>2023-03-19T19:06:46.911Z</atom:updated>
            <content:encoded><![CDATA[<h3>Azure Kubernetes Service(AKS)- Yönetilen L7 Loadbalancer — Application Gateway</h3><p>Application Gateway Ingress Controller(AGIC) Azure üzerinde bir platform servisi olan Application Gateway ile Azure Kubernetes Service’in(AKS) birbirlerine bind edilmesiyle oluşmuş olan bir çözümdür. Bu çözüm ile AGIC open source bir controller olarak sunulmaktadır. Böylece fully managed ,scalable ve yüksek erişilebilir bir L7 load balancer olan Application Gateway AKS mimarisi ile birlikte kullanılabilir hale gelir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/1*fAjfxxwDcekBSvp-sU0syw.jpeg" /></figure><p><strong>Application Gateway Ingress Controller nedir? Nasıl çalışır?</strong></p><p>AGIC, Azure Kubernetes Service(AKS) kullanan kişilerin uygulamalarını internet üzerinden erişilebilir hale getirebilmesi için Application Gateway gibi L7 loadbalancer olarak çalışan bir yönetilen servisi kullanmasına olanak sağlayan bir Kubernetes uygulamasıdır ve cluster içerisinde bir agent gibi çalışır.</p><p>Temel olarak AGIC Kubernetes cluster’ı izler ve değişiklik durumunda devamlı olarak application gateway’i update eder. Bu mimari yapıda load balancing mekanizmasi Kubernetes cluster dışında, application gateway tarafından kontrol edilir.</p><p>AGIC AKS cluster üzerinde pod içerisinde çalışır. Bu pod yardımı ile Kubernetes mimarisindeki belirli kaynaklar üzerindeki değişiklikleri kontrol eder. Değişiklik olduğunu algıladığı anda ARM (Azure Resource Manager) yardımıyla Azure platformu üzerindeki Application Gateway’i update eder.</p><p>Temel olarak AGIC’in çalışmasına ilişkin diagram aşağıdaki gibidir.</p><p>Şekilden de anlaşıldığı gibi Kubernetes API AGIC tarafından devamlı monitör edilir. Ingress resource’ları ile ilgili herhangi bir değişiklik olduğunda Azure Resource Manager’ı kullanarak Azure platformu üzerindeki APP Gateway’i update eder. Cluster’a gelen trafik application gateway üzerinden geçerken belirlenen routing mekanizmalarına göre pod’lara yönlendirilir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*F2CA8ML-lbTPFYjNn9QeuQ.jpeg" /></figure><p>AGIC’te diğer ingress controller’larda olduğu gibi Kubernetes üzerindeki ingress objelerini kullanır. Bu objelerin kontrolü içinde ortama gerekli olan pod ve service’lerin deployment’larını yapar.</p><p>Ingress controller olarak AGIC kullandığınızda Kubernetes cluster’ınız üzerinde elde edeceğiniz gelişmiş özellikler aşağıdaki gibidir;</p><ul><li>URL routing</li><li>Cookie-based affinity</li><li>SSL termination</li><li>End-to-end SSL</li><li>Public,private ve Hybrid website desteği</li><li>Web Application Firewall ile entegrasyon</li></ul><p>Aşağıdaki şekil cluster için L7 loadbalancer kullanılarak yapılan ingress konfigürasyonu ile AGIC kullanılarak yapılan ingress konfigürasyonunun farklarını göstermektedir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*JVysWWAWzEzH-IInHXVJQg.png" /></figure><p>Burada dikkat edilecek kısım şudur. Cluster içerisinde konfigüre edilen L7 loadbalancer, tüm operasyonları için cluster’ın compute resource’larını kullanacaktır. Ayrıca in-cluster ingress loadbalancer network trafiği için service kaynağına ihtiyaç duyacaktır. Kubenet kullanılan network mimarilerinde bu yapı network trafiğinde fazladan hop oluşmasına sebep olacaktır.</p><p>AKS mimarisinde advanced network opsiyonu kullanılarak pod’ların node’ların bulunduğu ip network’ünden ip alması sağlanabilir. Böyle bir konfigürasyonda Application Gateway Kubernetes üzerindeki pod’lara direkt olarak erişebilir. Bu da Azure platformu üzerindeki L7 loadbalancer’dan gelen trafiğin herhangi bir ara katmana uğramadan direk pod’a gitmesi anlamına gelir ve bu iletişimde ekstra hop bulunmaz ve networkteki gecikme oldukça düşüktür.</p><p><strong>Peki ya Performans?</strong></p><p>Performans karşılaştırması deneme fırsatım olmadı. Ancak okuduğum kaynaklara göre Application gateway direk olarak pod’lara erişebildiği için in-cluster L7 loadbalancer’lara oranla %50 daha düşük network gecikmesine sahip. Ayrıca daha önce söylediğim gibi in-cluster L7 loadbalancer’dan Application Gateway’e geçmek, cluster üzerindeki available resource miktarınıda arttıracaktır. Bu da uygulamalarınız için daha fazla available resource anlamına gelir.</p><p>3 Node’lu bir AKS cluster üzerinde hem Application Gateway hemde In-cluster L7 loadbalancer ile yapılan performans testinde çıkan sonuçlara göre tüm request’ler bazında ortalama gecikme süreleri aşağıdaki gibi sonuçlanmıştır.</p><ul><li>Application Gateway: 480ms per request</li><li>In-cluster Ingress: 710ms per request</li></ul><p><strong>AGIC’i kaç farklı şekilde kurabiliriz?</strong></p><p>AGIC için farklı mimarilerde kurulum adımlarını içeren link’ler aşağıdaki gibidir. Bu linklerden faydalanarak AGIC’i 3 farklı senaryoda yapılandırabilirsiniz.</p><ul><li><strong>Greenfield Deployment:</strong> Tamamen sıfırdan bir AKS cluster kurup gerekli konfigürasyonların yapılması için gerekli konfigürasyonları içerir. Adım adım kurulum link’i aşağıdaki gibidir:</li></ul><p><a href="https://github.com/Azure/application-gateway-kubernetes-ingress/blob/master/docs/setup/install-new.md">Azure/application-gateway-kubernetes-ingress</a></p><ul><li><strong>Windows Cluster için Greenfield Deployment</strong>: Windows nodepool’a sahip AKS cluster’lar için kurulum adımları aşağıdaki gibidir.</li></ul><p><a href="https://github.com/Azure/application-gateway-kubernetes-ingress/blob/master/docs/setup/install-new-windows-cluster.md">Azure/application-gateway-kubernetes-ingress</a></p><ul><li><strong>Brownfield Deployment</strong>: AKS ve Application Gateway olan ortama AGIC kurmak için gerekli adımları içerir. Adım adım kurulum linki aşağıdaki gibidir.</li></ul><p><a href="https://github.com/Azure/application-gateway-kubernetes-ingress/blob/master/docs/setup/install-existing.md">Azure/application-gateway-kubernetes-ingress</a></p><p>Özet olarak;</p><p>Azure platformu üzerinde yönetilen bir L7 loadbalancer olan Application Gateway, cluster dışında yönetilen, altyapısında vmscaleset kullanan ve bu sayede ultra scalable ve available bir servis olduğundan dolayı, in-cluster ingress controller’lara göre daha iyi performans vermektedir. In-cluster ingress controller’lar cluster üzerine ek bir compute yükü getirmektedir ve kullandığı katmanlar ile network trafiğinde ekstra yönlendirmelere maruz kalmaktadır.</p><p>Tabi işin düşünülmesi gereken bir diğer tarafı da maliyettir. L7 Load Balancer olarak Azure platformu üzerinde Application Gateway kullanmak bize ek maliyet getirecektir. Ancak yönetilen bir platform olduğu için bu servisin up ve running durumda olması ile bizim ilgilenmemiz gerekmeyecektir. Bu da cluster’ımızın karmaşıklığını biraz da olsa azaltacaktır.</p><p>In-cluster L7 load balancer olarak opensource load balancer kullanarak Application Gateway kullanıldığında oluşan maliyeti ortadan kaldırabiliriz. Ancak bu beraberinde yönetimsel maliyetleri de getirecektir. Bu resource’ların up ve running durumda olması tamamen bizim sorumluluğumuzda olacaktır. Yine bu resource’ların update ve upgrade edilmesini de yine bizim üstlenmemiz gerekecektir. Ayrıca yoğun kullanılan bir cluster’da cluster compute kaynaklarını hesaplarken bu loadbalancer’ın kullanacağı compute resource’unun da dikkate alınması gerekecektir.</p><p><strong>Kaynak:</strong> <a href="https://docs.microsoft.com/tr-tr/azure/application-gateway/ingress-controller-overview">https://docs.microsoft.com/tr-tr/azure/application-gateway/ingress-controller-overview</a></p><p><strong>Kaynak2</strong>: <a href="https://azure.github.io/application-gateway-kubernetes-ingress/">https://azure.github.io/application-gateway-kubernetes-ingress/</a></p><p><strong>Kaynak3</strong>: <a href="https://azure.microsoft.com/en-us/blog/application-gateway-ingress-controller-for-azure-kubernetes-service/">https://azure.microsoft.com/en-us/blog/application-gateway-ingress-controller-for-azure-kubernetes-service/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=229826199f25" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devopsturkiye/aks-mimarisinde-kullanabilece%C4%9Finiz-y%C3%B6netilen-l7-loadbalancer-agic-229826199f25">AKS Mimarisinde Kullanabileceğiniz Yönetilen L7 Loadbalancer — AGIC</a> was originally published in <a href="https://medium.com/devopsturkiye">Devops &amp; AI Türkiye☁️ 🐧 🐳 ☸️</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Azure Kubernetes Service (AKS) — Scaling Opsiyonları]]></title>
            <link>https://medium.com/devopsturkiye/azure-kubernetes-service-aks-scaling-opsiyonlar%C4%B1-681f1f74eee1?source=rss-e24afda8d807------2</link>
            <guid isPermaLink="false">https://medium.com/p/681f1f74eee1</guid>
            <category><![CDATA[hpa]]></category>
            <category><![CDATA[ak]]></category>
            <category><![CDATA[cluster-autoscaler]]></category>
            <category><![CDATA[horizontal-pod-autoscaler]]></category>
            <category><![CDATA[azure-kubernetes-service]]></category>
            <dc:creator><![CDATA[Firat Yasar]]></dc:creator>
            <pubDate>Wed, 26 Feb 2020 21:17:18 GMT</pubDate>
            <atom:updated>2020-02-28T09:04:07.128Z</atom:updated>
            <content:encoded><![CDATA[<h3>Azure Kubernetes Service (AKS) — Scaling Opsiyonları</h3><p>Scaling yüksek trafik alan uygulamalar için günümüzde düşünülmesi gereken en önemli konfigürasyon seçeneklerinden birisi haline gelmiştir. Artık yeni nesil, container’lar içerisinde çalışan modern uygulamalar da yüksek erişilebilir şekilde tasarlanmaktadır. Yoğun trafik altında uygulamanın sorunsuz çalışması için bu tarz mekanizmalar architect’ler için düşünülmesi gereken en önemli bileşenler haline gelmiştir.</p><p>Scaling mekanizmaları cluster mimarileri içerisinde hem fiziksel seviyede hemde uygulama bileşenleri seviyesinde uygulanabilir. Bu makalemde Azure Kubernetes Service (AKS) mimarisindeki tüm scaling mekanizmalarını ele almaya çalışacağım.</p><p>Temel olarak AKS mimarisinde iki adet scaling opsiyonu bulunur.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*X83TitSbQgj4YRMRBjFY3w.png" /></figure><ul><li><strong>Cluster Auto Scaler:</strong> Resorurce sıkıntısından ötürü schedule olamayan podlar izlenir. Böyle bir durum saptandığında cluster otomatik olarak belli sayıda node’a genişler.</li><li><strong>Horizontal Pod Autoscaler:</strong> Bu scaling opsiyonu Kubernetes cluster içerisindeki <strong>Metric Server</strong> bileşenini kullanır. Bu sayede pod lar tarafından talep edilen resource talepleri belirlenir. Uygulamaların daha fazla kaynağa ihtiyaç duyduğu zamanlarda talebi karşılamak için belli sayıda pod service arkasına eklenir.</li></ul><p>Yukarıda bahsedilen her iki mimari içinde node ve pod sayıları hem otomatik olarak yükseltilir hem de düşürülür. Örneğin cluster autoscaler belli periodda node üzerindeki kullanılmayan kapasiteyi hesaplar ve gereksiz olan node’ları kapatır. Bu node’lar üzerindeki pod’larda otomatik olarak silinip diğer ayakta olan node’lar üzerinde schedule edilirler.</p><p>Bazı durumlarda cluster autoscaler işlevini tamamlayamayabilir. Örneğin pod bir deployment yada replicaset’in parçası olarak oluşturulmamış olabilir, yada pod için yapılandırılmış nodeSelector yada anti-affinity konfigürasyonları olabilir, yada pod bulunduğu node üzerinde local storage kullanıyor olabilir. Böyle durumlarda pod silinip tekrardan schedule edilemez. Bu yüzden cluster autoscaler kullanılacağı zaman bu durumlar göz önünde bulundurulmalıdır.</p><p>İki scaling opsiyonuda beraber çalışabilir. Böyle durumlarda horizontal pod autoscaler uygulama için gerekli olan kaynak taleplerini takip ederken, cluster autoscaler schedule edilmiş podlar için gereki olan node sayısını takip eder.</p><p>Cluster autoscaler kullanıldığı durumlarda manuel scaling disable edilir. Eğer cluster manuel olarak scale edilmek istenirse, cluster auto scaler disable edilmelidir. Cluster autoscaler kullandığınız mimarilerde HTTP Application Routing add-on’u kullanılamamaktadır.</p><p><strong>Cluster autoscaler nasıl konfigüre edilir?</strong></p><p>Uygulamalarınızın gereksinimlerine bağlı olarak belli durumlarda cluster’ınızdaki node sayısını arttırmak isteyebilir siniz. Işte bu noktada cluster autoscaler devreye girer.</p><p>Cluster autoscaler uygulamanıza ait workload’u taşıyan ve kaynak yetersizliğinden ötürü schedule edilemeyen pod’larınız için cluster’ı monitor eder. Eğer böyle bir durum saptanırsa(kaynak yetersizliğinden ötürü schedule edilemeyen pod durumu) uygulama gereksinimlerine göre nodepool içerisindeki node’ların sayısı arttırılır. Aynı şey tersi durum için de geçerlidir. Node’lar düzenli olarak kontrol edilir ve uygulama tarafından node üzerindeki kaynaklara olan ihtiyaç düşerse, node sayısı da düşürülür. Cluster autoscaler tarafından bu işlem otomatik olarak sağlanır.</p><p>Şimdi hızlı şekilde cluster autoscaler konfigürasyonunun nasıl yapıldığını göstermek için yeni bir AKS Cluster oluşturalım. Cluster kurulumu sırasında cluster autoscaler özelliğinin nasıl etkinleştirildiğine göz atalım.</p><p>Öncelikle cluster objesi için bir resource group oluşturalım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*vU6Ds2ynX4hBu0D6gBEilQ.png" /></figure><p>Resource group oluşturma işleminin ardından bu resource groubu kullanarak ve gerekli diğer parametreleri vererek bir AKS Cluster oluşturalım. Burada cluster autoscaler’a ilişkin dikkat edilmesi gereken üç önemli parameter vardır. Bunlar;</p><ul><li><strong>Enable-cluster-autoscaler</strong> : Bu özelliğin aktif hale getirilmesini sağlar.</li><li><strong>Min-count:</strong> Çalışacak minimum pod sayısını ifade eder.</li><li><strong>Max-count:</strong> Çalışabilecek maksimum pod sayısını ifade eder.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/379/1*DxGzdxt4DLdjKGBQveqxRw.png" /></figure><p>Gerekli parametreler kullanılarak AKS cluster oluşturulduktan sonra yapılan autoscaler ayarını kontrol edebilmek için NodePool üzerindeki scale ayarına bakabiliriz.</p><p>Scale ayarı kontrol edildiğinde scale metodunun ne olduğu, maksimum ve minimum count ayarlarını görüntüleyebilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/1*nLLnWnKrTtyxWT1KiZ7dWQ.png" /></figure><p>Belirli durumlarda maksimum ve minimum sayıları değiştirilmek istenebilir. Bunu portal üzerinden kolaylıkla yapabilirsiniz. Yada aşağıdaki komutu kullanarak scale konfigürasyonunuzu update edebilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/405/1*u2qv9GblIVa4r5ria-XbRA.png" /></figure><p>Node seviyesinde cluster autoscale konfigürasyonunu yapmak Azure platformu üzerinde yukarıdaki adımlardan ibarettir.</p><p><strong>Peki Pod Seviyesinde scaling konfigürasyonu nasıl yapılır?</strong></p><p>Kubernetes mimarisinde pod’ların yatay olarak scale olması desteklenmektedir. Hatta bu özellik <strong>horizontal pod autoscaling</strong> olarak isimlendirilir. Bu scaling mimarisind CPU utilizasyonu yada diğer metrik değerlere göre pod’ların scale olması sağlanabilir. Tabi bu scaling yapısının çalışması için Metric Server bileşenine ihtiyaç vardır. Metric server bileşeni sayesinde pod’ların resource utilizasyonları monitor edilir.</p><p>Metric Server AKS mimarisinde 1.10 versiyonu ile birlikte kurulu olarak gelmektedir. Eğer daha önceki versiyonları kullanıyorsanız, Metric Server’ı kurmak için aşağıdaki komutları sırasıyla çalıştırmanız yeterli olacaktır.</p><blockquote><strong><em>git clone </em></strong><a href="https://github.com/kubernetes-incubator/metrics-server.git"><strong><em>https://github.com/kubernetes-incubator/metrics-server.git</em></strong></a></blockquote><blockquote><strong><em>kubectl create -f metrics-server/deploy/1.8+/</em></strong></blockquote><p>Horizontal pod autoscaling’in çalışması için gerekli ikinci gereksinim ise pod definition’larında aşağıdaki gibi CPU request ve limit tanımlamalarının yapılmasıdır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/1*Km_ogtK5X618P5A3k6Xtkg.png" /></figure><p>Bu gereksinimler tamamlandıktan sonra, HorizontalPodAutoscaler objesini aşağıdaki gibi oluşturularak ilgili objelere bind edilebilir.</p><p>Objeyi iki şekilde oluşturabiliriz. Ya aşağıdaki gibi yaml file’ını kullanarak deploy ederiz. Yada imperative metodu kullanarak komut yoluyla horizontalPodAutoscaler objesini oluşturabilirz.</p><p>Öncelikle aşağıdaki definition file’ını yorumlayalım. Resimde verdiğim numaraların ne anlama geldiğini açıklayarak devam edelim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*Z1EEoTb1BJmzJ4s07LAV3A.png" /></figure><ol><li>HPA(HorizontalPodAutoscaler) objesinin hangi obje için oluşturulacağı bu kısımda belirlenir. Bir deployment objesi için bu özelliği kullanacağımız için kind olarak Deployment yazılmıştır.</li><li>Bu kısımda hangi deployment objesi için bu konfigürasyonun yapıldığı belirtilir. Bu amaçla deployment objesinin ismi yazılmıştır.</li><li>targetCPUUtilizationPercentage kısmı bize pod’un scale olması için gerekli metric değeri verir. CPU utilizasyonu %50 olduğunda scaling işleminin yapılacağı anlamına gelir.</li><li>Max ve Min replica kısmı ise bize çalışacak maksimum ve minimum pod sayısını verir.</li></ol><p>Yukarıdaki definition dosyasını <strong>kubectl apply -f</strong> komutu ile kullanarak HPA objesini oluşturabilirsiniz.</p><p>Yada aşağıdaki komutu çalıştırarak da aynı sonucu elde edebilirsiniz.</p><p><strong>kubectl autoscale deployment azure-vote-front — cpu-percent=50 — min=3 — max=10</strong></p><p>HPA objesini oluşturduktan sonra kontrol amaçlı kubectl get hpa komutunu çalıştırabilirsiniz. Komutun çıktısında cluster üzerindeki HPA objeleri tüm parametreleri ile listelenecektir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*c13IUQocN8b3MWNWxyaRQg.png" /></figure><p>Özet olarak AKS cluster üzerinde node seviyesinde ve pod seviyesinde yapılandırabileceğiniz scaling ayarları mevcut. Node seviyesinde çalışan cluster autoscaler pod schedule işlemlerini kontrol edip, pod’lar schedule olamadığında yeni bir node ekleme işleminden sorumludur. Horizontal Pod Autoscaler ise Kubernetes ile birlikte gelen Metric server bileşenini kullanıp pod utilizasyonuna göre scaling’in horizontal olarak yapılmasını sağlayan bileşendir. İki scaling özelliğini de düzgün şekilde konfigüre edip birlikte kullanarak Kubernetes cluster üzerinde yüksek trafikli kolayca ölçeklenebilir modern uygulamalara sahip olabilirsiniz.</p><p>Kaynak: <a href="https://docs.microsoft.com/en-us/azure/aks/tutorial-kubernetes-scale">https://docs.microsoft.com/en-us/azure/aks/tutorial-kubernetes-scale</a></p><p>Kaynak2: <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/">https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=681f1f74eee1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devopsturkiye/azure-kubernetes-service-aks-scaling-opsiyonlar%C4%B1-681f1f74eee1">Azure Kubernetes Service (AKS) — Scaling Opsiyonları</a> was originally published in <a href="https://medium.com/devopsturkiye">Devops &amp; AI Türkiye☁️ 🐧 🐳 ☸️</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>