maqpna context set
Create or update a context
Synopsis#
maqpna context set NAME [--gateway URL] [--identity URL] [--attest URL] [--kube-context C] [--kubeconfig F]
[--namespace NS] [--operator-namespace NS] [--oidc-token-file F] [--use]Description#
From the help of maqpna context:
Contexts are stored in $MAQPNA_CONFIG (default ~/.config/maqpna/config.yaml). The config file holds no secrets: tokens from maqpna login are stored per context in tokens/<NAME>.json next to it with mode 0600. Select a context per invocation with --context NAME or MAQPNA_CONTEXT.
Flags#
| Flag | Type | Description | Default |
|---|---|---|---|
--attest | string | attestation service base URL (version checks) ("-" clears it) | none |
--gateway | string | gateway (admin API) base URL ("-" clears it) | none |
--identity | string | identity broker base URL (version checks) ("-" clears it) | none |
--kube-context | string | kubeconfig context for Kubernetes-backed commands ("-" clears it) | none |
--namespace | string | default agent namespace ("-" clears it) | none |
--oidc-token-file | string | file with an admin-API access token maintained outside maqpna ("-" clears it) | none |
--operator-namespace | string | control-plane namespace (default maqpna-system) ("-" clears it) | none |
--use | switch | also make it the current context | none |
The global flags (--context, -o, --no-color, ...) work with every command.
Examples#
maqpna context set prod --gateway https://gateway.example.eu --kube-context prod-eu --namespace team-a --useWhat happens when you run it#
- Uses the Kubernetes API of your kubeconfig (
--kubeconfig,--kube-context, or the current context). - Talks to the gateway:
--gateway, elseMAQPNA_GATEWAY_URL, else the current context's gateway (maqpna context). - Authenticates to the admin API with the token stored by
maqpna login,--oidc-token-file, or a static--token(MAQPNA_ADMIN_TOKEN). - Prints a table by default;
-o jsonor-o yamlprint the data, and--jq EXPRfilters the JSON.
Exit codes#
| Code | Meaning |
|---|---|
0 | success |
1 | error (the message says what failed, with a hint when there is one) |
2 | usage error: unknown flag, missing argument or bad value; the synopsis is printed |
3 | a check failed, a change is blocked, or a result did not match (tamper, policy mismatch) (not used by this command) |