KubectlConfigSetCredentialsSettings Class

Summary

Set a user entry in kubeconfig. Specifying a name that already exists will merge new fields on top of existing values. Client-certificate flags: --client-certificate=certfile --client-key=keyfile Bearer token flags: --token=bearer_token Basic auth flags: --username=basic_user --password=basic_password Bearer token and basic auth are mutually exclusive.
Assembly
Cake.Kubectl.dll
Namespace
Cake.Kubectl
Base Types
graph BT Type-->Base0["AutoToolSettings"] click Base0 "/api/Cake.Kubectl/AutoToolSettings" Base0-->Base1["ToolSettings"] Type["KubectlConfigSetCredentialsSettings"] class Type type-node

Syntax

public sealed class KubectlConfigSetCredentialsSettings : AutoToolSettings

Examples

# Set only the "client-key" field on the "cluster-admin" # entry, without touching other values kubectl config set-credentials cluster-admin --client-key=~/.kube/admin.key # Set basic auth for the "cluster-admin" entry kubectl config set-credentials cluster-admin --username=admin --password=uXFGweU9l35qcif # Embed client certificate data in the "cluster-admin" entry kubectl config set-credentials cluster-admin --client-certificate=~/.kube/admin.crt --embed-certs=true # Enable the Google Compute Platform auth provider for the "cluster-admin" entry kubectl config set-credentials cluster-admin --auth-provider=gcp # Enable the OpenID Connect auth provider for the "cluster-admin" entry with additional args kubectl config set-credentials cluster-admin --auth-provider=oidc --auth-provider-arg=client-id=foo --auth-provider-arg=client-secret=bar # Remove the "client-secret" config value for the OpenID Connect auth provider for the "cluster-admin" entry kubectl config set-credentials cluster-admin --auth-provider=oidc --auth-provider-arg=client-secret- # Enable new exec auth plugin for the "cluster-admin" entry kubectl config set-credentials cluster-admin --exec-command=/path/to/the/executable --exec-api-version=client.authentication.k8s.io/v1beta1 # Define new exec auth plugin args for the "cluster-admin" entry kubectl config set-credentials cluster-admin --exec-arg=arg1 --exec-arg=arg2 # Create or update exec auth plugin environment variables for the "cluster-admin" entry kubectl config set-credentials cluster-admin --exec-env=key1=val1 --exec-env=key2=val2 # Remove exec auth plugin environment variables for the "cluster-admin" entry kubectl config set-credentials cluster-admin --exec-env=var-to-remove-

Attributes

Type Description
NullableContextAttribute
NullableAttribute
CompilerGeneratedAttribute

Constructors

Properties

Name Value Summary
AuthProvider string
--auth-provider Auth provider for the user entry in kubeconfig
AuthProviderArg string
--auth-provider-arg 'key=value' arguments for the auth provider
ClientCertificate string
--client-certificate Path to client-certificate file for the user entry in kubeconfig
ClientKey string
--client-key Path to client-key file for the user entry in kubeconfig
EmbedCerts Nullable<bool>
--embed-certs Embed client cert/key for the user entry in kubeconfig
ExecApiVersion string
--exec-api-version API version of the exec credential plugin for the user entry in kubeconfig
ExecArg string
--exec-arg New arguments for the exec credential plugin command for the user entry in kubeconfig
ExecCommand string
--exec-command Command for the exec credential plugin for the user entry in kubeconfig
ExecEnv string
--exec-env 'key=value' environment values for the exec credential plugin
Password string
--password password for the user entry in kubeconfig
Token string
--token token for the user entry in kubeconfig
Username string
--username username for the user entry in kubeconfig

Extension Methods

Name Value Summary
Dump<KubectlConfigSetCredentialsSettings>() string
Get a basic string representation of specified object.
Requires the Cake.Incubator addin
IsIn<KubectlConfigSetCredentialsSettings>(KubectlConfigSetCredentialsSettings[]) bool
Checks if the source is contained in a list
Requires the Cake.Incubator addin
NotNull<KubectlConfigSetCredentialsSettings>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Ftp addin
NotNull<KubectlConfigSetCredentialsSettings>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Issues addin
ThrowIfNull<KubectlConfigSetCredentialsSettings>(string, string) T
Throws a System.ArgumentNullException with a specific message if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ThrowIfNull<KubectlConfigSetCredentialsSettings>(string) T
Throws a System.ArgumentNullException if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ToDictionary() IDictionary<string, object>
Requires the Cake.DeployParams addin
ToStringWithNullMarkup() string
Returns the string value or a Not set> markup suitable for Spectre.Console.
Requires the Cake.Issues addin