For Kubernetes cluster access, see Kubernetes Service Accounts instead.
Prerequisites
You must install and configureomnictl 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:
--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:
OMNI_ENDPOINT and OMNI_SERVICE_ACCOUNT_KEY.
Export both values as environment variables:
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: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: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:
omnictl serviceaccount destroy <sa-name>.