rpk ai service-account apply
Reconcile service accounts from one or more YAML manifests.
For each manifest: create the resource if absent, otherwise update every field that differs from the live resource. A manifest is the COMPLETE desired state, so a field you omit is not left alone - it is compared against the value a create from that manifest would have produced, and reconciled to it. Lists, maps and oneof variants replace wholesale. Fields that can only be set at creation time are immutable; changing one is an error.
Manifests round-trip with get -o yaml for this resource, which is how to
start from a complete one. Pass -f - to read stdin.
This does not delete resources absent from the manifests (no prune); see
diff --help.
A manifest names the account by its full resource name,
serviceAccounts/<id>, as get -o yaml prints it. Description and tags are the
fields apply writes. Tags replace as a whole, so a manifest without tags
removes them all.
Apply creates the account, not a credential: mint its API key with
api-key create --service-account serviceAccounts/<id>.
An account that someone else changes while apply runs is not overwritten. Apply fails on it, and running apply again reconciles against the new state. An API key cannot change the service account it belongs to, so run apply as another identity for that account.
Examples
This section provides examples of how to use rpk ai service-account apply.
ci-bot.yaml
name: serviceAccounts/ci-bot
description: CI publisher
tags:
env: prod
team: data
rpk ai service-account diff -f ci-bot.yaml
rpk ai service-account apply -f ci-bot.yaml
Flags
| Value | Type | Description |
|---|---|---|
|
strings |
manifest file, directory, or - for stdin ( |
Global flags
| Value | Type | Description |
|---|---|---|
|
string |
Redpanda or |
|
stringArray |
Override |
|
bool |
Ignore |
|
string |
|
|
bool |
Enable verbose logging. |