<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Serviceaccount on Samarthya</title><link>https://samarthya.me/tags/serviceaccount/</link><description>Recent content in Serviceaccount 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/serviceaccount/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></channel></rss>