Skip to main content
This guide walks you through generating a kubeconfig for a Kubernetes Service Account using omnictl.

Prerequisites

To follow this guide, you must have:
Kubernetes Service Accounts authenticate to a Kubernetes cluster. If you need to authenticate to Omni itself, see Omni Service Accounts instead.

Create the Kubernetes service account kubeconfig

Run the following command to generate the kubeconfig:
Replace the placeholders with your own values:
  • <cluster>: The name of your cluster in Omni
  • <username>: Any username you want to assign to the service account
  • <path to kubeconfig>: The file path where the kubeconfig will be written
This creates a service account token with the specified username and writes a kubeconfig for the given cluster to the path you provided. You can then use this kubeconfig with kubectl as normal. To invalidate the kubeconfig before its token expires, see Revoke Kubernetes Access Tokens.