<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Kubernetes on Samarthya</title><link>https://samarthya.me/categories/kubernetes/</link><description>Recent content in Kubernetes on Samarthya</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>© Samarthya 2018-2026. All rights reserved.</copyright><lastBuildDate>Wed, 16 Feb 2022 12:00:00 +0000</lastBuildDate><atom:link href="https://samarthya.me/categories/kubernetes/index.xml" rel="self" type="application/rss+xml"/><item><title>ServiceAccount</title><link>https://samarthya.me/posts/serviceaccount/</link><pubDate>Wed, 16 Feb 2022 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/serviceaccount/</guid><description>&lt;p&gt;If you have seen errors like these when deploying using a &lt;code&gt;serviceAccount&lt;/code&gt;&lt;/p&gt;&#10;&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists. Unable to continue with install: could not get information about the resource ConfigMap &amp;#34;spinnaker-hellow-pipline&amp;#34; in namespace &amp;#34;spinnaker&amp;#34;: configmaps &amp;#34;spinnaker-hellow-pipline&amp;#34; is forbidden: User &amp;#34;system:serviceaccount:jenkins:default&amp;#34; cannot get resource &amp;#34;configmaps&amp;#34; in API group &amp;#34;&amp;#34; in the namespace &amp;#34;spinnaker&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&#10;&lt;h2 class="relative group"&gt;What?&#10; &lt;div id="what" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#what" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;A service account provides an identity for processes that run in a Pod.&lt;/li&gt;&#10;&lt;li&gt;Every namespace has a default &lt;code&gt;service account&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;When you create a pod, if you do not specify a service account, it is automatically assigned the &lt;code&gt;default&lt;/code&gt; service account in the same namespace.&lt;/li&gt;&#10;&lt;li&gt;To use a non-default service account, set the &lt;code&gt;spec.serviceAccountName&lt;/code&gt; field of a pod to the name of the service account you wish to use.&lt;/li&gt;&#10;&lt;li&gt;The service account has to exist at the time the pod is created, or it will be rejected.&lt;/li&gt;&#10;&lt;li&gt;The service account of an already created pod cannot be updated&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;div class="lead text-neutral-500 dark:text-neutral-400 !mb-9 text-xl"&gt;&#10; Default RBAC policies grant scoped permissions to control-plane components, &lt;code&gt;nodes&lt;/code&gt;, and &lt;code&gt;controllers&lt;/code&gt;, but grant &lt;em&gt;no permissions&lt;/em&gt; to service accounts outside the &lt;code&gt;kube-system&lt;/code&gt; namespace (beyond discovery permissions given to all authenticated users).&#10;— Official documentation&#10;&lt;/div&gt;&#10;&#10;&#10;&lt;h2 class="relative group"&gt;Example&#10; &lt;div id="example" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#example" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;apiVersion: v1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kind: ServiceAccount&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;metadata:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; creationTimestamp: &amp;#34;2021-08-27T07:52:20Z&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; name: default&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; namespace: default&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; resourceVersion: &amp;#34;XXXX&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; uid: XXXX&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;secrets:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- name: default-token-vcb75&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;p&gt;Let’s add docker-registry secret to the &lt;code&gt;SA&lt;/code&gt;. (My secret name is samarthya-docker)&lt;/p&gt;</description></item><item><title>`Devspace`: Managing Apps in Kubernetes</title><link>https://samarthya.me/posts/devspace-managing-apps-in-kubernetes/</link><pubDate>Tue, 15 Feb 2022 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/devspace-managing-apps-in-kubernetes/</guid><description>&lt;h2 class="relative group"&gt;What is &lt;code&gt;devspace&lt;/code&gt;?&#10; &lt;div id="what-is-devspace" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#what-is-devspace" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;&lt;code&gt;devspace&lt;/code&gt; is a CLI tool for kubernetes, which can help you configure, deploy, debug. and test your application inside Kubernetes.&lt;/p&gt;</description></item><item><title>Kaniko: Jenkins Pipeline</title><link>https://samarthya.me/posts/kaniko-jenkins-pipeline/</link><pubDate>Fri, 11 Feb 2022 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/kaniko-jenkins-pipeline/</guid><description>&lt;p&gt;So there are many things I have been simultaneously trying to learn &amp;amp; one of those is to learn how you can configure a pipeline&lt;/p&gt;&#10;&lt;div class="lead text-neutral-500 dark:text-neutral-400 !mb-9 text-xl"&gt;&#10; Read more about Pipeline as Code (PaC)&#10;&lt;/div&gt;&#10;&#10;&#10;&lt;h2 class="relative group"&gt;Objectives&#10; &lt;div id="objectives" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#objectives" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Learn Jenkins deployment on Kubernetes&lt;/li&gt;&#10;&lt;li&gt;Learn Jenkins Kubernetes Plugin&lt;/li&gt;&#10;&lt;li&gt;Learn Jenkins Pipeline (&lt;code&gt;Declarative&lt;/code&gt;)&lt;/li&gt;&#10;&lt;li&gt;How to build and deploy images in Kubernetes cluster&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;All right, with so many monkeys on my back I had to do things the way I know it works for me.&lt;/p&gt;</description></item><item><title>Kafka: Deploy &amp; Test</title><link>https://samarthya.me/posts/kafka-deploy-test/</link><pubDate>Fri, 11 Feb 2022 08:17:19 +0000</pubDate><guid>https://samarthya.me/posts/kafka-deploy-test/</guid><description>&lt;p&gt;While I continue to learn more about architecture and design of &lt;code&gt;kafka&lt;/code&gt;, a quickstart to deploy &amp;amp; test kafka is a must.&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;Step 1: Add Chart Repo&#10; &lt;div id="step-1-add-chart-repo" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#step-1-add-chart-repo" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;In my local system it is already present which was confirmed by the listing&lt;/p&gt;</description></item><item><title>Spinnaker: Open Source Deployment</title><link>https://samarthya.me/posts/spinnaker-open-source-deployment/</link><pubDate>Sat, 05 Feb 2022 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/spinnaker-open-source-deployment/</guid><description>&lt;p&gt;I have written a series of blogs to capture how you can deploy spinnaker on a &lt;code&gt;Kubernetes&lt;/code&gt; cluster &amp;amp; manage a helm chart deployment via pipeline.&lt;/p&gt;&#10;&lt;blockquote&gt;&lt;p&gt;The only way to enable more frequent changes is to invest in supporting people with better tooling, practices, and culture&lt;/p&gt;&#10;&lt;p&gt;From the Book &lt;code&gt;Spinnaker&lt;/code&gt;&lt;/p&gt;&#10;&lt;/blockquote&gt;</description></item><item><title>Jenkins: K8S</title><link>https://samarthya.me/posts/jenkins-k8s/</link><pubDate>Wed, 02 Feb 2022 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/jenkins-k8s/</guid><description>&lt;p&gt;Deploying Jenkins on K8S cluster is as simple as&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;Add Repo&#10; &lt;div id="add-repo" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#add-repo" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;helm repo add jenkins https://charts.jenkins.io&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;helm repo update&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;p&gt;Deploy instance&lt;/p&gt;</description></item><item><title>Adding Node to a cluster</title><link>https://samarthya.me/posts/adding-node-to-a-cluster/</link><pubDate>Thu, 06 Jan 2022 06:58:31 +0000</pubDate><guid>https://samarthya.me/posts/adding-node-to-a-cluster/</guid><description>&lt;p&gt;In this blog, I will try add a new node to the already running cluster.&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;My Cluster&#10; &lt;div id="my-cluster" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#my-cluster" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;root@master&amp;gt;k get nodes&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;NAME STATUS ROLES AGE VERSION&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mydevmachine001830.samarthya.me Ready &amp;lt;none&amp;gt; 22h v1.23.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mydevmachine002687.samarthya.me Ready &amp;lt;none&amp;gt; 41d v1.23.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mydevmachine003277.samarthya.me Ready &amp;lt;none&amp;gt; 131d v1.23.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mydevmachine003278.samarthya.me Ready &amp;lt;none&amp;gt; 131d v1.23.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mydevmachine003417.samarthya.me Ready &amp;lt;none&amp;gt; 4m55s v1.23.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mydevmachine003968.samarthya.me Ready &amp;lt;none&amp;gt; 131d v1.23.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mydevmachine003969.samarthya.me Ready control-plane,master 131d v1.23.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mydevmachine003970.samarthya.me Ready &amp;lt;none&amp;gt; 131d v1.23.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mydevmachine003979.samarthya.me Ready &amp;lt;none&amp;gt; 29m v1.23.1&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&#10;&lt;h2 class="relative group"&gt;Steps to follow&#10; &lt;div id="steps-to-follow" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#steps-to-follow" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Install &lt;code&gt;docker&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;Install &lt;code&gt;kubeadm&lt;/code&gt;, &lt;code&gt;kubectl&lt;/code&gt; &amp;amp; &lt;code&gt;kubelet&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;Join the cluster using the token&lt;/li&gt;&#10;&lt;li&gt;Check the node has joined the cluster&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;h3 class="relative group"&gt;Step 1: Install docker&#10; &lt;div id="step-1-install-docker" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#step-1-install-docker" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h3&gt;&#10;&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo yum install -y yum-utils&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo yum-config-manager \&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --add-repo \&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; https://download.docker.com/linux/centos/docker-ce.repo&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;p&gt;When adding repo make sure the repo has been added successfully to the machine&lt;/p&gt;</description></item><item><title>Upgrading K8S cluster</title><link>https://samarthya.me/posts/upgrading-k8s-cluster/</link><pubDate>Wed, 05 Jan 2022 07:05:30 +0000</pubDate><guid>https://samarthya.me/posts/upgrading-k8s-cluster/</guid><description>&lt;p&gt;In this blog I will talk about how you can upgrade a node and the kubernetes cluster version to a specific version.&lt;/p&gt;&#10;&lt;p&gt;I have a 6 node local Kubernetes cluster like below&lt;/p&gt;</description></item><item><title>K8S RBAC</title><link>https://samarthya.me/posts/k8s-rbac/</link><pubDate>Mon, 13 Dec 2021 13:03:56 +0000</pubDate><guid>https://samarthya.me/posts/k8s-rbac/</guid><description>&lt;h2 class="relative group"&gt;What?&#10; &lt;div id="what" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#what" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Role Based Access Control(s) is a way of regulating access to entities like storage, network etc.&lt;/li&gt;&#10;&lt;li&gt;RBAC authorization uses &lt;code&gt;rbac.authorization.k8s.io&lt;/code&gt; API group.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;h2 class="relative group"&gt;API Objects&#10; &lt;div id="api-objects" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#api-objects" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;There are 4 kind of kubernetes object&lt;/p&gt;</description></item><item><title>CALICO CNI failures</title><link>https://samarthya.me/posts/calico-cni-failures/</link><pubDate>Thu, 28 Oct 2021 07:46:58 +0000</pubDate><guid>https://samarthya.me/posts/calico-cni-failures/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt="kubectl output listing ingress, Dynatrace simulator and calico-kube-controllers pods; the Calico controller shows several restarts"&#10; width="768"&#10; height="93"&#10; src="https://samarthya.me/posts/calico-cni-failures/screenshot-2021-10-28-at-1.15.23-pm-1.png"&#10; srcset="https://samarthya.me/posts/calico-cni-failures/screenshot-2021-10-28-at-1.15.23-pm-1.png 800w, https://samarthya.me/posts/calico-cni-failures/screenshot-2021-10-28-at-1.15.23-pm-1.png 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/calico-cni-failures/screenshot-2021-10-28-at-1.15.23-pm-1.png"&gt;&lt;/figure&gt;&#10;&lt;p&gt;In my cluster things went haywire all of a sudden without a proper showcase, I tried multiple things but it was just not working. Specifically my &lt;code&gt;core-dns&lt;/code&gt; and &lt;code&gt;calico-kube-controllers&lt;/code&gt; were not coming up and were constantly showing &lt;code&gt;not ready&lt;/code&gt; and &lt;code&gt;CrashLoop&lt;/code&gt; respectively&lt;/p&gt;</description></item></channel></rss>