<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kubernetes archivos - Geko Cloud</title>
	<atom:link href="https://geko.cloud/en/tag/kubernetes-en/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>Servicios de consultoría cloud y devops</description>
	<lastBuildDate>Wed, 15 Dec 2021 09:23:30 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.7</generator>

<image>
	<url>https://geko.cloud/wp-content/uploads/2021/08/cropped-geko-fav-150x150.png</url>
	<title>Kubernetes archivos - Geko Cloud</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Kubernetes vs Docker, find out how they are different</title>
		<link>https://geko.cloud/en/kubernetes-vs-docker-find-out-how-they-are-different/</link>
					<comments>https://geko.cloud/en/kubernetes-vs-docker-find-out-how-they-are-different/#respond</comments>
		
		<dc:creator><![CDATA[Xènia Adan]]></dc:creator>
		<pubDate>Wed, 08 Dec 2021 14:53:31 +0000</pubDate>
				<category><![CDATA[Marketing]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Kubernetes]]></category>
		<guid isPermaLink="false">https://geko.cloud/?p=6576</guid>

					<description><![CDATA[<p>For DevOps engineers, keeping up to date with all the tools surrounding new technologies is more important than ever. Two essential tools today are Kubernetes and Docker, both of which may seem the same at first glance, both allow you to do similar things like running containers, however both work on different layers of the [&#8230;]</p>
<p>La entrada <a href="https://geko.cloud/en/kubernetes-vs-docker-find-out-how-they-are-different/">Kubernetes vs Docker, find out how they are different</a> se publicó primero en <a href="https://geko.cloud/en/">Geko Cloud</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><span style="font-weight: 2000;">For DevOps engineers, keeping up to date with all the tools surrounding new technologies is more important than ever. Two essential tools today are <strong>Kubernetes</strong> and <strong>Docker</strong>, both of which may seem the same at first glance, both allow you to do similar things like running containers, however both work on different layers of the Cloud infrastructure. In this blog post, we will try to clarify both terms.</span></p>
<h2><b>What is a container?</b></h2>
<p><span style="font-weight: 2000;">Let&#8217;s start with a brief definition of what exactly a container is. Containers are a form of operating system virtualisation. A single container can be used to run anything from a small microservice or software process to a larger application.</span></p>
<p><span style="font-weight: 2000;">A container is like a compact box that contains all the dependencies of an application in one place. This not only allows an application to run quickly on a system, but also makes it portable, easy to transfer from one environment to another.</span></p>
<p><span style="font-weight: 2000;">Unlike virtual machines, containers only provide virtualization for the operating system layer and necessary dependencies, making them lighter and more portable, with a significantly lower system load. They can be easily transferred from one environment to another and operate consistently at all times by containing everything necessary for the application to function.</span></p>
<h2><b>What is Docker?</b></h2>
<p><span style="font-weight: 2000;"><strong>Docker</strong> is an open source containerisation platform launched by Docker Inc. in 2013, i.e. <strong>Docker</strong> is a technology used to create and run software containers. In essence <strong>Docker</strong> is a system that allows to build, transfer, deploy and run containers with the applications inside in a very simple and reliable way, guaranteeing a scalable deployment in an efficient way regardless of the host operating system.</span></p>
<p><span style="font-weight: 2000;"><strong>Docker</strong> streamlines the creation of containers with tools such as dockerfiles, and streamlines the code-like definition of containerised applications through docker-compose. These tools are used to create a development lifecycle, from defining what goes inside a container, to establishing its environment and access to resources. </span><span style="font-weight: 2000;">It also helps developers move workloads from their local environment, to testing to production, eliminating inconsistencies and dependencies between environments. As the container being deployed will be the same as the one in which it was developed, the environment will have the same predictable outcome.</span></p>
<p><img fetchpriority="high" decoding="async" class="wp-image-6718 aligncenter" src="https://geko.cloud/wp-content/uploads/2021/12/Docker-infraestructura.png" alt="Docker infraestructura" width="546" height="329" srcset="https://geko.cloud/wp-content/uploads/2021/12/Docker-infraestructura.png 827w, https://geko.cloud/wp-content/uploads/2021/12/Docker-infraestructura-300x181.png 300w, https://geko.cloud/wp-content/uploads/2021/12/Docker-infraestructura-768x462.png 768w" sizes="(max-width: 546px) 100vw, 546px" /></p>
<h2><b>What is Kubernetes?</b></h2>
<p><span style="font-weight: 2000;"><strong>Kubernetes</strong> (also known as <strong>k8s</strong>) is a container platform orchestrator, like <strong>Docker</strong>. To be more precise, Kubernetes is a set of open source tools for building a scalable, fault-tolerant platform designed to automate and centrally manage containerised applications. Learn more in detail about this tool in our post <a href="https://geko.cloud/en/what-is-kubernetes/">What is Kubernetes?</a> <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f448.png" alt="👈" class="wp-smiley" style="height: 1em; max-height: 1em;" /></span></p>
<h2><b>So how are Docker and Kubernetes similar or different?</b></h2>
<p><span style="font-weight: 2000;">As we can understand from the above, <strong>Docker</strong> and <strong>Kubernetes</strong> are related technologies, but they cannot be directly compared with each other. In fact, the two tools complement each other and help build cloud-native or microservices architectures. In other words, <strong>Kubernetes</strong> builds on top of <strong>Docker</strong>, using it as an engine to run containers, but it takes care of exactly how these containers are run: configuration, replication, access to system resources, or network communication. It takes care of generating these configurations and communicating them to <strong>Docker</strong> so that it can apply them. </span></p>
<p><span style="font-weight: 2000;">What is the difference between <strong>Docker</strong> and <strong>Kubernetes</strong>? <strong>Kubernetes</strong> is meant to run on a cluster, whereas <strong>Docker</strong> runs on a single node by default, with no replication management or container health maintenance, just running a container as declared. So the fundamental difference between <strong>Docker</strong> and <strong>Kubernetes</strong> is that <strong>Docker</strong> is a containerisation platform, meaning that it handles container creation, whereas <strong>Kubernetes</strong> is a container orchestration platform.</span></p>
<p><span style="font-weight: 2000;">Therefore, the comparison between <strong>Kubernetes</strong> and <strong>Docker</strong> is not as simple as creating a list of pros and cons or feature by feature. However, there is a <strong>Kubernetes</strong>-like orchestration technology developed by Docker Inc. called <strong>Docker Swarm</strong>, which provides us with <strong>Kubernetes</strong>-like elements such as replication management or load balancing between containers.</span></p>
<h2><b>Conclusion</b></h2>
<p><span style="font-weight: 2000;">In summary, <strong>Docker</strong> provides an open standard for packaging and distributing containerised applications and is sufficient to address simple use cases and <strong>Kubernetes</strong> leverages a broad ecosystem of tools along with continuous integration/continuous deployment (CI/CD) and other DevOps practices to orchestrate large sets of containers from development to production environments.</span></p>
<p>At Geko Cloud we are at your disposal if you are looking for a partner to implement <a href="https://geko.cloud/en/cloud-services/kubernetes/">Kubernetes</a> or <a href="https://geko.cloud/en/cloud-services/microservices-architecture-docker/">Docker</a>, <a href="https://geko.cloud/en/cloud-services/cloud-migration/">migrate to the cloud</a>, move to a <a href="https://geko.cloud/en/cloud-services/microservices-architecture-docker/">microservices</a> model, or <a href="https://geko.cloud/en/cloud-services/cloud-management/">manage your platform in the cloud</a>. <a href="https://geko.cloud/en/contact/">Contact us</a> to find out more about <a href="https://geko.cloud/en/cloud-services/">our services</a>.</p>
<p>La entrada <a href="https://geko.cloud/en/kubernetes-vs-docker-find-out-how-they-are-different/">Kubernetes vs Docker, find out how they are different</a> se publicó primero en <a href="https://geko.cloud/en/">Geko Cloud</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://geko.cloud/en/kubernetes-vs-docker-find-out-how-they-are-different/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Firsts steps with ArgoCD</title>
		<link>https://geko.cloud/en/firsts-steps-with-argocd/</link>
					<comments>https://geko.cloud/en/firsts-steps-with-argocd/#respond</comments>
		
		<dc:creator><![CDATA[Xènia Adan]]></dc:creator>
		<pubDate>Fri, 03 Dec 2021 13:21:29 +0000</pubDate>
				<category><![CDATA[Featured LABS]]></category>
		<category><![CDATA[Labs]]></category>
		<category><![CDATA[ArgoCD]]></category>
		<category><![CDATA[cicd]]></category>
		<category><![CDATA[Kubernetes]]></category>
		<guid isPermaLink="false">https://geko.cloud/?p=6557</guid>

					<description><![CDATA[<p>Introduction In this article we will talk about one of the hot tools in the topic of continuous integration and deployment processes &#8220;CICD&#8221; in Kubernetes, ArgoCD. In recent months, many leading companies in the Internet sector have publicly declared the use of ArgoCD to deploy applications in their clusters. You can see a list here. [&#8230;]</p>
<p>La entrada <a href="https://geko.cloud/en/firsts-steps-with-argocd/">Firsts steps with ArgoCD</a> se publicó primero en <a href="https://geko.cloud/en/">Geko Cloud</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In this article we will talk about one of the hot tools in the topic of continuous integration and deployment processes &#8220;<a href="https://www.redhat.com/en/topics/devops/what-is-ci-cd">CICD</a>&#8221; in Kubernetes, <a href="https://argo-cd.readthedocs.io">ArgoCD</a>. In recent months, many leading companies in the Internet sector have publicly declared the use of ArgoCD to deploy applications in their clusters. <a href="https://github.com/argoproj/argo-cd/blob/master/USERS.md">You can see a list here.</a></p>
<p>To begin with, let&#8217;s review what ArgoCD is for and how far ArgoCD&#8217;s functionalities go. Then, we will see a typical use case of application deployment using ArgoCD and the advantages of its implementation. Finally, we will comment on the conclusions we have drawn in terms of pros and cons, and we will analyze what other tools complement ArgoCD to further optimize the process of integration and continuous deployment of applications.</p>
<h2>What is ArgoCD?</h2>
<p>ArgoCD is a tool that allows us adopt <a href="https://www.redhat.com/en/topics/devops/what-is-gitops">GitOps</a> methodologies for continuous deployment of applications in Kubernetes clusters.</p>
<p>The main feature is that ArgoCD synchronizes the state of the deployed applications with their respective manifests declared in git. This allows developers to deploy new versions of the application by simply modifying the git content, either with commits to development branches or by modifying main branch.<br />
Once the code has been modified in git, ArgoCD detects, via webhook or periodic checks every few minutes, that there have been changes in the application manifests. It then compares the manifests declared in git with those applied in the clusters and updates the latter until they are synchronised.</p>
<p>Its user-friendly user interface allows us to visualize very well the content, structure and state of the clusters as well as manipulate resources.</p>
<p>Can ArgoCD automate the entire CI/CD process of an application?</p>
<p>No, ArgoCD takes care of deploying the application once the artifact already exists in a container registry, such as Dockerhub or ECR. This implies that previously the application code has already been tested and containerised in an image. At the end of this article we will talk about what options currently exist to accomplish this previous task in an automated gitops way.</p>
<p>As we have already explained, ArgoCD synchronizes the state of deployed applications with their respective manifests declared in git. But it does not refer to the git repository of the application code itself, but to a separate repository, as best practices suggest, that contains the application&#8217;s kubernetes infrastructure code, which can be in the form of <a href="https://github.com/argoproj/argo-cd/blob/master/USERS.md">helm charts, kustomize application, ksonnet&#8230;</a></p>
<p>To better explain the main benefits offered by ArgoCD let&#8217;s see an use case example.</p>
<h2>Using ArgoCD</h2>
<p>In this example we will see how ArgoCD can deploy either applications developed by third parties, which have their own helm chart maintained by another organization, or one of our own where we have defined the chart ourselves.</p>
<p>For the example we will deploy a monitoring stack consisting of Prometheus, Grafana and Thanos using their helm charts.</p>
<p>ArgoCD deploys the applications through a custom object called <a href="https://argo-cd.readthedocs.io/en/stable/operator-manual/declarative-setup/#applications">Application</a>. This object has as attributes a source and a destination. The source can read several formats, in this exaple our application object will read and deploy helm charts from a chart repository, and charts from a git repository. The destination is the cluster to which the content of the source will be deployed. In the application configuration we can enable that ArgoCD automatically keeps the state of the deployed kubernetes objects synchronized with the configuration indicated in the source (charts/git). This option is very interesting because it ensures that ArgoCD is going to be aware every few minutes that everything is still in sync, by contrast, deploying applications directly with helm commands only ensure synchronization at the time of deployment.</p>
<p>Now that we have explained what the Application object is, for our monitoring-stack, we are going to create four. Why four applications if there will only be 3 services in the stack? (Prometheus, Grafana and Thanos).</p>
<p>ArgoCD also offers the possibility of creating groups of applications that follow the &#8220;<a href="https://argo-cd.readthedocs.io/en/stable/operator-manual/cluster-bootstrapping/#app-of-apps-pattern">app of apps pattern</a>&#8221; concept. This is an ArgoCD application that deploys other applications and so on recursively. In the case of our monitoring stack, we are going to create a fourth application that will deploy the other 3 applications, the parent application will be called &#8220;monitoring-stack&#8221;.</p>
<p>To create an application we can define an ArgoCD Application manifest, as indicated in <a href="https://argo-cd.readthedocs.io/en/stable/operator-manual/cluster-bootstrapping/#app-of-apps-pattern">this page</a> of the documentation. We can also do it by <a href="https://argo-cd.readthedocs.io/en/stable/getting_started/#creating-apps-via-cli">command line</a>. But ArgoCD has a great UI that allows you to create applications manually as well, you can see how <a href="https://argo-cd.readthedocs.io/en/stable/getting_started/#creating-apps-via-ui">here</a>.</p>
<p>The &#8220;monitoring-stack&#8221; application will point its source to a git repository with a Helm chart. This chart will contain the manifests of the other three applications in the &#8220;templates&#8221; directory in yaml format. These files are <a href="https://argo-cd.readthedocs.io/en/stable/operator-manual/declarative-setup/#applications">Application</a> object definitions that point to the relevant official Helm chart of each service. Using the &#8220;values files&#8221;, we will be able to deploy different versions in different environments.</p>
<figure id="attachment_5055" aria-describedby="caption-attachment-5055" style="width: 300px" class="wp-caption aligncenter"><img decoding="async" class="wp-image-5055 size-medium" src="https://geko.cloud/wp-content/uploads/2021/10/Screenshot-2021-10-29-at-13.39.28-300x248.png" alt="" width="300" height="248" srcset="https://geko.cloud/wp-content/uploads/2021/10/Screenshot-2021-10-29-at-13.39.28-300x248.png 300w, https://geko.cloud/wp-content/uploads/2021/10/Screenshot-2021-10-29-at-13.39.28.png 350w" sizes="(max-width: 300px) 100vw, 300px" /><figcaption id="caption-attachment-5055" class="wp-caption-text">Git repository containing monitoring-stack Helm chart. It consists of 3 applications defined in the directory monitoring-stack/templates/</figcaption></figure>
<p>Once the templates of the &#8220;monitoring-stack&#8221; chart have been defined, we will create the parent ArgoCD Application, and in source we will point to the previously mentioned repository. ArgoCD will detect that it is a helm chart and we can indicate the path of the specific values file, for example &#8220;prod_values.yaml&#8221;.</p>
<p>At the end of the manual configuration of the application, in the user interface we will see how all the created objects are represented, organized in a hierarchical way.</p>
<figure id="attachment_5057" aria-describedby="caption-attachment-5057" style="width: 742px" class="wp-caption aligncenter"><img decoding="async" class="wp-image-5057 size-full" src="https://geko.cloud/wp-content/uploads/2021/10/Screenshot-2021-10-29-at-12.35.05.png" alt="" width="742" height="343" srcset="https://geko.cloud/wp-content/uploads/2021/10/Screenshot-2021-10-29-at-12.35.05.png 742w, https://geko.cloud/wp-content/uploads/2021/10/Screenshot-2021-10-29-at-12.35.05-300x139.png 300w" sizes="(max-width: 742px) 100vw, 742px" /><figcaption id="caption-attachment-5057" class="wp-caption-text">The monitoring-stack application creates the three applications defined in the templates directory of the chart.</figcaption></figure>
<figure id="attachment_5065" aria-describedby="caption-attachment-5065" style="width: 800px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-5065 size-large" src="https://geko.cloud/wp-content/uploads/2021/10/Screenshot-2021-10-29-at-14.40.16-1024x476.png" alt="" width="800" height="372" srcset="https://geko.cloud/wp-content/uploads/2021/10/Screenshot-2021-10-29-at-14.40.16-1024x476.png 1024w, https://geko.cloud/wp-content/uploads/2021/10/Screenshot-2021-10-29-at-14.40.16-300x139.png 300w, https://geko.cloud/wp-content/uploads/2021/10/Screenshot-2021-10-29-at-14.40.16-768x357.png 768w, https://geko.cloud/wp-content/uploads/2021/10/Screenshot-2021-10-29-at-14.40.16-1536x714.png 1536w, https://geko.cloud/wp-content/uploads/2021/10/Screenshot-2021-10-29-at-14.40.16.png 1585w" sizes="(max-width: 800px) 100vw, 800px" /><figcaption id="caption-attachment-5065" class="wp-caption-text">The grafana application has deployed it&#8217;s official helm chart, through the UI we can see all the resources in operation. It also allows us to interact with them, for example we can delete a pod and see how the deployment automatically creates another one.</figcaption></figure>
<p>Since the applications are synchronized with our repository, and the charts are parameterized with templates and values. To deploy a new version of any of our applications we will only have to modify the values file through git commits.<br />
ArgoCD will detect the changes in the repository and apply them in the kubernetes cluster through a rolling update deployment.</p>
<figure id="attachment_5067" aria-describedby="caption-attachment-5067" style="width: 292px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-5067 size-full" src="https://geko.cloud/wp-content/uploads/2021/10/Screenshot-2021-10-29-at-14.54.37.png" alt="" width="292" height="170" /><figcaption id="caption-attachment-5067" class="wp-caption-text">chart versions defined in the file prod_values.yaml</figcaption></figure>
<p>As a note, using <a href="https://github.com/argoproj-labs/argocd-image-updater">ArgoCD Image Updater</a> can save us from doing this last step manually, or even having to develop a complex pipeline to update the values.yaml file in git when we want to deploy the new image.<br />
This tool periodically queries the latest tags in our image repository looking for new artifacts to deploy. This way, once it has found a new one, it takes care of automating the deployment process by editing the git configuration with the name of the new tag.<br />
It is worth mentioning that there is not yet a stable version of ArgoCD Image Updater but it is expected soon.</p>
<p>In this example we have created an application that points to a repository that creates applications which point to official helm charts, but this hierarchical loop can be extended much further, following the &#8220;app of apps pattern&#8221;.</p>
<p>Another interesting feature of ArgoCD is that it allows us to deploy applications in different clusters. There are several ways to do this, but the most direct way is through the Application Set resource.<br />
In its manifest we can specify a list of clusters where to deploy simultaneously with different paths of the repository. Since in our repository we can specify different versions for each cluster.</p>
<p>The relative ease of installation that ArgoCD has is another positive point to take into account, here you can consult the <a href="https://github.com/argoproj-labs/argocd-image-updater">steps</a>.</p>
<h2>Automation of the entire CICD process with Argo tools</h2>
<p>If we want to go a step further and automate the entire CICD process in Kubernetes, we can complement ArgoCD with the rest of the tools presented by the <a href="https://argoproj.github.io/">Argo project</a>.<br />
By combining Argo Events, Argo Workflows, ArgoCD and Argo Rollouts, further automation is possible following best practices in the current continuous integration standards.<br />
Victor Farcic explains it very coherently in this <a href="https://www.youtube.com/watch?v=XNXJtxkUKeY&amp;t=277s&amp;ab_channel=DevOpsToolkit">video</a>.</p>
<p>As a solution to the added complexity of installing and managing all these Argo project tools, some applications that encompass this entire stack have already been released allowing us to configure the pipelines for integration and deployment from a simplified higher level layer. Below we mention a couple of them, although in this post we are not going to analyze the particular functionalities.</p>
<p><a href="https://devtron.ai/">Devtron</a> is an open source tool that installs underneath this Argo stack and other tools and promises that it will let us automate the entire CICD process completely from the user interface. Devtron simplifies the configuration quite a lot as we interact with the internal tools from a high level layer, without manually installing any of them. Although after testing it, we do not believe that the tool is mature enough to be implemented in a production environment for the time being.</p>
<p>Similar to Devtron&#8217;s approach, <a href="https://devtron.ai/">Codefresh</a> also uses all of the Argo stack to automate all integration and deployment. But apart from the fact that the tool is still in early-access, a big difference is that access will be in SaaS format. As we can see in the pricing section, the full automation option will be paid and the price is not mentioned on the website.</p>
<h2>Conclusions</h2>
<p>ArgoCD is a very useful tool to automate the deployment process using GitOps best practices. Thanks to its implementation, developers can test new versions of applications more quickly and deploy to production safely once testing is complete. In addition, thanks to the auto-sync feature and its beautiful interface, ArgoCD allows us to keep track of the status of applications and their resources deployed in Kubernetes at all times. Combined with the other tools of the Argo project we can automate the entire CICD process (and many other utilities outside the scope of this post) following good practices for current standards.</p>
<p>On the downside, using ArgoCD will introduce an extra layer of complexity to our configuration, as it has many different options, introduces custom objects and concepts we are not familiar with yet. It can be &#8220;overkill&#8221; if we have a very small cluster with only a handful of applications.</p>
<p>La entrada <a href="https://geko.cloud/en/firsts-steps-with-argocd/">Firsts steps with ArgoCD</a> se publicó primero en <a href="https://geko.cloud/en/">Geko Cloud</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://geko.cloud/en/firsts-steps-with-argocd/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is Kubernetes?</title>
		<link>https://geko.cloud/en/what-is-kubernetes/</link>
					<comments>https://geko.cloud/en/what-is-kubernetes/#respond</comments>
		
		<dc:creator><![CDATA[Jose Luis Sánchez]]></dc:creator>
		<pubDate>Fri, 30 Jul 2021 09:22:33 +0000</pubDate>
				<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Featured post]]></category>
		<category><![CDATA[Kubernetes]]></category>
		<guid isPermaLink="false">https://geko2.factoryfy.com/what-is-kubernetes/</guid>

					<description><![CDATA[<p>What is container orchestration? Before we dive into Kubernetes, first of all, you need to know what container orchestration is. Container technologies have radically changed the landscape of systems and the way software is packaged and deployed. Some of the benefits that containers bring are portability, agility, speed, immutability, and fault isolation. A container orchestrator [&#8230;]</p>
<p>La entrada <a href="https://geko.cloud/en/what-is-kubernetes/">What is Kubernetes?</a> se publicó primero en <a href="https://geko.cloud/en/">Geko Cloud</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><strong><span style="font-size: 25px;">What is container orchestration?</span></strong></h2>
<p><span style="font-size: 18px;">Before we dive into <b>Kubernetes</b>, first of all, you need to know what <b>container orchestration</b> is. <b>Container</b> technologies have radically changed the landscape of systems and the way software is packaged and deployed. Some of the benefits that <b>containers</b> bring are portability, agility, speed, immutability, and fault isolation.</span></p>
<p><span style="font-size: 18px;">A <b>container orchestrator</b> is a software that manages and coordinates <b>containers</b> in an automated way. There are several <b>container orchestration</b> tools such as Docker Swarm, Google Container Engine, Amazon ECS, and others. However, in this post, we will focus on <b>Kubernetes</b>, where we will explain the concept, most notable components of the tool and discuss the benefits that <b>Kubernetes</b> can offer, among other points.</span></p>
<h2><strong><span style="font-size: 25px;">Definition &#8211; What is Kubernetes?</span></strong></h2>
<p><span style="font-size: 18px;">Originally developed by Google, <b>Kubernetes</b>, or <b>k8s</b> for short, is a <b>container orchestration</b> tool. <b>Kubernetes</b> facilitates the deployment and operation of applications in a <b>microservices</b> architecture. It does this by creating an abstraction layer on top of a cluster of hosts, so development teams can deploy their applications and let <b>Kubernetes</b> manage the deployment of <b>containers</b>.</span></p>
<p><iframe loading="lazy" title="What is Kubernetes?" width="800" height="450" src="https://www.youtube.com/embed/cC46cg5FFAM?start=23&#038;feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></p>
<h2><strong><span style="font-size: 25px;">Platforms that offer Kubernetes</span></strong></h2>
<p><span style="font-size: 18px;">There are several <a href="https://geko.cloud/en/what-is-the-cloud/"><b>cloud</b></a> platforms that offer <b>Kubernetes</b> as a service. These platforms make the job easier by providing an interface that makes it easy to deploy applications on <b>Kubernetes</b> without having to worry about configuring and managing the various components of the cluster. Some of them are Amazon EKS, Digitalocean, OpenShift, or Rancher, among others.</span></p>
<h2><strong><span style="font-size: 25px;">Some Kubernetes cluster elements</span></strong></h2>
<p><span style="font-size: 18px;"><b>Kubernetes</b> has a number of features that allow you to provision and deploy your own <b>containerized</b> software. If you&#8217;re new to <b>Kubernetes</b>, the terminology can be new, and require some extra learning. Here are some of the basics:</span></p>
<ul>
<li><span style="font-size: 18px;"><b><u>Pods</u></b>: <span style="font-weight: 400;"> The minimum unit that can be deployed with <b>Kubernetes</b>. Each pod can contain one to several <b>containers</b> running on the same shared storage/network resources as the pod.</span></span></li>
<li><span style="font-size: 18px;"><b><u>Nodes</u></b>: <span style="font-weight: 400;">A physical or virtual machine that hosts the pods that perform the workload of an application. </span></span></li>
<li><span style="font-size: 18px;"><b><u>Control plane</u></b>: <span style="font-weight: 400;">The control plane runs the <b>Kubernetes</b> components that provide the core functionalities: exposing the <b>Kubernetes</b> API, scheduling workload deployments, managing the cluster, and direct communications throughout the system. </span></span></li>
<li><span style="font-size: 18px;"><b><u>Cluster</u></b>: <span style="font-weight: 400;">A group of nodes working together, which run <b>containerized</b> applications. Clusters consist of master and worker nodes. There can be one or more master nodes and zero or more worker nodes. For example, you can have several nodes in the same cluster running the same <b>containers</b>.  </span></span></li>
<li><span style="font-size: 18px;"><b><u>Deployment</u></b>:<span style="font-weight: 400;"> <b>Kubernetes</b> deployments define the scale at which you want to run your application by allowing you to set the details of how you want pods to be replicated across <b>Kubernetes</b> nodes. Deployments describe the number of identical pod replicas you want to run and the preferred update strategy for updating the deployment, among other things. <b>Kubernetes</b> will track the health of the pods, and remove or add pods as needed to bring the application deployment to the desired state. The deployment provides an abstraction layer that allows pods to be replaced easily and transparently. Pods in a deployment can be located on different nodes.</span></span></li>
<li><span style="font-size: 18px;"><b><u>Service</u></b>: <span style="font-weight: 400;">A set of pods running the same application or <b>microservice</b> can be grouped together to form a deployment, as we have already seen. Since these pods can be replaced and, due to the dynamic nature of <b>Kubernetes</b>, the different IP addresses of the pods will change, there is a need for a network resource to establish an entry point to these pods. A service abstracts away the underlying network complexity, making it possible to provide a single, unchanging entry point while making the layout of the pods that make up the deployment transparent.</span></span></li>
<li><span style="font-size: 18px;"><b><u>Ingress controller</u></b>:<span style="font-weight: 400;"> It is software that provides reverse proxy functionality, configurable traffic routing, and TLS termination for <b>Kubernetes</b> services. A gateway driver is installed on the cluster, and then gateway rules are configured for a specific service or services.</span></span></li>
<li><span style="font-size: 18px;"><b><u>Kubectl</u></b>:<span style="font-weight: 400;"> a command-line interface that sends a request to the <b>Kubernetes</b> API, either with specific commands, with the contents of a YAML manifest, or with data fetch requests.</span></span></li>
<li><span style="font-size: 18px;"><b><u>Kubelet</u></b>: <span style="font-weight: 400;">is a service running inside each node, which communicates with the control plane.</span></span></li>
</ul>
<p><span style="font-size: 18px;">There are other <b>Kubernetes</b> components such as daemonsets, namespaces, replicaSets, secrets, and even custom resources. The ones mentioned here are the ones you are most likely to interact with when deploying applications on <b>Kubernetes</b>.</span></p>
<h2><strong><span style="font-size: 25px;">Learn more about when and how to use Kubernetes  </span></strong></h2>
<p><span style="font-size: 18px;">Do you want to know more about <b>k8s</b>? In our Youtube channel, we explain you from a business perspective, what needs it covers, its advantages, and when to use it. <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f447.png" alt="👇" class="wp-smiley" style="height: 1em; max-height: 1em;" /></span></p>
<p><iframe loading="lazy" title="YouTube video player" src="https://www.youtube.com/embed/RpUNIZoCl7g" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>
<h2><strong><span style="font-size: 25px;">Geko and Kubernetes &#8211; Why choose Geko Cloud?</span></strong></h2>
<p><span style="font-size: 18px;">If you are using or considering using <b>containers</b> to streamline building, scaling, and deploying your <a href="https://geko.cloud/en/cloud-services/microservices-architecture-docker/"><b>microservices</b></a>-based application, <b>Kubernetes</b> gives you the ability to manage the infrastructure using declarative YAML files.</span></p>
<p><span style="font-size: 18px;"><b>Container</b> lifecycle management with <b>Kubernetes</b> using your deployments and operators along with a <a href="https://geko.cloud/en/devops/"><b>DevOps</b></a> approach allows software development and IT operations to adapt to support the <b>CI/CD</b> channel. At <b>Geko Cloud</b> we are at your disposal if you are looking for a partner to implement <b>Kubernetes</b>, <a href="https://geko.cloud/en/cloud-services/migration/"><b>migrate to the cloud</b></a>, move to a <a href="https://geko.cloud/en/cloud-services/microservices-architecture-docker/"><b>microservices</b></a> model or manage your platform in the <b>cloud</b>. <a href="https://geko.cloud/en/contact/">Contact us</a> to find out more about our <a href="https://geko.cloud/en/cloud-services/">services</a>.</span></p>
<p>La entrada <a href="https://geko.cloud/en/what-is-kubernetes/">What is Kubernetes?</a> se publicó primero en <a href="https://geko.cloud/en/">Geko Cloud</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://geko.cloud/en/what-is-kubernetes/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Harbor: Private docker registry in Kubernetes</title>
		<link>https://geko.cloud/en/harbor-private-registry-kubernetes/</link>
					<comments>https://geko.cloud/en/harbor-private-registry-kubernetes/#respond</comments>
		
		<dc:creator><![CDATA[Xavi Miranda]]></dc:creator>
		<pubDate>Tue, 18 May 2021 06:53:34 +0000</pubDate>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Harbor]]></category>
		<category><![CDATA[Kubernetes]]></category>
		<guid isPermaLink="false">https://geko2.factoryfy.com/harbor-private-docker-registry-in-kubernetes/</guid>

					<description><![CDATA[<p>Kubernetes is a container orchestrator and therefore you need somewhere to store your container images for Kubernetes to pull them. There&#8217;s a wide variety of managed and unmanaged solutions to choose from this matter: cloud registry, dockerhub, private registry on a vm&#8230; or a private registry in Kubernetes. Today we are going to cover the [&#8230;]</p>
<p>La entrada <a href="https://geko.cloud/en/harbor-private-registry-kubernetes/">Harbor: Private docker registry in Kubernetes</a> se publicó primero en <a href="https://geko.cloud/en/">Geko Cloud</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://geko.cloud/en/what-is-kubernetes/">Kubernetes</a> is a <strong>container orchestrator</strong> and therefore you need somewhere to <strong>store your container images</strong> for Kubernetes to pull them. There&#8217;s a wide variety of managed and unmanaged solutions to choose from this matter: cloud registry, dockerhub, private registry on a vm&#8230; or a private registry in <a href="https://geko.cloud/en/what-is-kubernetes/">Kubernetes</a>.</p>
<p>Today we are going to cover the latter. A solution to deploy a <strong>registry inside Kubernetes</strong> itself: <strong>Harbor</strong>.</p>
<h3>But what is Harbor?</h3>
<p><strong>Harbor</strong> is open-source and is part of the <a href="https://cncf.io/">Cloud Native Computing Foundation</a>. It implements some basic functionalities like a role-based authentication (with <strong><a href="https://geko.cloud/en/install-grafana-ldap-kubernetes-helm/">support for LDAP</a></strong>) and also ships with some interesting more advanced features like the ability to upload and store<strong> helm charts</strong>, perform vulnerability scans on the uploaded images, and much more.</p>
<h3>Enough talk, I want a hands-on!</h3>
<p>Let&#8217;s see how can we implement <strong>Harbor</strong> in our cluster. I assume you are meeting the following requirements:</p>
<ul>
<li>You have a working <b>k8s cluster</b> with ingress-controller. Minikube is acceptable.</li>
<li>You have <b>helm</b> installed (read <b><a href="https://geko.cloud/en/install-grafana-ldap-kubernetes-helm/">how to install helm</a></b>)</li>
<li>You have the <strong>docker</strong> client installed</li>
<li>10 spare minutes <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></li>
</ul>
<p><strong>IMPORTANT</strong>: You should have cert-manager installed in your cluster since Harbor requires to have a valid HTTPS certificate to login with docker from your terminal.</p>
<h3>Installing Harbor</h3>
<p>We are going to use the official helm chart for this part. To do this, you will need to add the harbor repo first:</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">helm repo add harbor https://helm.goharbor.io</pre>
</div>
<p>To customize your deployment you can create a new values.yaml file, replace it with your desired contents:</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">expose:
  type: ingress
  tls: 
    commonName: "YOUR_CN"
  ingress:
    hosts:
      core: "harbor.YOUR_DOMAIN"
persistence:
  enabled: true
externalURL: "https://harbor.YOUR_DOMAIN"
harborAdminPassword: admin</pre>
</div>
<p>Now create the namespace and deploy the chart. The values used for the deployment will vary depending on your needs:</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">kubectl create harbor-system
helm install --wait harbor --namespace harbor-system harbor/harbor -f values.yaml</pre>
</div>
<p>After install finishes (can take up to 5 minutes) you can go to the domain using your web browser and log in to harbor with the admin username and the password you previously defined. Should end up on this screen:</p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-4578" src="https://geko2.factoryfy.com/wp-content/uploads/harbor_main.png" alt="Harbor main screen" width="602" height="413" /></p>
<h3>Pushing your first image</h3>
<p>First, you will need to login to the registry from your terminal by using the docker login command and entering your credentials:</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">docker login https://harbor.YOUR_DOMAIN</pre>
</div>
<p><em>*Note that in order to access harbor through this domain you must create the appropiate DNS entry in your DNS manager AND <strong>is mandatory</strong> to have a <strong>valid HTTPS certificate</strong></em></p>
<p>Click the &#8220;NEW PROJECT&#8221; button and fill the inputs:</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-4579" src="https://geko2.factoryfy.com/wp-content/uploads/harbor_new_project.png" alt="Harbor create new project" width="473" height="266" /></p>
<p>After clicking OK you should be able to see your new project on the main screen.</p>
<p>Now, let&#8217;s try to upload a new image to this project. Pull the official nginx image, tag it with your harbor/project and push it:</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">docker pull nginx
docker tag nginx harbor.YOUR_DOMAIN/myproject/nginx:latest
docker push harbor.YOUR_DOMAIN/myproject/nginx:latest</pre>
</div>
<p>If everything went fine, you should see the nginx image inside the project you created in harbor:</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-4580" src="https://geko2.factoryfy.com/wp-content/uploads/harbor_new_image.png" alt="Harbor new nginx image" width="805" height="125" /></p>
<h3>What&#8217;s next?</h3>
<p>You have deployed a new private Harbor registry and you already uploaded your first image.</p>
<p>In the next post of this series, we will cover how to create the required credentials for your pods to be able to pull the images from your private Harbor and how to tell <a href="https://geko.cloud/en/what-is-kubernetes/">Kubernetes</a> when and how to use those credentials.</p>
<hr />
<p>I hope you&#8217;ve enjoyed this post and I encourage you to <a href="https://geko.cloud/en/blog/labs/">check our blog for other posts</a> that you might find helpful. <a href="https://geko.cloud/en/contact/">Do not hesitate to contact us</a> if you would like us to help you on your projects.</p>
<p>See you on the next post!</p>
<p>La entrada <a href="https://geko.cloud/en/harbor-private-registry-kubernetes/">Harbor: Private docker registry in Kubernetes</a> se publicó primero en <a href="https://geko.cloud/en/">Geko Cloud</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://geko.cloud/en/harbor-private-registry-kubernetes/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Renew your expired Kubernetes certificates</title>
		<link>https://geko.cloud/en/renew-your-expired-kubernetes-certificates/</link>
					<comments>https://geko.cloud/en/renew-your-expired-kubernetes-certificates/#respond</comments>
		
		<dc:creator><![CDATA[Jose Luis Sánchez]]></dc:creator>
		<pubDate>Mon, 15 Feb 2021 13:05:10 +0000</pubDate>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[Jenkins]]></category>
		<category><![CDATA[Kubernetes]]></category>
		<guid isPermaLink="false">https://geko2.factoryfy.com/renew-your-expired-kubernetes-certificates/</guid>

					<description><![CDATA[<p>Jenkins Kubernetes Pod Template Last friday we faced with a non very common issue with a customer that use jenkins and kubernetes for their CICD pipelines&#8230; Some of their Jenkins pipelines freezed because the Kubernetes nodes which runs those executions still pending/offline for some reason and every console output shows us the following message: [Pipeline] [&#8230;]</p>
<p>La entrada <a href="https://geko.cloud/en/renew-your-expired-kubernetes-certificates/">Renew your expired Kubernetes certificates</a> se publicó primero en <a href="https://geko.cloud/en/">Geko Cloud</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<div style="display: none;"></div>
<h2>Jenkins Kubernetes Pod Template</h2>
<p>Last friday we faced with a non very common issue with a customer that use <strong>jenkins</strong> and <strong>kubernetes</strong> for their <strong>CICD</strong> pipelines&#8230;</p>
<p>Some of their <strong>Jenkins pipelines freezed because the Kubernetes nodes which runs those executions still pending/offline</strong> for some reason and every console output shows us the following message:</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">[Pipeline] node
Still waiting to schedule task
All nodes of label ‘docker-build-xxxxxx’ are offline</pre>
</div>
<p><a href="https://plugins.jenkins.io/kubernetes/">Here</a> I attach you a plugin link with very usefull information and configurations about the <strong>Kubernetes</strong> plugin (we strongly recommend you)</p>
<h2 class="lang-yaml s-code-block hljs">The Problem</h2>
<p>We decided to check the Kubernetes cluster in order to inspect the pods execution inside the cicd namespaces to understand what is happening&#8230; then we notice that we are not able to talk with the Kubernates API thourgh the kubectl client, all the time we try to do some request to the API we get the following message:</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">Unable to authenticate the request due to an error: [x509: certificate has expired or is not yet valid, x509: certificate has expired or is not yet valid]</pre>
</div>
<p>Bingo! That&#8217;s the issue, our <strong>Kubernetes certificates we use to connect to the api (and used for etcd as well) has expired</strong>. This means a little problem because in order to renew a Kubernetes certificate you must to use a client to connect to the K8S API, but as I told you, the client doesn&#8217;t work because the certificates already expired&#8230; sooooo</p>
<h4>What we gonna do?</h4>
<h2>Geko to the rescue!</h2>
<p>There is a <strong>workaround</strong> to solve it, basically we must to fake our Kubernetes by <strong>destroying (moving) the current certificates manually and then force re-create it</strong> using init config into the whole cluster.</p>
<p>We strongly suggest you to previously move all the old certificates in a temporary folder, then force init config and finally reboot the K8S to startup with the new certificates we will use in our client side.</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">$ cd /etc/kubernetes/pki/ 
$ mkdir -p /tmp/oldcerts/etcd
$ mv {apiserver.crt,apiserver-etcd-client.key,apiserver-kubelet-client.crt,front-proxy-ca.crt,front-proxy-client.crt,front-proxy-client.key,front-proxy-ca.key,apiserver-kubelet-client.key,apiserver.key,apiserver-etcd-client.crt} /tmp/oldcerts 
$ mv etcd/* /tmp/oldcerts/etcd
$ kubeadm init phase certs all --apiserver-advertise-address  
$ cd /etc/kubernetes/ 
$ mv {admin.conf,controller-manager.conf,kubelet.conf,scheduler.conf} /tmp/oldcerts 
$ kubeadm init phase kubeconfig all 
$ reboot</pre>
</div>
<p>After reboot , our cluster will startup using the new certificates and will create a new .kubeconfig file which we will copy locally to use through our kubectl client.</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">$ cp -i /etc/kubernetes/admin.conf $HOME/.kube/config</pre>
</div>
<p>Once we copy the new kubeconfig file , we are fully available to work with our K8S cluster again.</p>
<p>In our case we delete all the orphan pods previously generated inside the &#8220;cicd&#8221; namespace (we love awk <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" />  )</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">for docker in `kubectl get pods -n cicd | awk {'print $1'}`;do kubectl delete pod $docker -ncicd;done</pre>
</div>
<p>We hope this post could help you with your <strong>Kubernetes expired certificates</strong> in order to restore the API connectivity with your clients.</p>
<p>If we can help you somehow don&#8217;t hesitate to contact us <a href="https://geko.cloud/en/contact/">here</a>.</p>
<p>La entrada <a href="https://geko.cloud/en/renew-your-expired-kubernetes-certificates/">Renew your expired Kubernetes certificates</a> se publicó primero en <a href="https://geko.cloud/en/">Geko Cloud</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://geko.cloud/en/renew-your-expired-kubernetes-certificates/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is Kubernetes and when to use it</title>
		<link>https://geko.cloud/en/what-is-kubernetes-and-when-to-use-it/</link>
					<comments>https://geko.cloud/en/what-is-kubernetes-and-when-to-use-it/#respond</comments>
		
		<dc:creator><![CDATA[Xènia Adan]]></dc:creator>
		<pubDate>Mon, 08 Feb 2021 13:12:13 +0000</pubDate>
				<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Featured post]]></category>
		<category><![CDATA[Kubernetes]]></category>
		<guid isPermaLink="false">https://geko2.factoryfy.com/what-is-kubernetes-and-when-to-use-it/</guid>

					<description><![CDATA[<p>First of all&#8230; You probably already know something about what Kubernetes is, or you&#8217;ve heard of it, but if you don&#8217;t quite understand the advantages of this powerful tool, in Geko we want to guide you. As you may already know, Kuberentes is a container orchestrator that allows you to deploy your production applications to [&#8230;]</p>
<p>La entrada <a href="https://geko.cloud/en/what-is-kubernetes-and-when-to-use-it/">What is Kubernetes and when to use it</a> se publicó primero en <a href="https://geko.cloud/en/">Geko Cloud</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3>First of all&#8230;</h3>
<p>You probably already know something about what <a href="https://geko.cloud/en/what-is-kubernetes/"><strong>Kubernetes</strong></a> is, or you&#8217;ve heard of it, but if you don&#8217;t quite understand the advantages of this powerful tool, in <a href="https://geko.cloud/en/">Geko</a> we want to guide you.</p>
<p>As you may already know, <a href="https://geko.cloud/en/what-is-kubernetes/"><strong>Kuberentes</strong></a> is a <strong>container orchestrator</strong> that allows you to deploy your production applications to the cloud in an automated way. It was developed by Google and subsequently donated to the community, making it an Open Source project.</p>
<p>With <a href="https://geko.cloud/en/what-is-kubernetes/"><strong>Kubernetes</strong></a>, multiple parts of the same application can run in isolated containers, so if one part of an application becomes inoperative, only that part can be restored instead of the entire server. This saves time and increases productivity when developing applications and putting them into production.</p>
<p>At <a href="https://geko.cloud/en/">Geko Cloud</a> we are<strong> experts in Kubernetes</strong> and the use of <a href="https://geko.cloud/en/cloud-services/microservices-architecture-docker/">microservices architectures</a>, something that addresses both the need to make better use of computing resources and the need to maintain increasingly complex web applications.</p>
<h3>What are the advantages of using <strong>Kubernetes</strong> in your business?</h3>
<p>We will tell you some of them:</p>
<ul>
<li>Unify the deployment model.</li>
<li>Increases accountability and autonomy of the development team.</li>
<li>Achieves high-speed horizontal growth, i.e. scalability, in addition to<strong> vertical node autoscaler</strong> and HPA.</li>
<li>DRP or business continuity.</li>
<li><a href="https://geko.cloud/en/what-is-kubernetes/"><strong>Kubernetes</strong></a> is a cutting-edge technology, but it has been around long enough to warrant its use, and there is a large community behind it to support it.</li>
<li>There are a number of cloud-managed <strong>K8s platforms</strong> that allow you to eliminate complexity.</li>
<li>It is <strong>cloud agnostic</strong>, offering scalability between environments and infrastructures.</li>
<li>It provides tracking and security.</li>
</ul>
<h3>But you also need to know when not to use <strong>Kubernetes</strong></h3>
<p>As we indicated at the beginning, we want to guide you on <strong>when to use or not to use</strong> <a href="https://geko.cloud/en/what-is-kubernetes/"><strong>Kubernetes</strong></a> and what to consider when using it.</p>
<ul>
<li>You should keep in mind that <a href="https://geko.cloud/en/what-is-kubernetes/"><strong>Kubernetes</strong></a> needs an initial implementation and operational cost.</li>
<li>It is advisable to implement it as a business model not as a platform.</li>
<li>Operating a <a href="https://geko.cloud/en/what-is-kubernetes/"><strong>Kuberentes</strong></a> cluster without <a href="https://geko.cloud/en/what-is-the-cloud/"><strong>Cloud</strong></a> as the management layer adds some complexity, if a whole <strong>K8S</strong> <strong>cluster</strong> goes down, everything will go down.</li>
<li>It is a platform that was designed for small stateless apps and their interconnection, not designed to deploy DB infrastructure or other high-risk infrastructures. But with the improvements in high availability and new features it allows more and more structures to be brought in internally. The new stateful support mitigates this.</li>
</ul>
<h3>Learn more about when and how to use <strong>Kubernetes</strong> in our webinar</h3>
<p style="text-align: center;">Watch it here:<a href="https://www.youtube.com/watch?v=RpUNIZoCl7g"><br />
</a><a href="https://www.youtube.com/watch?v=RpUNIZoCl7g&amp;utm_source=LinkedIn&amp;utm_medium=Youtube&amp;utm_campaign=LinkedIn%20messages%20para%20asistentes%20al%20evento"><img loading="lazy" decoding="async" class="aligncenter wp-image-3539" src="https://geko2.factoryfy.com/wp-content/uploads/botn-youtube.png" alt="Webinar Kubernetes" width="182" height="57" /></a></p>
<p>We hope you find it useful to learn more about <a href="https://geko.cloud/en/what-is-kubernetes/"><strong>Kubernetes</strong></a> and we encourage you to <a href="https://www.youtube.com/channel/UC5EFLCqUM7fEaXSa_0nWowQ">subscribe</a> to stay up to date with new content.<br />
At<a href="https://geko.cloud/en/"> Geko Cloud</a> we are at your disposal if you are looking for a partner to implement <a href="https://geko.cloud/en/what-is-kubernetes/"><strong>Kubernetes</strong></a>, <a href="https://geko.cloud/en/cloud-services/migration/">migrate to the cloud</a>, switch to a <a href="https://geko.cloud/en/cloud-services/microservices-architecture-docker/">microservices model</a> or manage your platform in the <a href="https://geko.cloud/en/what-is-the-cloud/"><strong>c</strong><strong>loud</strong></a>.</p>
<p><a href="https://geko.cloud/en/contact/">Contact us</a> to learn more about our <a href="https://geko.cloud/en/cloud-services/">services</a>, thank you for reading and leave us your comments!</p>
<p><a href="https://geko.cloud/en/contact/"><img loading="lazy" decoding="async" class="aligncenter wp-image-3265" src="https://geko2.factoryfy.com/wp-content/uploads/geko-1.png" alt="" width="86" height="85" /></a></p>
<p>La entrada <a href="https://geko.cloud/en/what-is-kubernetes-and-when-to-use-it/">What is Kubernetes and when to use it</a> se publicó primero en <a href="https://geko.cloud/en/">Geko Cloud</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://geko.cloud/en/what-is-kubernetes-and-when-to-use-it/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Kubectl Plugins in just 3 steps</title>
		<link>https://geko.cloud/en/kubectl-plugins-in-just-3-steps/</link>
					<comments>https://geko.cloud/en/kubectl-plugins-in-just-3-steps/#respond</comments>
		
		<dc:creator><![CDATA[Christian]]></dc:creator>
		<pubDate>Tue, 05 Jan 2021 11:42:57 +0000</pubDate>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[Kubernetes]]></category>
		<guid isPermaLink="false">https://geko2.factoryfy.com/kubectl-plugins-in-just-3-steps/</guid>

					<description><![CDATA[<p>Introduction Many times to fullfill our daily tasks we find ourselves in the situation of having to build our own tools to solve specific problems or situations. In this note I am going to show you how easy it is to create a plugin for kubectl. A plugin is simply an executable program that allows [&#8230;]</p>
<p>La entrada <a href="https://geko.cloud/en/kubectl-plugins-in-just-3-steps/">Kubectl Plugins in just 3 steps</a> se publicó primero en <a href="https://geko.cloud/en/">Geko Cloud</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div style="display: none;"></div>
<h2>Introduction</h2>
<p>Many times to fullfill our daily tasks we find ourselves in the situation of having to build our own tools to solve specific problems or situations. In this note I am going to show you how easy it is to create a <a href="https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/">plugin for kubectl</a>.</p>
<p>A <strong>plugin</strong> is simply an executable program that allows you to extend the functionality of kubectl, allowing us to implement our own subcommands.<br />
It is important to mention that we can code it in the language we like the most: Bash, Python, Go, etc&#8230;</p>
<h3>What do we need?</h3>
<p>There are certain conditions that we must meet for our <strong>plugin</strong> to work:</p>
<ol>
<li>The file name must begin with: <strong>kubectl-</strong> and must not contain an extension.</li>
<li>It must be an executable file.</li>
<li>It should be located in our <strong>$PATH</strong> and this will be all the installation it would require. Pretty simple, no?</li>
</ol>
<p>We can list available <strong>plugins</strong> on our system using:</p>
<p>&nbsp;</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">kubectl plugin list
</pre>
</div>
<p>This command will search on our <strong>PATH</strong> for all executable files that meet the required conditions.</p>
<h2>Let&#8217;s do it!</h2>
<h3>Create a test environment</h3>
<p>Let&#8217;s make a simple <strong>plugin</strong>, more entertaining than the trivial «Hello World!», that sends the logs of all running pods to a single output to be able to view this output jointly.</p>
<p>To make it more entertaining we will add the name of the pod in colors for each log line in the output. And we can also select with the numeric keys from 1 to N (where N is the nth pod: 1 on-the-fly and see only the output of that pod.</p>
<p>And we will do all this in Bash!</p>
<p>For this demo we are going to use a docker image <a href="https://hub.docker.com/r/kscarlett/nginx-log-generator">nginx-log-generator</a> that generates <strong>Nginx</strong> fake-logs. We will first create a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/">kubernetes deployment</a> that will contain the pods. We create a new file called <strong>fake-logs.yaml</strong> with the following content:</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-fake-logger
spec:
  template:
    metadata:
      name: logger-1
      labels:
        app: logger
    spec:
      containers:
        - name: logger
          image: kscarlett/nginx-log-generator
  replicas: 3
  selector:
    matchLabels:
      app: logger</pre>
</div>
<p>Apply the deployment:</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">kubectl create -f fake-logs.yaml
</pre>
</div>
<p>Let&#8217;s check that our <em>deploy</em> is working:</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">$ kubectl get pods
NAME                              READY   STATUS    RESTARTS   AGE
my-fake-logger-66dcffbccd-6kx8b   1/1     Running   4          6d2h
my-fake-logger-66dcffbccd-7q4tm   1/1     Running   1          3d1h
my-fake-logger-66dcffbccd-cff4s   1/1     Running   1          3d1h

$ kubectl get deploy
NAME             READY   UP-TO-DATE   AVAILABLE   AGE
my-fake-logger   3/3     3            3           6d2h</pre>
</div>
<h3>Create the plugin:</h3>
<p><strong>First:</strong> We will create our plugin file named <strong>kubectl-demo</strong> with the following script.</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">#!/bin/bash
trap ctrl_c INT
function ctrl_c() {
  echo "**************************************** Bye Bye ****************************************"
  for pid in ${PIDS[@]}
  do
      kill -TERM $pid 
  done
  rm $NAMED_PIPE
  rm $sync
  exit 0
}

function colorize() {

  pod=$1
  counter=$2
  # colors from 31 to 39
  pre_colour="\033[3${counter}m"
  post_colour="\033[0m"
  if [ "$colorize_output" = true ]
  then
    colour_pod="${pre_colour}[${pod}]${post_colour}"
  else
    colour_pod="[${pod}]"
  fi
}

function show_logs() {
  local sync="$1"
  grep -E -f $sync $NAMED_PIPE &amp;
}

function banner() {
  echo ""
  echo "==================================================="
  echo "+ Showing logs for:"
  echo "+ $1"
  echo "==================================================="
  echo ""
}

function start_log() {
  show_logs $sync 
  shl_pid=$!
  disown $shl_pid
  PIDS+=$shl_pid" "  
}

function usage() {
  echo "~~~~~~~~~~~"
  echo " U S A G E"
  echo "~~~~~~~~~~~"
  echo "Usage: kubectl demo [option]"
  echo "  options:"
  echo "    --no-colorize: no colorize [default: colorize]"
  echo "    -h: Show this help"
  echo ""
  echo "When running you can use the numbers 1 to N to filter N-pod and only show it's output."
  echo "0 resets and shows all outputs again"
  echo ""
}

NAMED_PIPE="/tmp/my_named_pipe"
PODS=$(kubectl get pods --no-headers=true -o=custom-columns=NAME:.metadata.name)
TOTAL_PODS=$(echo $PODS | sed -s 's/ /n/g' | wc -l)
colorize_output=true

if [[ $@ ]]; then
  case "$@" in
    "--no-colorize")
      colorize_output=false
      ;;
    "-h")
      usage
      exit 1
      ;;
    *) echo "Invalid option"
      exit 1
      ;;
  esac
fi


# create named pipe
if [ ! -p $NAMED_PIPE ]
then
    mkfifo $NAMED_PIPE
    chmod a+rw $NAMED_PIPE
fi

PIDS=()
declare -A pods_index
counter=1
for pod in $(echo $PODS)
do
  colour_pod=""
  colorize $pod $counter
  kubectl logs -f $pod | awk -v pod_name=$colour_pod '{print pod_name" "$0}' &gt; $NAMED_PIPE &amp;
  PIDS+=$!" " # save all PIDs
  pods_index[$counter]=$pod
  counter=$((counter+1))
done

# Trick: Shared memory segment for inter process comunication. 
sync=/dev/shm/syntest-$$  # allocate a shared memory segment name for this pid
echo '' &gt; $sync           # init the shm

start_log
input="*"
re='^[0-9]+$' # we match only numbers

while true
do
  read -t 0.25 -N 1 input
  if  [[ $input =~ $re ]]  &amp;&amp; [ "$input" -ge "0" ] &amp;&amp; [ "$input" -le "$TOTAL_PODS" ]
  then
    if [ "$input" -eq "0" ]
    then
      banner "All Pods"
      echo $ &gt; $sync    # grep everything
    else
      banner ${pods_index[$input]}
      echo ${pods_index[$input]} &gt; $sync  # grep only pod name
    fi
    kill -SIGTERM $shl_pid
    PIDS=$(echo $PID | sed -e "s/$shl_pid//g" | tr -s " ")  # remove unused pid
    start_log
  fi
done</pre>
</div>
<p><strong>Second: </strong>Set execution permissions</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">chmod +x kubectl-demo
</pre>
</div>
<p><strong>Third: </strong>And last step, we need our script to be accessible from our <strong>PATH</strong>.</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">ln -s $PWD/kubectl-demo /usr/local/bin/kubectl-demo
</pre>
</div>
<p>From now on, and with nothing else to do, we can make use of our newly created <strong>plugin</strong>.</p>
<p>We can check that <strong>kubectl</strong> is ready to use it by listing the plugins it finds:</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">$ kubectl plugin list
The following compatible plugins are available:

/home/user/kubectl-demo</pre>
</div>
<h2>Let&#8217;s test it!</h2>
<p>We show the possible options:</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">$ kubectl demo -h
~~~~~~~~~~~
 U S A G E
~~~~~~~~~~~
Usage: kubectl demo [option]
  options:
    --no-colorize: no colorize [default: colorize]
    -h: Show this help

When running you can use the numbers 1 to N to filter N-pod and only show it's output.
0 resets and shows all outputs again</pre>
</div>
<p>As an example of how we can pass parameters to our sub-commands, we have added the option to allow not to paint the output.</p>
<h2>Outputs</h2>
<p>Default:</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">[my-fake-logger-66dcffbccd-7q4tm] 214.216.236.37--[02/Jan/2021:10:17:17+0000] 
"GET/moderator/Reduced.cssHTTP/1.1"....
[my-fake-logger-66dcffbccd-6kx8b] 132.56.98.34--[02/Jan/2021:10:19:22+0000] 
"GET/standardization.svgHTTP/1.1"2001908 
[my-fake-logger-66dcffbccd-cff4s] 159.240.103.70--[02/Jan/2021:10:24:45+0000] 
"GET/Virtual.htmHTTP/1.1"2002288"-"....</pre>
</div>
<p>We can choose which <strong>POD </strong>want to display with the numbers 1 to 3 in this case:</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{"># 1
===================================================
+ Showing logs for:
+ my-fake-logger-66dcffbccd-6kx8b
===================================================
[my-fake-logger-66dcffbccd-6kx8b]  16.211.208.91 - - [02/Jan/2021:10:34:33 +0000]  "GET /bottom-line%20Advanced/Upgradable/intermediate.svg HTTP/1.1" ....</pre>
</div>
<p>And we can reset too default view by using number 0 and have all the logs again:</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">===================================================
+ Showing logs for:
+ All Pods
===================================================
[my-fake-logger-66dcffbccd-7q4tm] 214.216.236.37--[02/Jan/2021:10:17:17+0000] "GET/moderator/Reduced.cssHTTP/1.1"30143"-"....
[my-fake-logger-66dcffbccd-6kx8b]  16.211.208.91 - - ....</pre>
</div>
<p>As we can see, the script is pretty simple and I invite you to try all its options, modify it to your liking and extend its functionality.</p>
<h2>Conclusion</h2>
<p>We saw that it is extremely easy to create a kubectl plugin, it is enough to program what our imagination wants and comply with the executable name and location.</p>
<p>Because of this facility, there is no excuse for not making a plugin for practically every specific need. It is also necessary to comment that there is a large number of <a href="https://github.com/ishantanu/awesome-kubectl-plugins">plugins provided by</a> the community. It&#8217;s worth taking a look!</p>
<p>I hope this note has helped you to learn something new and continue to expand your knowledge.</p>
<p>I invite you if you need information about the <a href="https://geko.cloud/es/devops/"><strong>DevOps</strong></a> world or <a href="https://geko.cloud/es/que-es-kubernetes/">Kubernetes</a>, <a href="https://geko.cloud/es/contacto/">contact us</a> and keep checking <a href="https://geko.cloud/es/blog/labs/">our blog</a> to find other useful publications.</p>
<p><a href="https://geko.cloud/es/blog/labs/"><img loading="lazy" decoding="async" class="aligncenter wp-image-3265" src="https://geko2.factoryfy.com/wp-content/uploads/geko-1-150x150.png" alt="" width="82" height="82" /></a></p>
<p>La entrada <a href="https://geko.cloud/en/kubectl-plugins-in-just-3-steps/">Kubectl Plugins in just 3 steps</a> se publicó primero en <a href="https://geko.cloud/en/">Geko Cloud</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://geko.cloud/en/kubectl-plugins-in-just-3-steps/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Kubernetes CronJobs – A deeper look</title>
		<link>https://geko.cloud/en/kubernetes-cronjobs-a-deeper-look/</link>
					<comments>https://geko.cloud/en/kubernetes-cronjobs-a-deeper-look/#respond</comments>
		
		<dc:creator><![CDATA[Geko Cloud]]></dc:creator>
		<pubDate>Mon, 23 Nov 2020 10:41:46 +0000</pubDate>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[Kubernetes]]></category>
		<guid isPermaLink="false">https://geko2.factoryfy.com/kubernetes-cronjobs-a-deeper-look/</guid>

					<description><![CDATA[<p>Introduction Nowadays is more and more common for companies to migrate some parts of their infrastructure —or even the entire company— to the cloud. There are two main approaches: Stay as close as possible to the previous architecture by using VMs, or bet for flexibility/scalability/availability and go for a new perspective by using a container [&#8230;]</p>
<p>La entrada <a href="https://geko.cloud/en/kubernetes-cronjobs-a-deeper-look/">Kubernetes CronJobs – A deeper look</a> se publicó primero en <a href="https://geko.cloud/en/">Geko Cloud</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p style="text-align: justify;">Nowadays is more and more common for companies to migrate some parts of their infrastructure —or <span class="VIiyi" lang="en"><span class="JLqJ4b ChMk0b" data-language-for-alternatives="en" data-language-to-translate-into="es" data-phrase-index="0">even the</span></span> entire company— to the <a href="https://geko.cloud/en/what-is-the-cloud/">cloud</a>. There are two main approaches: Stay as close as possible to the previous architecture by using <a href="https://en.wikipedia.org/wiki/Virtual_machine">VMs</a>, or bet for flexibility/scalability/availability and go for a new perspective by using a container orchestrator like <a href="https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/">Kubernetes</a>. Focusing on this latter approximation (Kubernetes), what you previously had running on an Operative System (which had access to mostly all the conveniences an Operative System provides) now runs in containers. In addition, these containers don&#8217;t commonly run directly on specific targets (or machines), but on a <a href="https://en.wikipedia.org/wiki/Computer_cluster">cluster</a>. Everything works cool and everything is awesome until you realize you&#8217;re not in a friendly and well-known environment anymore. Operative System&#8217;s tools like <em>automated tasks</em> or <a href="https://en.wikipedia.org/wiki/Cron">Cron</a> don&#8217;t actually follow the <a href="https://cloud.google.com/solutions/best-practices-for-building-containers">containers&#8217; best practices</a>, as they are system-wide (which is the opposite to the app-isolation approach the containerization prays for). Embed those tools (or their behaviors) on your isolated application could become into a big pain full of workarounds and not-that-good practices.</p>
<p style="text-align: justify;">As a <del>full</del> huge ecosystem, <a href="https://geko.cloud/en/what-is-kubernetes/"><strong>Kubernetes</strong></a> provides some of these functionalities so the day-to-day requirements could be addressed. However, brand-new operatives come into the scene when talking about clusters, containers, and a big variety of workflows to handle. Across the following lines, you will learn how Kubernetes have solved the Cron functionality, and most of its tricky, hidden features.</p>
<h2>1. How Kubernetes CronJobs actually work</h2>
<p><img loading="lazy" decoding="async" class=" wp-image-3091 alignright" src="https://geko2.factoryfy.com/wp-content/uploads/diagram1.png" alt="cronjob-job-pod" width="112" height="245" /></p>
<p style="text-align: justify;">When a <strong>CronJob</strong> resource is created, what <a href="https://geko.cloud/en/what-is-kubernetes/"><strong>Kubernetes</strong></a> actually does is to register a schedule. <a href="https://github.com/kubernetes/kubernetes/blob/392bf0adef478175b9cf0226b02820eb1820f797/pkg/controller/cronjob/cronjob_controller.go#L95-L96">Every 10 seconds the CronJob Controller checks if there are matching schedules to take care of</a>. When the proper time arrives a new Job resource is created to handle the task for that specific run. Finally, every Job creates a Pod in order to run the task.</p>
<p style="text-align: justify;">As you may notice this approach differs significantly from the OS one. What is actually happening here is a decoupling between cron-schedules&#8217; handling and the task&#8217;s handling (Jobs). This allows the cluster (and also you) to handle ephemeral tasks without loosing control over them.</p>
<p style="text-align: justify;">Moreover, Jobs can create one or more Pods (allowing concurrency/parallelism) and they also ensure the tasks are successfully accomplished. <strong>However, this last behaviour could create additional issues as the container also offer a restart-handling feature</strong>. This topic will be addressed on the following section.</p>
<h2>2. How to configure the advanced functionalities</h2>
<p style="text-align: justify;">First of all it must be taken into account that in order to configure a <strong>CronJob</strong>, every underlying resource could be configured as well. This means a CronJob configuration aggregates <a href="https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/#writing-a-cron-job-spec">its own parameters</a> plus the <a href="https://kubernetes.io/docs/concepts/workloads/controllers/job/#writing-a-job-spec">Job&#8217;s properties</a> and also the Pod/container specifications. As most of the common work-flows can be addressed just by having a quick look at the documentation, the aim of this section is to show how to achieve certain tricky functionalities through configuration.</p>
<h3>Errors&#8217; handling</h3>
<p style="text-align: justify;">When a container stops its execution (because of a failure or after a successful execution) there are a set of actions that could be taken just after, which are defined —as usually— by resource directives. Typical actions are restarting the container (always or only when a failure is detected) or doing nothing. Moreover, the Jobs add another complexity layer which ensures the task is successfully terminated. This means the restarting policy is guaranteed through two different layers that must be properly configured to achieve the desired behavior.</p>
<p>On the container side, the directive is called <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy">restart Policy</a>. On the Job side, this policy is &#8220;handled&#8221; by the directive <a href="https://kubernetes.io/docs/concepts/workloads/controllers/job/#pod-backoff-failure-policy">back-off limit</a>, which specifies the <strong>number</strong> of allowed failures before giving up and stopping to restart the task. Keeping that in mind, setting up a CronJob able to fail without restarts is as easy as follows.</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">apiVersion: batch/v1beta1
kind: CronJob
...
spec:
  ...
  jobTemplate:
    spec:
      <strong>backoffLimit: 0</strong>
      template:
        spec:
          containers:
            ...
          <strong>restartPolicy: Never</strong></pre>
</div>
<h3>Overlapping vs. Sequential executions</h3>
<p style="text-align: justify;">When talking about a specific <strong>CronJob</strong>, multiple runs of it could coexist. Depending on the kind of flow the task is characterized for, concurrency could be a way to proceed in order to speed-up processing. There are three available ways to handle how the Jobs are run, which are controlled by the directive <a href="https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/#concurrency-policy">concurrency Policy</a>.</p>
<ol>
<li><strong>Allow</strong>: Allow overlapping executions.</li>
<li><strong>Replace</strong>: New executions terminate the previous ones before starting.</li>
<li><strong>Forbid</strong>: New executions are discarded if a previous one is still running.</li>
</ol>
<p style="text-align: justify;">While the first one allows concurrence, the two last ones bet for sequential executions. Once again, to stay as close to old-fashioned crons the closer approach is to set the <strong>Allow</strong> policy. On the other hand, concurrent runs could cause undesired effects if they are not properly managed, and it&#8217;s something that should be kept in mind and also be handled with care.</p>
<h3>Minimum execution time</h3>
<p style="text-align: justify;">As it was previously stated, new task executions could interfere with previous ones depending on how the concurrency directives are set. There&#8217;s a property from the container specification which could be useful to deal with the consequences of interrupted runs. A minimum execution time can be set through the <a href="https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#hook-handler-execution">terminationGracePeriodSeconds</a> container-property so even if another new task causes an old one to finish, a graceful termination is guaranteed.</p>
<h2>3. Operating the CronJobs as a Master</h2>
<p style="text-align: justify;">Once the configuration shows up what the <strong>CronJob</strong> was intended to do, the <a href="https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs">basic commands can be issued to retrieve the status</a> (scheduling info, running state, logs, &#8230;). As on the previous section, the following operatives will cover how to achieve some uncommon features.</p>
<h3>Enable/disable CronJobs</h3>
<p style="text-align: justify;">The CronJob&#8217;s specification has a property called <a href="https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/#suspend">suspend</a> which allows to deactivate them. Temporarily or not, <strong>CronJobs</strong> can be defined but not being executed at certain times (as their schedule states).</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{"># Disable a CronJob
CRONJOB_NAME=my-cronjob-1
kubectl patch cronjobs $CRONJOB_NAME -p '{"spec" : {"suspend" : true }}'

# Disable ALL CronJobs
kubectl get cronjobs | grep False | cut -d' ' -f 1 | xargs kubectl patch cronjobs -p '{"spec" : {"suspend" : true }}'</pre>
</div>
<p><strong>Have a look at the following section in order to get further details about the side effects this could cause.</strong></p>
<h3>Run CronJobs manually</h3>
<p style="text-align: justify;">It&#8217;s widely known testing is very useful when detecting undesirable effects. <strong>CronJobs</strong> can be run manually even when they are suspended (deactivated), so keeping them in that state and running them under testing circumstances could help to validate everything is correct.</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">CRONJOB_NAME=my-cronjob-1
kubectl create job --from=cronjobs/$CRONJOB_NAME $CRONJOB_NAME-manual-exec-01</pre>
</div>
<h2>4. Showing up the edge cases</h2>
<p style="text-align: justify;">After all, there would be no variety if everything were the same way. Every situation has its own particularities and specific characteristics, so when talking about <strong>CronJobs</strong> that will not be different. Across the following lines, some edge cases will be presented and addressed, so the solutions to them could be reused (or —at least— taken into consideration).</p>
<h3>Maximum execution time</h3>
<p style="text-align: justify;">On previous sections the execution-time topic was addressed to guarantee a graceful time is conceded before termination. But hey! What about the tasks taking too much time to finish? Agnostic containers&#8217; motivation (and also the <a href="https://geko.cloud/en/what-is-the-cloud/"><strong>Kubernetes</strong> </a>one) is to run the tasks until the infinity and beyond. Containers can flow or they can crash, but they should never be terminated as a common practice. Following this principle, there is no way to manage timeouts from the <strong>CronJobs</strong>/Jobs/Containers specification. So, it&#8217;s impossible to handle a maximum execution time? — No, it isn&#8217;t! Hence is where the Linux tool-set comes to the rescue. There&#8217;s a command called <a href="https://linux.die.net/man/1/timeout">timeout</a> that could be used to run another command until a specific amount of time.</p>
<p style="text-align: justify;">Even though the previous utility could limit the time, the exit code when it does it&#8217;s not a successful one so the container will enter into a failure status (that could escalate to a restart if it&#8217;s allowed to). On the other hand, the command status could be preserved but then it can&#8217;t be known if it was terminated or not. So, how to address them all? On the following snippet can be found a suggested approach that manages to always finish successfully while giving feedback about what actually happened.</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">containers:
  - name: "my-time-limited-to-10s-container"
    ...
    command: ["bash", "-c"]
    args:
      - /usr/bin/timeout 10 bash -c 'bash -c "comm arg1" &amp;&amp; echo OK || echo KO-COMM' || echo KO-TIME</pre>
</div>
<h3>CronJobs not being scheduled after being disabled and enabled again</h3>
<p style="text-align: justify;">There is a side effect when a <strong>CronJob</strong> is disabled, which is that after 100 missed schedules the <strong>CronJob</strong> will no longer be scheduled. This is already on the docs, but it&#8217;s just mentioned as something else not very important. The solution here is to recreate the resource.</p>
<h3>CronJobs being scheduled out of their schedule just after being enabled</h3>
<p style="text-align: justify;">Another unexpected effect you may find when dealing with <strong>CronJobs</strong> is that when reactivating one of them —despite that time doesn&#8217;t match the schedule— it is immediately executed. This happens because the execution is not just an isolated event, but a time-window until a deadline. This means every missed schedule (because of concurrency or because the <strong>CronJob</strong> is disabled) will increase a counter (up to a certain number, which is something that could be related to the previous edge case). Then, when the CronJob gets reactivated and it&#8217;s allowed to run, the controller realizes there are pending schedules. If the time window to the deadline is still not closed, the <strong>CronJob</strong> begins to run.</p>
<p style="text-align: justify;">This behavior can be addressed by setting the <a href="https://medium.com/@hengfeng/what-does-kubernetes-cronjobs-startingdeadlineseconds-exactly-mean-cc2117f9795f">startingDeadlineSeconds</a> directive to a small value, so the execution window will not match the reactivation time.</p>
<h3>CronJobs is not being scheduled</h3>
<p style="text-align: justify;">It comes the <strong><em>startingDeadlineSeconds</em> directive could be set to any value, but not all of them are going to cause the desired effect</strong>. As previously said the <strong>CronJob</strong>&#8216;s controller runs every 10 seconds, so <strong>every value below ten seconds will make the CronJobs never be scheduled</strong>. An <a href="https://github.com/kubernetes/website/issues/23622">issue</a> has been submitted by us to the Kubernetes website project, in order to warn them about this effect. In the next versions you will probably find out it&#8217;s already documented, but not for now.</p>
<p><strong>So don&#8217;t forget to set <em>startingDeadlineSeconds</em> to a value greater than 10.</strong></p>
<h2>Conclusion</h2>
<p style="text-align: justify;">As you may have seen, the difference between OS&#8217; crons and <a href="https://geko.cloud/en/what-is-the-cloud/"><strong>Kubernetes</strong></a>&#8216; crons is bigger than it could be expected at first looking. There are several scenarios on a cluster and many situations to handle, so they are addressed. Sometimes we will be looking for a OS-like behavior, sometimes not, but probably all of them will be possible to achieve. On the other hand, being so multi-purpose could end (as on CronJobs) on more difficult configuration experience, which could be even more difficult when the docs are a little bit short and vague.</p>
<p style="text-align: justify;">Thankfully, you can always count on <a href="https://geko.cloud/en/">Geko</a> team -a high-skilled engineering team- who will dig on the topic until getting it easy for you. Don&#8217;t forget to come back to the <a href="https://geko2.factoryfy.com/blog-2/">Geko’s blog</a> and check out what&#8217;s new in here! The Geko team will be always glad to see you back, and also you should <a href="https://geko.cloud/en/contact/" target="_blank" rel="noopener noreferrer">contact us for further information!</a></p>
<h2>Further reading</h2>
<p><a href="https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/">https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/</a><br />
<a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/">https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/</a><br />
<a href="https://kubernetes.io/docs/concepts/workloads/controllers/job/">https://kubernetes.io/docs/concepts/workloads/controllers/job/</a><br />
<a href="https://www.magalix.com/blog/kubernetes-patterns-the-cron-job-pattern">https://www.magalix.com/blog/kubernetes-patterns-the-cron-job-pattern</a><br />
<a href="https://medium.com/@bambash/kubernetes-docker-and-cron-8e92e3b5640f">https://medium.com/@bambash/kubernetes-docker-and-cron-8e92e3b5640f</a><br />
<a href="https://medium.com/cloud-native-the-gathering/how-to-write-and-use-kubernetes-cronjobs-3fbb891f88b8">https://medium.com/cloud-native-the-gathering/how-to-write-and-use-kubernetes-cronjobs-3fbb891f88b8</a><br />
<a href="https://medium.com/@hengfeng/what-does-kubernetes-cronjobs-startingdeadlineseconds-exactly-mean-cc2117f9795f">https://medium.com/@hengfeng/what-does-kubernetes-cronjobs-startingdeadlineseconds-exactly-mean-cc2117f9795f</a></p>
<p>La entrada <a href="https://geko.cloud/en/kubernetes-cronjobs-a-deeper-look/">Kubernetes CronJobs – A deeper look</a> se publicó primero en <a href="https://geko.cloud/en/">Geko Cloud</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://geko.cloud/en/kubernetes-cronjobs-a-deeper-look/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>“Alternative” managed Kubernetes</title>
		<link>https://geko.cloud/en/alternative-managed-kubernetes/</link>
					<comments>https://geko.cloud/en/alternative-managed-kubernetes/#respond</comments>
		
		<dc:creator><![CDATA[David Pujadas]]></dc:creator>
		<pubDate>Tue, 03 Nov 2020 08:16:16 +0000</pubDate>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[Kubernetes]]></category>
		<guid isPermaLink="false">https://geko2.factoryfy.com/alternative-managed-kubernetes/</guid>

					<description><![CDATA[<p>Introduction We are all familiar with the &#8220;big three&#8221; offer in managed Kubernetes: EKS, GKE and AKS. But today, apart from the former and a few more who want to play in the same league (Oracle or IBM, for example), there are other less well-known providers that, unable to compete with the service catalog, try [&#8230;]</p>
<p>La entrada <a href="https://geko.cloud/en/alternative-managed-kubernetes/">“Alternative” managed Kubernetes</a> se publicó primero en <a href="https://geko.cloud/en/">Geko Cloud</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3>Introduction</h3>
<p>We are all familiar with the &#8220;big three&#8221; offer in <strong>managed <a href="https://geko.cloud/en/what-is-kubernetes/">Kubernetes</a></strong>: EKS, GKE and AKS.</p>
<p>But today, apart from the former and a few more who want to play in the same league (Oracle or IBM, for example), there are other less well-known providers that, unable to compete with the service catalog, try to make a name for themselves by offering simplicity and lower prices. One of the benefits of <a href="https://geko.cloud/en/what-is-kubernetes/"><strong>Kubernetes</strong></a> &#8220;explosion&#8221; is that with it and little more (a load balancer, some block and object storage and a managed database) you can go very far before needing what the big ones offer.</p>
<p>So, when we talk about &#8220;simple and cheap&#8221; <a href="https://geko.cloud/en/what-is-kubernetes/"><strong>Kubernetes</strong></a>, the formula is to offer the &#8220;<strong>managed Kubernetes</strong>&#8221; service (the master nodes are hosted and managed by the provider) without charging for it. And this is exactly what alternatives such as Scaleway, Linode, OVH or <strong>DigitalOcean</strong> provide.</p>
<h3>Testing a managed cluster</h3>
<p>At <a href="https://geko.cloud/en/"><strong>Geko Cloud</strong></a> we are developing a product based on <a href="https://geko.cloud/en/what-is-kubernetes/"><strong>Kubernetes</strong></a> that you will soon hear more about, so we decided to use it to test one of the services on the list (in this case, <strong>Digital Ocean Kubernetes Service</strong>).</p>
<p><strong>Creating a cluster</strong> is very simple: just select the version, the region, the type of node for the pool and give it a name:</p>
<figure id="attachment_5398" aria-describedby="caption-attachment-5398" style="width: 686px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-large wp-image-5398" src="https://geko.cloud/wp-content/uploads/2020/11/control-panel-digitalocean-1-686x1024.png" alt="Control Panel DigitalOcean" width="686" height="1024" srcset="https://geko.cloud/wp-content/uploads/2020/11/control-panel-digitalocean-1-686x1024.png 686w, https://geko.cloud/wp-content/uploads/2020/11/control-panel-digitalocean-1-201x300.png 201w, https://geko.cloud/wp-content/uploads/2020/11/control-panel-digitalocean-1-768x1146.png 768w, https://geko.cloud/wp-content/uploads/2020/11/control-panel-digitalocean-1-1029x1536.png 1029w, https://geko.cloud/wp-content/uploads/2020/11/control-panel-digitalocean-1.png 1200w" sizes="(max-width: 686px) 100vw, 686px" /><figcaption id="caption-attachment-5398" class="wp-caption-text">Creación cluster k8s DO</figcaption></figure>
<p>In our case, since this was a test, we chose to create <strong>basic droplets</strong> and rely on the cluster autoscaler in case the application would need more resources.</p>
<p>When the cluster was ready (the process can take about 10-15 minutes), we only had to download the kubeconfig file and launch the application installation process. And then the problems began.</p>
<h3>Observed problems</h3>
<p>After a while, <strong>the API server became unresponsive, responding very slowly or returning several errors</strong>. Symptoms:</p>
<ul>
<li>Very high response times, sometimes even more than a minute
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">bash-5.0# time kubectl get pods -A
NAMESPACE NAME READY STATUS RESTARTS AGE
istio-system istio-init-crd-10-1.4.8-86xf9 1/1 Running 1 7m1s
…
real 1m14.507s
user 0m0.174s
sys 0m0.028s</pre>
</div>
</li>
<li>Connection errors
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">bash-5.0# kubectl get pods -A
Unable to connect to the server: unexpected EOF</pre>
</div>
</li>
<li>Timeouts in the TLS handshake
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">bash-5.0# kubectl get pods -A
Unable to connect to the server: net/http: TLS handshake timeout</pre>
</div>
</li>
</ul>
<p>The problem had to be related with the installation because, before that, everything worked perfectly.</p>
<p><strong>DigitalOcean</strong>, like the other providers, does not offer any information about the resources dedicated to the master nodes (number of nodes, node size&#8230;) nor access to the <strong>control plane logs or monitoring</strong>, so there was no way to know what was happening.</p>
<p>A quick search made us realize that we were not alone with this kind of problems, although we also saw that many others were happy users of the service.</p>
<h3>Solution</h3>
<p>This made us suspect that <strong>not all master nodes were created equally</strong>, and that the only parameter in the creation process that could make the difference was the configured node pool.</p>
<p>In order to verify our theory, we first tried to <strong>create a cluster with a node pool with more nodes</strong> (from 3 to 6), with identical results.</p>
<p>So we tried to <strong>create a node pool with non-basic nodes</strong> (<strong>CPU-Optimized</strong> in this case). And there we hit the nail on the head: the installation process finished smoothly and the <strong>API server</strong> responded properly all the time.</p>
<h3>Conclusion</h3>
<p>It is obvious that nobody gives anything away and that you cannot expect to have a dedicated master node with 16 cores and 64 Gb of RAM paying 20 euros a month for a basic droplet. Anyway, it wouldn&#8217;t hurt if they were a little more transparent and informed about the capabilities and limitations of the service they are offering (even if it is free). In this way, more than one would avoid some headaches and frustrations.</p>
<p>So if you are planning to use this service to host an application that is going to make some intensive use of the <strong>API server</strong>, you&#8217;d better opt for non-basic droplets if you don&#8217;t want to have performance problems.</p>
<p>And remember that if you need anything <a href="https://geko.cloud/en/contact/">we will be happy to listen to you</a>, and you can also check our blog <a href="https://geko.cloud/en/blog/labs/">to find other useful posts</a> like this one!</p>
<p>La entrada <a href="https://geko.cloud/en/alternative-managed-kubernetes/">“Alternative” managed Kubernetes</a> se publicó primero en <a href="https://geko.cloud/en/">Geko Cloud</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://geko.cloud/en/alternative-managed-kubernetes/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How-to: Install cert-manager with HTTP validation in Kubernetes</title>
		<link>https://geko.cloud/en/how-to-install-cert-manager-with-http-validation-in-kubernetes/</link>
					<comments>https://geko.cloud/en/how-to-install-cert-manager-with-http-validation-in-kubernetes/#respond</comments>
		
		<dc:creator><![CDATA[Xavi Miranda]]></dc:creator>
		<pubDate>Fri, 30 Oct 2020 08:48:31 +0000</pubDate>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[Kubernetes]]></category>
		<category><![CDATA[Ngnix]]></category>
		<guid isPermaLink="false">https://geko2.factoryfy.com/how-to-install-cert-manager-with-http-validation-in-kubernetes/</guid>

					<description><![CDATA[<p>Struggling with certificates can be a headache, but luckily for us in Kubernetes we can use cert-manager and let it manage everything to easily create any certificate that we need. In this how-to we will cover how to install cert-manager in our cluster as well as how to perform HTTP validation. We will also learn [&#8230;]</p>
<p>La entrada <a href="https://geko.cloud/en/how-to-install-cert-manager-with-http-validation-in-kubernetes/">How-to: Install cert-manager with HTTP validation in Kubernetes</a> se publicó primero en <a href="https://geko.cloud/en/">Geko Cloud</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Struggling with certificates can be a headache, but luckily for us in <a href="https://geko.cloud/en/what-is-kubernetes/"><b>Kubernetes</b></a> we can use <b>cert-manager</b> and let it manage everything to easily create any certificate that we need.</p>
<p>In this <b>how-to</b> we will cover how to install <b>cert-manager</b> in our cluster as well as how to perform <b>HTTP validation</b>. We will also learn how to <b>create a new certificate</b> for our host by just <b>appending an annotation</b> to our ingress object.</p>
<h3>Sounds good! What do I need?</h3>
<p>I expect you to meet the following requirements:</p>
<ul>
<li>You have a working <b>k8s cluster</b> with nginx ingress-controller</li>
<li>You have <b>helm</b> installed (read <b><a href="https://geko.cloud/en/install-grafana-ldap-kubernetes-helm/">how to install helm</a></b>)</li>
<li>You have a domain you own targeting your cluster</li>
<li>Desire to learn new things <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></li>
</ul>
<h3>Let&#8217;s start!</h3>
<p>First of all we need to add the helm chart repository for cert-manager:</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">helm repo add jetstack https://charts.jetstack.io</pre>
</div>
<p>Now, we proceed to create the namespace and deploy cert-manager in it:</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">kubectl create ns cert-manager
helm upgrade --install cert-manager 
  --namespace cert-manager 
  --version v1.0.3 
  jetstack/cert-manager 
  --set installCRDs=true</pre>
</div>
<p>Just give it a few seconds to finish and you should receive a success message.</p>
<h3>Creating a ClusterIssuer</h3>
<p>We can use either an <b>Issuer</b> or a <b>ClusterIssuer</b> (namespace vs cluster-scoped). It&#8217;s the same exact thing, only changes the scope. The Issuer/ClusterIssuer represents the CA from which we want to get the new certificate, in this case we are using <b>LetsEncrypt</b>.</p>
<p>Note that the ClusterIssuer is actually a pretty simple object. The name and the secret name can be anything:</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">apiVersion: cert-manager.io/v1alpha3
kind: ClusterIssuer
metadata:
  name: my-cluster-issuer
spec:
  acme:
    email: {{ your email }}
    privateKeySecretRef:
      name: my-cluster-issuer
    server: https://acme-v02.api.letsencrypt.org/directory
    solvers:
      - http01:
         ingress:
           class: nginx</pre>
</div>
<h3>Issuing a new certificate</h3>
<p>We are going to deploy a simple nginx, expose it as a service and then create an ingress for it. So, go ahead:</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">kubectl create deployment nginx --image nginx:alpine --namespace test
kubectl expose deployment nginx --port 80 --target-port 80 --namespace test</pre>
</div>
<p>Create a new ingress object to make it accessible through the ingress controller. Remember to replace with your actual domain in all ocurrences:</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
  labels:
    app: nginx
  name: nginx
  namespace: test
spec:
  rules:
  - host: nginx.{{ your domain }}
    http:
      paths:
      - backend:
          serviceName: nginx
          servicePort: 80
        path: /
  tls:
  - hosts:
    - nginx.{{ your domain }}
    secretName: nginx-certificate</pre>
</div>
<p>Apply the new manifest:</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">kubectl apply -f ingress.yaml</pre>
</div>
<p>If you try to access now to the host defined in the ingress, you&#8217;ll see an error message stating that &#8220;Your connection is not private&#8221;. To fix this, we are going to <b>issue a new certificate</b>. Edit the ingress that you just created and add the following annotation, replacing the value for whichever was the name you put in your ClusterIssuer:</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">cert-manager.io/cluster-issuer: my-cluster-issuer</pre>
</div>
<p>Apply the ingress again (or save changes if your editing it) and now try to check the &#8220;cert&#8221; objects. You should get something like this:</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">kubectl get cert -n test

NAME                READY   SECRET              AGE
nginx-certificate   False   nginx-certificate   21s
</pre>
</div>
<p>Now wait for about 1 or 2 minutes and when you check again&#8230;</p>
<div class="wp-block-codemirror-blocks code-block ">
<pre class="CodeMirror" data-setting="{">kubectl get cert -n test

NAME                READY   SECRET              AGE
nginx-certificate   <b>True</b>    nginx-certificate   93s</pre>
</div>
<p>&#8230;we got our certificate! Go test it by refreshing the page or just opening a new tab and you should get the Nginx welcome screen. If you inspect the certificate you&#8217;ll see that it was indeed issued by LetsEncrypt:</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-2793" src="https://geko2.factoryfy.com/wp-content/uploads/nginx_valid_cert-1.png" alt="Nginx letsencrypt certificate by cert-manager" width="1000" height="164" /></p>
<h3>Summarizing</h3>
<p>What we saw here is:</p>
<ul>
<li>How to install cert-manager</li>
<li>How to setup a new ClusterIssuer</li>
<li>How to easily issue a new certificate</li>
</ul>
<p>It was pretty easy overall, don&#8217;t you think so? In fact, when you know what to do you can easily replicate this setup virtually to any cluster in a matter of very few minutes.</p>
<p>Cert-manager will take care of all your <b>certificate renewals</b>. You can also create other Issuers or ClusterIssuers that support other CA or use other validation methods (DNS validation) but this is a more advance topic for the future.</p>
<p>I hope that you enjoyed this how-to and that it will be useful to you. Remember that if you need anything <a href="https://geko.cloud/en/contact/">we will be glad to hear from you</a>! Also check our blog for <a href="https://geko.cloud/en/blog/labs/">more useful posts</a> like this one!</p>
<p>La entrada <a href="https://geko.cloud/en/how-to-install-cert-manager-with-http-validation-in-kubernetes/">How-to: Install cert-manager with HTTP validation in Kubernetes</a> se publicó primero en <a href="https://geko.cloud/en/">Geko Cloud</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://geko.cloud/en/how-to-install-cert-manager-with-http-validation-in-kubernetes/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
