Updated on 2025-04-03 GMT+08:00

ccictl config set-credentials

Scenario

Set a user entry in cliconfig.

  • Specifying a name that already exists will merge new fields on top of existing values for those fields.

    Client certificate flag: --client-certificate=certfile --client-key=keyfile

    Bearer token flag: --token=bearer_token

    Basic authentication flag: --username=basic_user --password=basic_password

  • The bearer token and basic authentication are mutually exclusive (cannot be used at the same time).
ccictl config set-credentials NAME [--client-certificate=path/to/certfile] [--client-key=path/to/keyfile] [--token=bearer_token] [--username=basic_user] [--password=basic_password] [--auth-provider=provider_name] [--auth-provider-arg=key=value] [--exec-command=exec_command] [--exec-api-version=exec_api_version] [--exec-arg=arg] [--exec-env=key=value]

Examples

# Set only the client-key field in the cluster-admin entry.
ccictl config set-credentials cluster-admin --client-key=~/.kubev2/admin.key

# Set basic identity authentication for the cluster-admin entry.
ccictl config set-credentials cluster-admin --username=admin --password=uXFGweU9l35qcif

# Embed the client certificate data in the cluster-admin entry.
ccictl config set-credentials cluster-admin --client-certificate=~/.kubev2/admin.crt --embed-certs=true

# Enable the IAM identity authentication provider for the cluster-admin entry.
ccictl config set-credentials cluster-admin --auth-provider=iam --auth-provider-arg=iam-endpoint=example.com

# Delete the iam-endpoint configuration value of the IAM identity provider for the cluster-admin entry.
ccictl config set-credentials cluster-admin --auth-provider=iam --auth-provider-arg=iam-endpoint-

# Enable the new exec authentication plug-in for the cluster-admin entry.
ccictl config set-credentials cluster-admin --exec-command=/path/to/the/executable --exec-api-version=client.authentication.k8s.io/v1beta1

# Define the new exec authentication plug-in for the cluster-admin entry.
ccictl config set-credentials cluster-admin --exec-arg=arg1 --exec-arg=arg2

# Create or update the exec authentication plug-in arguments for the cluster-admin entry.
ccictl config set-credentials cluster-admin --exec-env=key1=val1 --exec-env=key2=val2

# Delete the exec authentication plug-in arguments for the cluster-admin entry.
ccictl config set-credentials cluster-admin --exec-env=var-to-remove-

Options

--auth-provider string

Authentication provider for user entries in cliconfig

--auth-provider-arg strings

Identity authentication provider arguments, in the format of key=value

--client-certificate string

Path to the client certificate file for the user entry in cliconfig

--client-key string

Path to the client key file for the user entry in cliconfig

--embed-certs tristate[=true]

Embed the client certificate/key for the user entry in cliconfig.

--exec-api-version string

API version of the exec credential plug-in for the user entry in cliconfig

--exec-arg strings

New arguments for the exec credential plug-in command for the user entry in cliconfig

--exec-command string

Command for the exec credential plug-in command for the user entry in cliconfig

--exec-env strings

Environment variables for the exec credential plug-in, in the key=value format

-h, --help

Help information for set-credentials

--password string

Password for the user entry in cliconfig

--token string

Token for the user entry in cliconfig

--username string

Username for the user entry in cliconfig

The following ccictl options can also be used in subcommands:

Parent command options