<?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 Amila Kumaranayaka on Medium]]></title>
        <description><![CDATA[Stories by Amila Kumaranayaka on Medium]]></description>
        <link>https://medium.com/@amila.kumaranayaka?source=rss-87bac7cee994------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*BgD5uJkJxyGGjZdm.</url>
            <title>Stories by Amila Kumaranayaka on Medium</title>
            <link>https://medium.com/@amila.kumaranayaka?source=rss-87bac7cee994------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 12:59:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@amila.kumaranayaka/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[Terraforming an AWS EKS Cluster with ALB]]></title>
            <link>https://medium.com/@amila.kumaranayaka/terraforming-an-aws-eks-cluster-with-alb-b08f2541b4ac?source=rss-87bac7cee994------2</link>
            <guid isPermaLink="false">https://medium.com/p/b08f2541b4ac</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[aws-eks-using-terraform]]></category>
            <category><![CDATA[aws-alb]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Amila Kumaranayaka]]></dc:creator>
            <pubDate>Sun, 31 Mar 2024 02:14:20 GMT</pubDate>
            <atom:updated>2024-03-31T02:14:20.689Z</atom:updated>
            <content:encoded><![CDATA[<p>Terraform and Amazon Web Services (AWS) Elastic Kubernetes Service (EKS) offers a powerful solution for managing modern cloud infrastructure. While EKS provides a managed Kubernetes environment, setting up load balancing can be complex. In this article, we’ll explore how to leverage Terraform to streamline the process of creating an AWS EKS cluster and integrating it with an Application Load Balancer (ALB), ensuring a scalable and resilient infrastructure for cloud native applications.</p><p><strong>Why Terraform?</strong></p><p>Terraform enables developers and operators to define infrastructure configurations in a declarative manner. Here’s why Terraform is the perfect fit for provisioning and managing AWS EKS clusters. Other alternatives would be Cloudformation or AWS CDK but Terraform provides a much cleaner and moduler way to declaratively define infrastructure.</p><ol><li>Automation: Terraform automates the provisioning and configuration of resources, reducing manual effort and minimizing the risk of human error.</li><li>Consistency: Infrastructure configurations are codified, ensuring consistency across deployments and environments.</li><li>Scalability: Terraform’s modular design allows for scalable infrastructure management, supporting growth and evolution over time.</li><li>Version Control: Infrastructure code can be versioned and managed using version control systems, promoting collaboration and reproducibility<strong>.</strong></li></ol><p><strong>AWS EKS Configuration</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*xWggXnW1W0A3n6y70WFFVg.png" /></figure><p>AWS EKS with EKS managed nodes are slected to reduce the operational overhead. Additionally two nodepools are used one with regular instanes and another with spot instances.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b08f2541b4ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reduce AWS cost with a Graviton EKS cluster]]></title>
            <link>https://medium.com/devops-srilanka/graviton-eks-cluster-39a74f12b820?source=rss-87bac7cee994------2</link>
            <guid isPermaLink="false">https://medium.com/p/39a74f12b820</guid>
            <category><![CDATA[graviton2]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[aws-eks]]></category>
            <dc:creator><![CDATA[Amila Kumaranayaka]]></dc:creator>
            <pubDate>Fri, 29 Apr 2022 22:53:43 GMT</pubDate>
            <atom:updated>2022-05-01T06:48:09.640Z</atom:updated>
            <content:encoded><![CDATA[<p>Lot of organisations has adopted Kubernetes as the preferred container orchestration solution in recent years. Also the number of organizations that are adopting containers and microservice architectures increase day by day. As more and more workloads get deployed in Kubernetes with AWS, it becomes much more important to improve the cost efficiency of running these services.</p><p>AWS had introduced AWS Graviton series of processors <a href="https://aws.amazon.com/about-aws/whats-new/2019/04/-amazon-eks-supports-ec2-a1-instances-as-a-public-preview-/">supported EKS since 2019</a> and this gives a good opportunity to reduce cost and gain better performance.</p><p><strong>Intel x86based server:</strong></p><p>InstanceType: t3.large, CPU: 2, RAM:8, Storage: EBS Only, NetworkBandwidth: upto 5 Gbps, PricePerHour:0.096, Monthly: <strong>70USD</strong></p><p><strong>Graviton arm based server:</strong></p><p>InstanceType: t4g.large, CPU: 2, RAM:8, Storage: EBS Only, NetworkBandwidth: upto 5 Gbps, PricePerHour:0.0768, Monthly: <strong>56USD</strong></p><p>calculations were performed using the <a href="https://calculator.aws/#/createCalculator/EC2">AWS cost calculator</a>.</p><p>Based on this information when switching to Graviton based instance we could save 14 USD per instance within a month for large burstable type instance. This is about 20% in savings for the same performance. Therefore it makes total sense to use graviton instances if your workloads can support running in arm based architecture.</p><p>This would be easily archivable if the language or framework used for building the applications has arm support. As an example for a Golang application we only need to compile the application in arm compatible way.</p><p>So in this example i’m going to create an EKS cluster which will have arm based worker nodes.</p><pre>---</pre><pre>apiVersion: eksctl.io/v1alpha5</pre><pre>kind: ClusterConfig</pre><pre>metadata:</pre><pre>name: cluster-graviton-1</pre><pre>region: eu-central-1</pre><pre>managedNodeGroups:</pre><pre>- name: ng-graviton-central-1a</pre><pre>instanceType: t4g.large</pre><pre>desiredCapacity: 1</pre><pre>availabilityZones: [&quot;eu-central-1a&quot;]</pre><pre>- name: ng-graviton-central-1b</pre><pre>instanceType: t4g.large</pre><pre>desiredCapacity: 1</pre><pre>availabilityZones: [&quot;eu-central-1b&quot;]</pre><p>Above configuration will be used to create a cluster using eksctl cli.</p><pre>eksctl create cluster -f graviton-cluster.yaml</pre><p>We can see in the console the cluster is created and managed node pools are added.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sq7fe1F49wiPYuuXyWMXJg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZavwVgzTIQGLRBRgFng3lw.png" /></figure><p>Now we check if the cluster nodes are already registered via cli</p><pre>kubectl get nodes<br>NAME                                              STATUS   ROLES    AGE     VERSION<br>ip-192-168-23-21.eu-central-1.compute.internal    Ready    &lt;none&gt;   6h30m   v1.21.5-eks-9017834<br>ip-192-168-75-197.eu-central-1.compute.internal   Ready    &lt;none&gt;   6h30m   v1.21.5-eks-9017834</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39a74f12b820" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-srilanka/graviton-eks-cluster-39a74f12b820">Reduce AWS cost with a Graviton EKS cluster</a> was originally published in <a href="https://medium.com/devops-srilanka">DevOps SriLanka</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Writing a Kubernetes Operator — Locust Operator]]></title>
            <link>https://medium.com/devops-srilanka/writing-a-kubernetes-operator-locust-operator-15123dd5250a?source=rss-87bac7cee994------2</link>
            <guid isPermaLink="false">https://medium.com/p/15123dd5250a</guid>
            <category><![CDATA[locust]]></category>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[load-testing]]></category>
            <category><![CDATA[kubernetes-operator]]></category>
            <dc:creator><![CDATA[Amila Kumaranayaka]]></dc:creator>
            <pubDate>Sun, 23 Aug 2020 15:08:33 GMT</pubDate>
            <atom:updated>2020-12-04T20:10:10.426Z</atom:updated>
            <content:encoded><![CDATA[<h3>Writing a Kubernetes Operator — Locust Operator</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*DDsI0Q0bJQbyWQVfL7h0jg.jpeg" /></figure><p>In my previous article, I discussed how two frameworks can be used to generate the basic structure for a Kubernetes Operator. In this article I would discuss how to build on top of the base generated by the framework, so let’s go through how to build an operator with simple functionality. If you don’t know about Kubernetes operators check out <a href="https://www.youtube.com/watch?v=zT7CHpHy1Oc&amp;t=3684s"><em>the session</em></a><em> </em>where I talked about extedin detail.</p><p>I will be building an operator for Locust. Locust is a framework for load testing written in python. It is easy to use and supports distributed mode for simulating a higher load. But running locust in distributed mode needs more effort and a good understanding of infrastructure.</p><p>Main functions expected from Locust Operator:</p><ul><li>Deploy locust in standalone mode</li><li>Deploy locust in distributed mode</li><li>Create Kubernetes Deployments and Services</li><li>Number of slaves can be customized</li></ul><p>Generate Resources</p><pre>operator-sdk new locust-operator --repo=github.com/amila-ku/locust-operator</pre><pre>operator-sdk add api --api-version=locustload.cndev.io/v1alpha1 --kind=Locust</pre><p>Defining the API of Locust custom resource.</p><p>type definitions are created under<em> pkg</em>/<em>api/locustload/v1alpha1/ </em>in locust_types.go file, struct is already generated by operator SDK with a default value but I would replace with values for our locust operator.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6985a72dacb910135d9168c85b43ba63/href">https://medium.com/media/6985a72dacb910135d9168c85b43ba63/href</a></iframe><p><em>LocustSpec</em> directly relates to the configurable fields we want to have in our Custom Resource Definition(CRD). I defined variables for configurations required to run locust.</p><ul><li>HostURL: URL of the load tested service</li><li>Image: docker image which contains locust scripts</li><li>Users: Number of users locust should generate</li><li>Workers: Number of workers locust should create</li></ul><p>Generate CRDs and manifests</p><pre>operator-sdk generate k8s; operator-sdk generate crds</pre><p>Add the controller</p><pre>operator-sdk add controller --api-version=locustload.cndev.io/v1alpha1 --kind=Locust</pre><p>Modify the reconcile loop</p><p>All controllers have the Reconcile() function, this is where controller continuously check the state of resources and tries to maintain the desired specification. lets add a new deployment for locust master.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/966d82d2f28e1c7f6d89a96f2db6e08d/href">https://medium.com/media/966d82d2f28e1c7f6d89a96f2db6e08d/href</a></iframe><p>now let’s implement the <em>deploymentForLocustO() </em>function. This handles the creation of a Kubernetes deployment for locust master. Since locust only requires a single master this would not be user-modifiable. Container image and Target host URL is derived from the custom resource definition. Locust port 8089 is exposed together with 5557,5558 for locust workers.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8e7f1237f770f108ee7fc30f312b6be7/href">https://medium.com/media/8e7f1237f770f108ee7fc30f312b6be7/href</a></iframe><p>Now we can build the project if everything is correctly added we would be able to generate a docker image with our changes. The image has to be pushed to a public docker registry so we can use it later.</p><pre>operator-sdk build amilaku/locust-operator:v0.0.1<br>docker push amilaku/locust-operator:v0.0.1</pre><p>then the operator.yaml has to be updated with a new image</p><pre>sed -i &#39;s|REPLACE_IMAGE|amilaku/locust-operator:v0.0.1|g&#39; deploy/operator.yaml</pre><p>then install the dependencies required</p><pre>kubectl create -f deploy/service_account.yaml</pre><pre>kubectl create -f deploy/role.yaml</pre><pre>kubectl create -f deploy/role_binding.yaml</pre><pre>kubectl create -f deploy/operator.yaml</pre><p>install operator and create CRD</p><pre>kubectl create -f deploy/operator.yaml<br>kubectl create -f deploy/crds/locustload.cndev.io_locusts_crd.yaml</pre><p>now create the Custom Resource</p><pre>kubectl create -f deploy/crds/locustload.cndev.io_v1alpha1_locust_cr.yaml</pre><p>output</p><pre>:~$ zk get locusts<br>NAME             AGE<br>example-locust   26d</pre><pre>:~$ zk get pods | grep -i locust<br>example-locust-5c55878467-hvqjl          1/1     Running   7          26d<br>locust-operator-697b767b6b-zwtvl         1/1     Running   7          26d</pre><p><strong>Additional Thoughts</strong>:</p><p>What I have shown so far is just creating a deployment with an operator created using the operator framework. This only completes the requirement to perform a standalone deployment of Locust. Locust Operator which can create distributed deployments with workers is available here <a href="https://github.com/amila-ku/locust-operator">https://github.com/amila-ku/locust-operator</a>. Feel free to try it out and create an Issue/PR.</p><p><strong>Related Articles</strong>: <a href="https://medium.com/devops-srilanka/writing-a-kubernetes-operator-2c7201c6745c">https://medium.com/devops-srilanka/writing-a-kubernetes-operator-2c7201c6745c</a></p><p><strong>More about Operators</strong>: <a href="https://www.youtube.com/watch?v=zT7CHpHy1Oc&amp;t=3684s">https://www.youtube.com/watch?v=zT7CHpHy1Oc&amp;t=3684s</a></p><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15123dd5250a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-srilanka/writing-a-kubernetes-operator-locust-operator-15123dd5250a">Writing a Kubernetes Operator — Locust Operator</a> was originally published in <a href="https://medium.com/devops-srilanka">DevOps SriLanka</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cross Account Application migration with DynamoDB Cross Account Replication]]></title>
            <link>https://faun.pub/cross-account-application-migration-with-dynamodb-cross-account-replication-57d959464e13?source=rss-87bac7cee994------2</link>
            <guid isPermaLink="false">https://medium.com/p/57d959464e13</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[dynamodb]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Amila Kumaranayaka]]></dc:creator>
            <pubDate>Fri, 01 May 2020 20:37:23 GMT</pubDate>
            <atom:updated>2020-05-04T09:53:48.975Z</atom:updated>
            <content:encoded><![CDATA[<p>This article describes a solution used for migrating an application with DynamoDB database from one account to another AWS account. Application migrated is an API. Application was running on AWS EC2 with auto scaling, and used DynamoDB as the database. According to a organization wide initiative to migrate all services in to Kubernetes cluster was created in a new AWS account.<strong>The end goal is to have the application, including all of its components, running in a Kubernetes cluster with the DynamoDB instance in a different AWS account without any service downtime.</strong></p><p>Migration plan was complicated by the requirement to migrate without any downtime, there were lot of articles about doing a DynamoDB migration with a downtime. Also there are multiple tools available to take a backup of DynamoDB table and restore it to another table. But there was not much information on doing a migration without application downtime. But since the application only needed to retain 3 weeks of data backup and restore part was not required at all.</p><p>Existing DynamoDB replication solutions like <a href="https://github.com/mapbox/dynamodb-replicator">dynamodb-replicator</a>, <a href="https://github.com/awslabs/dynamodb-cross-region-library">dynamodb-cross-region-library</a> were evaluated. Since those could not be used for our requirement we came up with multiple solutions and these were evaluated to find out the best option.</p><p>Options considered:</p><ol><li>Writing to DynamoDB tables in both accounts.</li><li>Split read/writes across accounts while cross account replication is being done.</li><li>Only implement cross account replication from old account to new.</li><li>Use multiple application deployments with cross account replication.</li></ol><p>We ended up using the<strong> 4th solution</strong> because it provided a way to migrate without any downtime and not having to meddle with application code a lot. Detailed steps of the selected solution are described below.</p><p><strong>Step 1:</strong></p><p>Deploy a new version of the application which connects to DynamoDB tables from ‘AC-EC2’ account. Make sure to test new deployment and verify there are no issues connecting to database. This requires the application in ‘AC-K8s’ to be able to assume IAM role in ‘AC-EC2’ account. Also to be able to easily switch back to using the tables from ‘AC-EC2’ account, environment variable based feature toggle was introduced.</p><p><em>AC-EC2: AWS account with application running on EC2</em></p><p><em>AC-K8S: AWS account with application running on Kubernetes</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*WwobdBh5dYkE_o2FRp9iyg.png" /><figcaption>1: Application deployed to Kubernetes</figcaption></figure><p><strong>Step 2:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*qyAXq3XZY1rH_BL6mjY_Ig.png" /><figcaption>2: Update R53 to point to new application endpoint</figcaption></figure><p><strong>Step 3:</strong></p><p>Replication of DynamoDB starts here. Since there is no tool for doing cross account replication DynamoDB event and AWS Lambda based solution was implemented to perform cross account replication. This Lambda function utilizes capabilities of DynamoDB streams, so streams must be enabled first in the source table. When setting up configuring DynamoDB streams as the event source for Lambda function, it is important to set ‘BatchSize’ of the event to be 1. This makes sure failures to replicate using lambda will continue from the last failed event in the stream, if a stream was set to a bigger batch size then Lambda function should keep track of events which were failed. But when Lambda function is set to read one event. We can leverage Lambdas default nature to retry event and only continue to process next events in stream when there is no failure. Also this guarantees all events written to DynamoDB stream is replicated to destination and no entries will be missed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*Y8mdOE1007SIsX6yNLMCsQ.png" /><figcaption>3: Start DynamoDB replication</figcaption></figure><p><strong>Step 4:</strong></p><p>New deployment of the application with environment variable set to enable reads from DynamoDB tables in ‘AC-K8s’ account. Replication of data continues and once the new deployment is created, we can create and item using the applications API from ‘AC-EC2’ and immediately read it using the API from ‘AC-K8s’ account. Also it is important to monitor for lambda function errors and IteratorAge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*J_SJ7VL6W5tprjut0Ouy7Q.png" /><figcaption>4: New deployment using DynamoDB tables from K8s account</figcaption></figure><p><strong>Step 5:</strong></p><p>Once we confirmed there are no replication errors and IteratorAge is low, change the R53 dns weights to send all traffic to the application in ‘AC-K8S’ account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*_g-0XF59RWGW077arLn1PA.png" /><figcaption>5: Update R53 to point to new endpoint</figcaption></figure><p>This migration strategy was successfully used to move an application to a new AWS account, while still serving users without service disruption.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and </strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷 <strong>and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook</strong></a><strong> and </strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin</strong></a><strong> Groups </strong>💬<strong>.</strong></p><p><strong>To join our community Slack team chat </strong>🗣️ <strong>read our weekly Faun topics </strong>🗞️,<strong> and connect with the community </strong>📣<strong> click here⬇</strong></p><figure><a href="https://www.faun.dev/join/?utm_source=medium.com%2Ffaun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6P3WpLjGv5v1ucm5dgkucg.png" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57d959464e13" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/cross-account-application-migration-with-dynamodb-cross-account-replication-57d959464e13">Cross Account Application migration with DynamoDB Cross Account Replication</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Writing a Kubernetes Operator]]></title>
            <link>https://medium.com/devops-srilanka/writing-a-kubernetes-operator-2c7201c6745c?source=rss-87bac7cee994------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c7201c6745c</guid>
            <category><![CDATA[kubernetes-operator]]></category>
            <category><![CDATA[k8s]]></category>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Amila Kumaranayaka]]></dc:creator>
            <pubDate>Sun, 06 Oct 2019 21:21:07 GMT</pubDate>
            <atom:updated>2020-05-09T18:58:31.662Z</atom:updated>
            <content:encoded><![CDATA[<h3>Writing a Kubernetes Operator — Generating the base</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*7hJmglcnZMq9z8JC9TLS6Q.png" /></figure><p>Deploying an application generally involves packaging as a container and creating kubernetes manifests for deployment, but even after being deployed someone would have to manage operations of the application. Kubernetes Operator is a way to package deploy and operate an application. Application in Kubernetes is managed using kubernetes api and kubectl, to efficiently manage stateful applications in kubernetes needs a way to extend the functionality of Kubernetes API cohesively. Operators are a runtime that manages these stateful applications by extending API functionality.</p><p>There are multiple options available now to build an Operator, these frameworks can be grouped as below.</p><p><strong>controller-runtime</strong></p><ul><li><a href="https://book.kubebuilder.io/">kubebuilder</a></li><li><a href="https://coreos.com/operators/">operator-sdk</a></li></ul><p><a href="https://metacontroller.app/"><strong>meta-controller</strong></a></p><p><a href="https://github.com/rook/operator-kit"><strong>rook-operatorkit</strong></a></p><p><a href="https://github.com/zalando-incubator/kopf"><strong>kopf</strong></a></p><p><strong>client-go</strong></p><p><a href="https://github.com/kubernetes/sample-controller"><strong>sample-controller</strong></a></p><p><strong>shell-operator</strong></p><p>Out of all these options <strong>shell-operator </strong>is available as an option to execute event driven scripts in a kubernetes cluster. MetaController is a add on that can be installed on kubernetes to make it possible to write controllers as a script. Kopf is a python alternative option to using <em>Go. </em>But all these frameworks are to make controller building easier by hiding the kubernetes api, which is not great if you want to have full control in your controller.</p><p>Sample Controller would be a good option if you know allout about controllers and operators and willing to do all the scaffolding on your own. This would easily end up as very time consuming and lot of head scratching moments.</p><p><em>Kubebuilder and Operator-sdk </em>are based on the controller-runtime. But Operator-sdk also has helm and Ansible based alternative implementation options as well. Since Kubebuilder and and Operator-sdk are the frameworks that provides basic scaffolding for an operator so we can focus more on operator logic without loosing access to kubernetes apis.</p><p>Creating a basic operator scaffolding is easy with both frameworks, First step is to generate the project structure.</p><p><strong>Kubebuilder</strong></p><p>Kubebuilder installation details is available <a href="https://book.kubebuilder.io/quick-start.html#installation">here</a>.</p><p>Generating project</p><pre>kubebuilder init --domain cndev.io</pre><p>domain should be a valid domain name you own</p><p>Add a custom resource api</p><pre>kubebuilder create api --group loadtests --version v1 --kind LocustLoadTest</pre><p>group will be used as custom resource definition versioning along with version number, kind is used to set CRD kind.</p><p>to build and install the operator</p><pre>make install<br>make run</pre><p><strong>OperatorSDK</strong></p><p>installation instructions is available <a href="https://github.com/operator-framework/operator-sdk/blob/master/doc/user/install-operator-sdk.md">here</a>.</p><p>generating a project</p><pre>operator-sdk new podset-operator --type=go --repo=/projects/</pre><p>Add a custom resource</p><pre>operator-sdk add api --api-version=app.example.com/v1alpha1 --kind=PodSet</pre><p>build the operator</p><pre>operator-sdk build quay.io/example/podset-operator</pre><p>So far this was only about how to create the generate operator structure and add new api scaffolding in a project. I will explore more on implementing some functionality using both the frameworks in my next article.</p><p>Reference:</p><p><a href="https://github.com/operator-framework/operator-sdk">https://github.com/operator-framework/operator-sdk</a></p><p><a href="https://github.com/kubernetes-sigs/kubebuilder">https://github.com/kubernetes-sigs/kubebuilder</a></p><p><a href="https://www.youtube.com/watch?v=uf97lOApOv8&amp;list=PLj6h78yzYM2PpmMAnvpvsnR4c27wJePh3&amp;index=205">https://www.youtube.com/watch?v=uf97lOApOv8&amp;list=PLj6h78yzYM2PpmMAnvpvsnR4c27wJePh3&amp;index=205</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c7201c6745c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-srilanka/writing-a-kubernetes-operator-2c7201c6745c">Writing a Kubernetes Operator</a> was originally published in <a href="https://medium.com/devops-srilanka">DevOps SriLanka</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Infrastructure as Proper Code]]></title>
            <link>https://medium.com/devops-srilanka/infrastructure-as-proper-code-4bfaa795a5b9?source=rss-87bac7cee994------2</link>
            <guid isPermaLink="false">https://medium.com/p/4bfaa795a5b9</guid>
            <category><![CDATA[pulumi]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[iac]]></category>
            <dc:creator><![CDATA[Amila Kumaranayaka]]></dc:creator>
            <pubDate>Sun, 03 Mar 2019 17:57:26 GMT</pubDate>
            <atom:updated>2020-05-02T09:01:03.415Z</atom:updated>
            <content:encoded><![CDATA[<h3>Infrastructure as Real Code</h3><p>Infrastructure as Code (IaC) is being widely accepted as the way forward to implement infrastructure. It gives the ability to reuse, version and test infrastructure as with any regular code. This approach made a huge difference in how infrastructure is managed, the ability to troubleshoot and recover/recreate infrastructure, enable better quality testing, improved efficiency, and predictable deployment, lovers the cost for experimentation, more predictable infrastructure deployments and decreases the meantime for resolution. There are a plethora of tools available to properly implement infrastructure as code and most of them are now grown to be well-oiled frameworks for defining infrastructure. These tools can be categorized into two, procedural and declarative. <em>Terraform, CloudFormation, Saltstack,</em> and <em>Puppet</em> being declarative and <em>Ansible</em> and <em>Chef </em>having a procedural approach. Deciding on which one is best for the job is more based on personal preference but Terraform has been very prominent due to its support for multiple clouds, reusability.</p><p>But when thinking about all this points to the question ‘Why do we have to learn yaml based syntax only for implementing Infrastructure as Code?’. And if you started with Cloudformation on AWS and you have to automate your infrastructure in Google Cloud or Azure you would have to learn YAML or JSON based new approach, Terraform would be a good alternative but hcl also has it’s limitations. What if we could define IaC in a regular programming language?.</p><p>Luckily there are several options</p><ul><li><a href="https://pulumi.io/quickstart/">Pulumi</a></li><li><a href="https://github.com/metaparticle-io?language=go">Metaparticle</a></li><li><a href="https://ballerina.io/">Ballerina</a></li></ul><p>In this article, we will go through how to set up an AWS Lambda function using Pulumi.</p><p>Installing</p><pre>curl -fsSL https://get.pulumi.com | sh</pre><p>verify installation</p><pre>pulumi version</pre><p>create new project using template</p><pre>pulumi new hello-aws-javascript — dir lambda-pulumi</pre><p>pulumi also provides a similar feature to ‘terraform plan’ with ‘pulumi preview’ command, let&#39;s create a project using the existing template</p><pre>$ pulumi up<br>warning: A new version of Pulumi is available. To upgrade from version ‘0.16.14’ to ‘0.16.16’, run <br> $ curl -sSL <a href="https://get.pulumi.com/">https://get.pulumi.com</a> | sh<br>or visit <a href="https://pulumi.io/install">https://pulumi.io/install</a> for manual instructions and release notes.<br>Previewing update (dev):</pre><pre>Type Name Plan <br> + pulumi:pulumi:Stack lambda-pulumi-dev create <br> + └─ aws:apigateway:x:API hello create <br> + ├─ aws:iam:Role hello4c238266 create <br> + ├─ aws:s3:Bucket hello create <br> + ├─ aws:iam:Role hello66382ec5 create <br> + ├─ aws:iam:RolePolicyAttachment hello4c238266 create <br> + ├─ aws:s3:BucketObject hello4c238266/index.html create <br> + ├─ aws:s3:BucketObject hello4c238266/favicon.png create <br> + ├─ aws:iam:RolePolicyAttachment hello66382ec5–32be53a2 create <br> + ├─ aws:lambda:Function hello66382ec5 create <br> + ├─ aws:apigateway:RestApi hello create <br> + ├─ aws:apigateway:Deployment hello create <br> + ├─ aws:lambda:Permission hello-f61e7551 create <br> + └─ aws:apigateway:Stage hello create <br> <br>Resources:<br> + 14 to create</pre><pre>Do you want to perform this update? yes<br>Updating (dev):</pre><pre>Type Name Status <br> + pulumi:pulumi:Stack lambda-pulumi-dev created <br> + └─ aws:apigateway:x:API hello created <br> + ├─ aws:iam:Role hello66382ec5 created <br> + ├─ aws:iam:Role hello4c238266 created <br> + ├─ aws:s3:Bucket hello created <br> + ├─ aws:iam:RolePolicyAttachment hello66382ec5–32be53a2 created <br> + ├─ aws:lambda:Function hello66382ec5 created <br> + ├─ aws:iam:RolePolicyAttachment hello4c238266 created <br> + ├─ aws:s3:BucketObject hello4c238266/index.html created <br> + ├─ aws:s3:BucketObject hello4c238266/favicon.png created <br> + ├─ aws:apigateway:RestApi hello created <br> + ├─ aws:apigateway:Deployment hello created <br> + ├─ aws:lambda:Permission hello-f61e7551 created <br> + └─ aws:apigateway:Stage hello created <br> <br>Outputs:<br> url: “<a href="https://t3tfwiiw1d.execute-api.us-east-1.amazonaws.com/stage/">https://t3tfwiiw1d.execute-api.us-east-1.amazonaws.com/stage/</a>”</pre><pre>Resources:<br> + 14 created</pre><pre>Duration: 28s</pre><pre>Permalink: <a href="https://app.pulumi.com/amila-ku/lambda-pulumi/dev/updates/3">https://app.pulumi.com/amila-ku/lambda-pulumi/dev/updates/3</a></pre><p>pulumi has a similar feel to how terraform is used to define and create infrastructure. Also it stores project configuration and outputs centrally in Pulumi Dashboard, this information can be shared among friedns easily with this approach.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g5QH3tccjizT13eOV32yug.png" /></figure><p>destroying the resources is also the same as with terraform and it will ask for confirmation before destroying the resources.</p><pre>$ pulumi destroy<br>warning: A new version of Pulumi is available. To upgrade from version ‘0.16.14’ to ‘0.16.16’, run <br> $ curl -sSL <a href="https://get.pulumi.com/">https://get.pulumi.com</a> | sh<br>or visit <a href="https://pulumi.io/install">https://pulumi.io/install</a> for manual instructions and release notes.<br>Previewing destroy (dev):</pre><pre>Type Name Plan <br> — pulumi:pulumi:Stack lambda-pulumi-dev delete <br> — └─ aws:apigateway:x:API hello delete <br> — ├─ aws:apigateway:Stage hello delete <br> — ├─ aws:lambda:Permission hello-f61e7551 delete <br> — ├─ aws:apigateway:Deployment hello delete <br> — ├─ aws:apigateway:RestApi hello delete <br> — ├─ aws:iam:RolePolicyAttachment hello4c238266 delete <br> — ├─ aws:iam:RolePolicyAttachment hello66382ec5–32be53a2 delete <br> — ├─ aws:s3:BucketObject hello4c238266/index.html delete <br> — ├─ aws:lambda:Function hello66382ec5 delete <br> — ├─ aws:s3:BucketObject hello4c238266/favicon.png delete <br> — ├─ aws:s3:Bucket hello delete <br> — ├─ aws:iam:Role hello4c238266 delete <br> — └─ aws:iam:Role hello66382ec5 delete <br> <br>Resources:<br> — 14 to delete</pre><pre>Do you want to perform this destroy?<br> yes<br>&gt; no<br> details</pre><p>Pulumi seems like a great alternative to using terraform since we can use any programming language tha we are familiar, but i found terraform docs to be far superior and with pulumi it was not as easy. This might change with more time as Pulumi is relatively new.</p><p>Repository: <a href="https://github.com/amila-ku/gke-pulumi">https://github.com/amila-ku/gke-pulumi</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4bfaa795a5b9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-srilanka/infrastructure-as-proper-code-4bfaa795a5b9">Infrastructure as Proper Code</a> was originally published in <a href="https://medium.com/devops-srilanka">DevOps SriLanka</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying multi node kubernetes environment in your local machine.]]></title>
            <link>https://medium.com/devops-srilanka/deploying-multi-node-kubernetes-environment-in-your-local-machine-a66a1eb82e36?source=rss-87bac7cee994------2</link>
            <guid isPermaLink="false">https://medium.com/p/a66a1eb82e36</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Amila Kumaranayaka]]></dc:creator>
            <pubDate>Thu, 23 Nov 2017 03:12:17 GMT</pubDate>
            <atom:updated>2019-07-16T14:25:32.435Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*d55xomi-KOPDL48kn_bF4A.png" /></figure><p>Only way to test out kubernetes locally without having to worry about setup process was using minikube, then ubuntu juju came up with the ability to deploy multi node kubernetes setup in ubuntu based environments. Now there is a new project from Mirantis which gives users the ability to create multi node kubernetes clusters in any os where you can run docker. It would work on local machine and in remote machine as well. This would be useful to understand how kubernetes clusters are created on production environments and for kubernetes development.</p><p>This uses <a href="https://github.com/jpetazzo/dind">DIND </a>(docker in docker) and kubeadm to provision kubernetes, this would not be a good option if your filesystem is ‘btrfs’.</p><p>setup steps are very straight forward and only have to download the provisioning script relevant to the kubernetes version to be configured and run on your host.</p><p>prerequists : docker engine 1.12+ , kubectl</p><p>check docker version</p><pre>:~$ docker version<br>Client:<br> Version:      17.05.0-ce<br> API version:  1.29<br> Go version:   go1.7.5<br> Git commit:   89658be<br> Built:        Thu May  4 22:10:54 2017<br> OS/Arch:      linux/amd64</pre><pre>Server:<br> Version:      17.05.0-ce<br> API version:  1.29 (minimum version 1.12)<br> Go version:   go1.7.5<br> Git commit:   89658be<br> Built:        Thu May  4 22:10:54 2017<br> OS/Arch:      linux/amd64<br> Experimental: false</pre><p>API version has to be higher than 1.12</p><pre>wget <a href="https://cdn.rawgit.com/Mirantis/kubeadm-dind-cluster/master/fixed/dind-cluster-v1.8.sh">https://cdn.rawgit.com/Mirantis/kubeadm-dind-cluster/master/fixed/dind-cluster-v1.8.sh</a></pre><p>then change the permissions</p><pre>chmod 700 dind-cluster-v1.8.sh</pre><p>execute the script to setup cluster</p><pre>./dind-cluster-v1.8.sh up</pre><p>usage options</p><pre>usage:<br>  ./dind-cluster-v1.8.sh up<br>  ./dind-cluster-v1.8.sh reup<br>  ./dind-cluster-v1.8.sh down<br>  ./dind-cluster-v1.8.sh init kubeadm-args...<br>  ./dind-cluster-v1.8.sh join kubeadm-args...<br>  ./dind-cluster-v1.8.sh clean<br>  ./dind-cluster-v1.8.sh e2e [test-name-substring]<br>  ./dind-cluster-v1.8.sh e2e-serial [test-name-substring]<br>  ./dind-cluster-v1.8.sh dump<br>  ./dind-cluster-v1.8.sh dump64<br>  ./dind-cluster-v1.8.sh split-dump<br>  ./dind-cluster-v1.8.sh split-dump64</pre><p>output from cluster configuration</p><pre>* Making sure DIND image is up to date <br>v1.8: Pulling from mirantis/kubeadm-dind-cluster<br>952132ac251a: Pull complete <br>82659f8f1b76: Pull complete <br>c19118ca682d: Pull complete <br>8296858250fe: Pull complete <br>24e0251a0e2c: Pull complete <br>2545d638d973: Pull complete <br>e0b45d7ea196: Pull complete <br>8d7d40f3e602: Pull complete <br>216f5a138844: Pull complete <br>c71de27d6b60: Pull complete <br>352d5aa5dfd1: Pull complete <br>e6b3ec6d10dc: Pull complete <br>d576f0c39d8a: Pull complete <br>93892148e892: Pull complete <br>3a2a24fee2f8: Pull complete <br>36aba2bf4c04: Pull complete <br>677c259304fd: Pull complete <br>37b4174ef952: Pull complete <br>45edc9e8c9c3: Pull complete <br>44be12e55e52: Pull complete <br>9d50bbdbeba1: Pull complete <br>998d505d8f97: Pull complete <br>b100e6b528dd: Pull complete <br>63bbd3b9ddcd: Pull complete <br>Digest: sha256:d70c4acc968fd209969c612ef01ffd6737f7eee63d632162eaed992b97c439b9<br>Status: Downloaded newer image for mirantis/kubeadm-dind-cluster:v1.8<br>/home/ukumaa1/.kubeadm-dind-cluster/kubectl-v1.8.1: OK<br>* Starting DIND container: kube-master<br>* Running kubeadm: init --config /etc/kubeadm.conf --skip-preflight-checks<br>Initializing machine ID from random generator.<br>Synchronizing state of docker.service with SysV init with /lib/systemd/systemd-sysv-install...<br>Executing /lib/systemd/systemd-sysv-install enable docker<br>Loaded image: gcr.io/google_containers/kube-discovery-amd64:1.0<br>Loaded image: gcr.io/google_containers/pause-amd64:3.0<br>Loaded image: gcr.io/google_containers/etcd-amd64:2.2.5<br>Loaded image: mirantis/hypokube:base<br>Loaded image: gcr.io/google_containers/etcd-amd64:3.0.17<br>Loaded image: gcr.io/google_containers/kubedns-amd64:1.7<br>Loaded image: gcr.io/google_containers/exechealthz-amd64:1.1<br>Loaded image: gcr.io/google_containers/kube-dnsmasq-amd64:1.3<br>Loaded image: gcr.io/google_containers/etcd:2.2.1</pre><pre>real 0m13.584s<br>user 0m0.720s<br>sys 0m0.684s<br>Sending build context to Docker daemon   236 MB<br>Step 1 : FROM mirantis/hypokube:base<br> ---&gt; 2d71116d5afc<br>Step 2 : COPY hyperkube /hyperkube<br> ---&gt; d9b0ccd6b34d<br>Removing intermediate container 30997ec5d13e<br>Successfully built d9b0ccd6b34d<br>Created symlink from /etc/systemd/system/multi-user.target.wants/kubelet.service to /lib/systemd/system/kubelet.service.<br>[kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters.<br>[init] Using Kubernetes version: v1.8.4<br>[init] Using Authorization modes: [Node RBAC]<br>[preflight] Skipping pre-flight checks<br>[kubeadm] WARNING: starting in 1.8, tokens expire after 24 hours by default (if you require a non-expiring token use --token-ttl 0)<br>[certificates] Generated ca certificate and key.<br>[certificates] Generated apiserver certificate and key.<br>[certificates] apiserver serving cert is signed for DNS names [kube-master kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 10.192.0.2]<br>[certificates] Generated apiserver-kubelet-client certificate and key.<br>[certificates] Generated sa key and public key.<br>[certificates] Generated front-proxy-ca certificate and key.<br>[certificates] Generated front-proxy-client certificate and key.<br>[certificates] Valid certificates and keys now exist in &quot;/etc/kubernetes/pki&quot;<br>[kubeconfig] Wrote KubeConfig file to disk: &quot;admin.conf&quot;<br>[kubeconfig] Wrote KubeConfig file to disk: &quot;kubelet.conf&quot;<br>[kubeconfig] Wrote KubeConfig file to disk: &quot;controller-manager.conf&quot;<br>[kubeconfig] Wrote KubeConfig file to disk: &quot;scheduler.conf&quot;<br>[controlplane] Wrote Static Pod manifest for component kube-apiserver to &quot;/etc/kubernetes/manifests/kube-apiserver.yaml&quot;<br>[controlplane] Wrote Static Pod manifest for component kube-controller-manager to &quot;/etc/kubernetes/manifests/kube-controller-manager.yaml&quot;<br>[controlplane] Wrote Static Pod manifest for component kube-scheduler to &quot;/etc/kubernetes/manifests/kube-scheduler.yaml&quot;<br>[etcd] Wrote Static Pod manifest for a local etcd instance to &quot;/etc/kubernetes/manifests/etcd.yaml&quot;<br>[init] Waiting for the kubelet to boot up the control plane as Static Pods from directory &quot;/etc/kubernetes/manifests&quot;<br>[init] This often takes around a minute; or longer if the control plane images have to be pulled.<br>[apiclient] All control plane components are healthy after 24.502770 seconds<br>[uploadconfig] Storing the configuration used in ConfigMap &quot;kubeadm-config&quot; in the &quot;kube-system&quot; Namespace<br>[markmaster] Will mark node kube-master as master by adding a label and a taint<br>[markmaster] Master kube-master tainted and labelled with key/value: node-role.kubernetes.io/master=&quot;&quot;<br>[bootstraptoken] Using token: 6507ac.a6b2cfac737576ff<br>[bootstraptoken] Configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials<br>[bootstraptoken] Configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token<br>[bootstraptoken] Configured RBAC rules to allow certificate rotation for all node client certificates in the cluster<br>[bootstraptoken] Creating the &quot;cluster-info&quot; ConfigMap in the &quot;kube-public&quot; namespace<br>[addons] Applied essential addon: kube-dns<br>[addons] Applied essential addon: kube-proxy</pre><pre>Your Kubernetes master has initialized successfully!</pre><pre>To start using your cluster, you need to run (as a regular user):</pre><pre>mkdir -p $HOME/.kube<br>  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config<br>  sudo chown $(id -u):$(id -g) $HOME/.kube/config</pre><pre>You should now deploy a pod network to the cluster.<br>Run &quot;kubectl apply -f [podnetwork].yaml&quot; with one of the options listed at:<br>  <a href="http://kubernetes.io/docs/admin/addons/">http://kubernetes.io/docs/admin/addons/</a></pre><pre>You can now join any number of machines by running the following on each node<br>as root:</pre><pre>kubeadm join --token 6507ac.a6b2cfac737576ff 10.192.0.2:6443 --discovery-token-ca-cert-hash sha256:7d39227ea2e2e58f1e3f11bf3bb99ae960f22c8c76b927450ea0c3d95041adce</pre><pre>real 0m31.304s<br>user 0m3.556s<br>sys 0m0.156s<br>Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply<br>daemonset &quot;kube-proxy&quot; configured<br>No resources found<br>* Setting cluster config <br>Cluster &quot;dind&quot; set.<br>Context &quot;dind&quot; created.<br>Switched to context &quot;dind&quot;.<br>* Starting node container: 1<br>* Starting DIND container: kube-node-1<br>* Node container started: 1<br>* Starting node container: 2<br>* Starting DIND container: kube-node-2<br>* Node container started: 2<br>* Joining node: 1<br>* Running kubeadm: join --skip-preflight-checks --token 6507ac.a6b2cfac737576ff 10.192.0.2:6443 --discovery-token-ca-cert-hash sha256:7d39227ea2e2e58f1e3f11bf3bb99ae960f22c8c76b927450ea0c3d95041adce<br>* Joining node: 2<br>* Running kubeadm: join --skip-preflight-checks --token 6507ac.a6b2cfac737576ff 10.192.0.2:6443 --discovery-token-ca-cert-hash sha256:7d39227ea2e2e58f1e3f11bf3bb99ae960f22c8c76b927450ea0c3d95041adce<br>Initializing machine ID from random generator.<br>Initializing machine ID from random generator.<br>Warning: Stopping docker.service, but it can still be activated by:<br>  docker.socket<br>Synchronizing state of docker.service with SysV init with /lib/systemd/systemd-sysv-install...<br>Executing /lib/systemd/systemd-sysv-install enable docker<br>Synchronizing state of docker.service with SysV init with /lib/systemd/systemd-sysv-install...<br>Executing /lib/systemd/systemd-sysv-install enable docker</pre><pre>real 0m23.338s<br>user 0m0.884s<br>sys 0m0.628s<br>Loaded image: gcr.io/google_containers/kube-discovery-amd64:1.0<br>Loaded image: gcr.io/google_containers/pause-amd64:3.0<br>Loaded image: gcr.io/google_containers/etcd-amd64:2.2.5<br>Loaded image: mirantis/hypokube:base<br>Loaded image: gcr.io/google_containers/etcd-amd64:3.0.17<br>Loaded image: gcr.io/google_containers/kubedns-amd64:1.7<br>Loaded image: gcr.io/google_containers/exechealthz-amd64:1.1<br>Loaded image: gcr.io/google_containers/kube-dnsmasq-amd64:1.3<br>Loaded image: gcr.io/google_containers/etcd:2.2.1<br>Loaded image: gcr.io/google_containers/kube-discovery-amd64:1.0<br>Loaded image: gcr.io/google_containers/pause-amd64:3.0<br>Loaded image: gcr.io/google_containers/etcd-amd64:2.2.5<br>Loaded image: mirantis/hypokube:base<br>Loaded image: gcr.io/google_containers/etcd-amd64:3.0.17<br>Loaded image: gcr.io/google_containers/kubedns-amd64:1.7<br>Loaded image: gcr.io/google_containers/exechealthz-amd64:1.1<br>Loaded image: gcr.io/google_containers/kube-dnsmasq-amd64:1.3<br>Loaded image: gcr.io/google_containers/etcd:2.2.1</pre><pre>real 0m23.416s<br>user 0m0.836s<br>sys 0m0.696s<br>Sending build context to Docker daemon   236 MB<br>Step 1 : FROM mirantis/hypokube:baseon 222.3 MB<br> ---&gt; 2d71116d5afc<br>Step 2 : COPY hyperkube /hyperkube<br>Sending build context to Docker daemon   236 MB<br>Step 1 : FROM mirantis/hypokube:base<br> ---&gt; 2d71116d5afc<br>Step 2 : COPY hyperkube /hyperkube<br> ---&gt; 60938d2b7914<br>Removing intermediate container 48ccfde421ca<br>Successfully built 60938d2b7914<br> ---&gt; 8f66f8a1db37<br>Removing intermediate container 2acf4d950472<br>Successfully built 8f66f8a1db37<br>Created symlink from /etc/systemd/system/multi-user.target.wants/kubelet.service to /lib/systemd/system/kubelet.service.<br>Created symlink from /etc/systemd/system/multi-user.target.wants/kubelet.service to /lib/systemd/system/kubelet.service.<br>[kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters.<br>[preflight] Skipping pre-flight checks<br>[discovery] Trying to connect to API Server &quot;10.192.0.2:6443&quot;<br>[discovery] Created cluster-info discovery client, requesting info from &quot;<a href="https://10.192.0.2:6443/">https://10.192.0.2:6443</a>&quot;<br>[discovery] Requesting info from &quot;<a href="https://10.192.0.2:6443/">https://10.192.0.2:6443</a>&quot; again to validate TLS against the pinned public key<br>[kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters.<br>[preflight] Skipping pre-flight checks<br>[discovery] Trying to connect to API Server &quot;10.192.0.2:6443&quot;<br>[discovery] Created cluster-info discovery client, requesting info from &quot;<a href="https://10.192.0.2:6443/">https://10.192.0.2:6443</a>&quot;<br>[discovery] Requesting info from &quot;<a href="https://10.192.0.2:6443/">https://10.192.0.2:6443</a>&quot; again to validate TLS against the pinned public key<br>[discovery] Cluster info signature and contents are valid and TLS certificate validates against pinned roots, will use API Server &quot;10.192.0.2:6443&quot;<br>[discovery] Successfully established connection with API Server &quot;10.192.0.2:6443&quot;<br>[bootstrap] Detected server version: v1.8.1<br>[bootstrap] The server supports the Certificates API (certificates.k8s.io/v1beta1)<br>[discovery] Cluster info signature and contents are valid and TLS certificate validates against pinned roots, will use API Server &quot;10.192.0.2:6443&quot;<br>[discovery] Successfully established connection with API Server &quot;10.192.0.2:6443&quot;<br>[bootstrap] Detected server version: v1.8.1<br>[bootstrap] The server supports the Certificates API (certificates.k8s.io/v1beta1)</pre><pre>Node join complete:<br>* Certificate signing request sent to master and response<br>  received.<br>* Kubelet informed of new secure connection details.</pre><pre>Run &#39;kubectl get nodes&#39; on the master to see this machine join.</pre><pre>real 0m0.698s<br>user 0m0.348s<br>sys 0m0.060s</pre><pre>Node join complete:<br>* Certificate signing request sent to master and response<br>  received.<br>* Kubelet informed of new secure connection details.</pre><pre>Run &#39;kubectl get nodes&#39; on the master to see this machine join.</pre><pre>real 0m0.713s<br>user 0m0.376s<br>sys 0m0.040s<br>* Node joined: 1<br>* Node joined: 2<br>* Deploying k8s dashboard <br>deployment &quot;kubernetes-dashboard&quot; created<br>service &quot;kubernetes-dashboard&quot; created<br>clusterrolebinding &quot;add-on-cluster-admin&quot; created<br>* Patching kube-dns deployment to make it start faster <br>Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply<br>deployment &quot;kube-dns&quot; configured<br>* Taking snapshot of the cluster <br>deployment &quot;kube-dns&quot; scaled<br>deployment &quot;kubernetes-dashboard&quot; scaled<br>pod &quot;kube-proxy-ddjwk&quot; deleted<br>pod &quot;kube-proxy-s69fx&quot; deleted<br>No resources found.<br>* Waiting for kube-proxy and the nodes <br>.................[done]<br>* Bringing up kube-dns and kubernetes-dashboard <br>deployment &quot;kube-dns&quot; scaled<br>deployment &quot;kubernetes-dashboard&quot; scaled<br>.................................[done]<br>NAME          STATUS    ROLES     AGE       VERSION<br>kube-master   Ready     master    2m        v1.8.1<br>kube-node-1   Ready     &lt;none&gt;    58s       v1.8.1<br>kube-node-2   Ready     &lt;none&gt;    1m        v1.8.1<br>* Access dashboard at: <a href="http://localhost:8080/ui">http://localhost:8080/ui</a></pre><p>check nodes in cluster</p><pre>kubectl get nodes<br>NAME          STATUS    AGE       VERSION<br>kube-master   Ready     6m        v1.8.1<br>kube-node-1   Ready     4m        v1.8.1<br>kube-node-2   Ready     5m        v1.8.1</pre><p>check out the repository in github : <a href="https://github.com/Mirantis/kubeadm-dind-cluster">https://github.com/Mirantis/kubeadm-dind-cluster</a></p><p>installation instructions for kubectl : <a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/">https://kubernetes.io/docs/tasks/tools/install-kubectl/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*eGWyevHKfs7mgrR0" /></figure><p><strong>Join our community Slack and read our weekly Faun topics ⬇</strong></p><p><a href="https://www.faun.dev/join/?utm_source=medium.com%2Ffaun&amp;utm_medium=medium&amp;utm_campaign=faunmedium">Join a Community of Aspiring Developers.Get must-read articles, learn new technologies for free, chat with like-minded people, get job offers, listen to podcasts and more</a></p><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a66a1eb82e36" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devops-srilanka/deploying-multi-node-kubernetes-environment-in-your-local-machine-a66a1eb82e36">Deploying multi node kubernetes environment in your local machine.</a> was originally published in <a href="https://medium.com/devops-srilanka">DevOps SriLanka</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>