> ## Documentation Index
> Fetch the complete documentation index at: https://siderolabs-fe86397c-1-11-reference.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Kubeconfig for a Kubernetes Service Account

To follow this guide, you will need `omnictl` installed and configured. If you haven't done so already, follow the [`omnictl` guide](../getting-started/install-and-configure-omnictl) You will also need also need a cluster created withing Omni.

<Info>
  Note that Omni also supports [Omni Service Accounts](../omni-cluster-setup/create-an-omni-service-account), which provide authentication to Omni itself. Kubernetes Service Accounts are used to authenticate to a Kubernetes cluster, not Omni.
</Info>

### Creating the Kubernetes Service Account Kubeconfig

To create a service account kubeconfig, run the following command:

```bash
omnictl kubeconfig --service-account -c <cluster> --user <username> <path to kubeconfig>
```

<Info>
  &#x20;Replace `<path to kubeconfig>` with a path where the kubeconfig file should be written. Replace `<cluster>` with the name of the cluster in Omni. Replace `<username>` with any value you would like.&#x20;
</Info>

This command will create a service account token with the given username and obtain a kubeconfig file for the given cluster and username.

You can now use `kubectl` with the generated kubeconfig.
