<p>I downloaded Kubernetes for integration with Jenkins and created a Serviceaccount, but the secret is not automatically created.</p>
<p>In the past, I remember that a Secret was automatically created and the Token was mounted when Serviceaccount was created.</p>
<p>How can I automatically create a Secret as before?</p>

<p>As mentioned by @P.... In kubernetes version 1.24 this behaviour has been changed, the <strong>LegacyServiceAccountTokenNoAutoGeneration</strong> feature gate is enabled by default in 1.24.</p>
<p>New secrets containing service account tokens are no longer auto-generated and are not automatically ambient in secrets in 1.24+. Existing secrets containing service account tokens are still usable.</p>
<p>API clients scraping token content from auto-generated Secret API objects must start using the <a href="https://kubernetes.io/docs/reference/kubernetes-api/authentication-resources/token-request-v1/" rel="noreferrer">TokenRequest API</a> to obtain a token (preferred, available in all supported versions), or you can explicitly request a secret-based token if a secret-based token is desired/needed.</p>
<p>Refer <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#manually-create-a-service-account-api-token" rel="noreferrer">manually create a service account API token</a> to explicitly request a secret-based token.</p>
