KubectlConfigSetCredentialsSettings Class

Summary

Sets 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-

Attributes

Type Description
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
EmbedCerts Nullable<bool>
--embed-certs Embed client cert/key 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) T
Throws a System.ArgumentNullException if the value is null, otherwise returns the value
Requires the Cake.Incubator 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