<?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/tags/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/tags/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>Cert-Manager: TLS for ingress</title><link>https://samarthya.me/posts/cert-manager-tls-for-ingress/</link><pubDate>Wed, 09 Feb 2022 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/cert-manager-tls-for-ingress/</guid><description>&lt;p&gt;A common use-case for cert-manager is requesting TLS signed certificates to secure your ingress resources.&lt;/p&gt;&#10;&lt;div class="lead text-neutral-500 dark:text-neutral-400 !mb-9 text-xl"&gt;&#10; &lt;code&gt;cert-manager&lt;/code&gt; adds certificates and certificate issuers as resource types in Kubernetes clusters, and simplifies the process of obtaining, renewing and using those certificates.&#10;&lt;/div&gt;&#10;&#10;&#10;&lt;h2 class="relative group"&gt;Installation&#10; &lt;div id="installation" 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="#installation" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;The easiest way is to use helm charts.&lt;/p&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></channel></rss>