<p>I am using Kubernetes version 1.24, I have created a secret for my service account manually, but when I run <code>kubectl get serviceaccounts</code>, it is showing that I do not have any secrets for that service account?</p>

Coder3000
<p>If you are on K8s version <strong>1.24</strong></p>
<p>The <strong>serviceaccount</strong> won't create the <strong>secret</strong> automatically.</p>
<p>You have to create it manually.</p>
<pre><code>kubectl create sa &lt;serviceaccount-name&gt;
</code></pre>
<p><strong>Example</strong> :</p>
<pre><code>apiVersion: v1
kind: Secret
type: kubernetes.io/service-account-token
metadata:
  name: token-secret
  annotations:
    kubernetes.io/service-account.name: &quot;&lt;SA name&gt;&quot;
</code></pre>
<p>If you just want to <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#manually-create-an-api-token-for-a-serviceaccount" rel="nofollow noreferrer">create the</a> <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#manually-create-an-api-token-for-a-serviceaccount" rel="nofollow noreferrer">token</a> you can use the : <code>kubectl create token &lt;Name&gt;</code></p>
<p>Read more about it : <a href="https://medium.com/@harsh.manvar111/k8s-v1-24-is-unable-to-create-a-serviceaccount-secret-798f8454e6e7" rel="nofollow noreferrer">https://medium.com/@harsh.manvar111/k8s-v1-24-is-unable-to-create-a-serviceaccount-secret-798f8454e6e7</a></p>
