Skip to main content
Omni service accounts provide token-based authentication to Omni itself, not to the clusters it manages. Use them to grant programmatic access for tools, scripts, or CI pipelines.
For Kubernetes cluster access, see Kubernetes Service Accounts instead.

Prerequisites

You must install and configure omnictl to create and manage Omni service account.

Create the Omni service account

Run the following command to create an Omni service account, replacing <sa-name> with a name for the service account:
By default, the key of the service account expires after 1 year, and the service account gets the role of the user who created it. Use the --ttl flag to change how long the key is valid. To give the service account a different role, pass --role together with --use-user-role=false. Without --use-user-role=false, the --role flag is ignored and the service account gets the role of the user who creates it:
See the command reference for all flags. The command outputs an OMNI_ENDPOINT and OMNI_SERVICE_ACCOUNT_KEY.
Store the OMNI_SERVICE_ACCOUNT_KEY securely as it will not be displayed again.
Export both values as environment variables:
You can now use omnictl with the generated service account.

Rotate a service account key

A service account can have more than one key, and each key can be revoked on its own. To replace a key, for example before it expires, add a new key, switch your tools to it, and then revoke the old key. In the commands below, replace <sa-name> with the name of the service account.

Step 1: Add a new key

Add a new key to the service account:
The command outputs a new OMNI_SERVICE_ACCOUNT_KEY. Existing keys stay valid until they expire or are revoked, so tools that use the old key keep working while you switch them to the new one.

Step 2: Find the ID of the old key

List the keys of your service accounts:
Each key is shown with its PUBLIC KEY ID, when it was created, when it was last used, and when it expires. Note the ID of the key to revoke.

Step 3: Revoke the old key

Revoke the old key, replacing <public-key-id> with the ID from Step 2:
Requests signed with the revoked key are rejected, and the other keys of the service account keep working. The last key of a service account cannot be revoked. To remove all access, delete the service account with omnictl serviceaccount destroy <sa-name>.