Documentation ¶
Overview ¶
Package kubeconfig implements the 'create kubeconfig' command.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Command performs the "create kubeconfig" function Command = &cobra.Command{ Use: "kubeconfig", Short: "Configure kubectl", Long: `Creates or modifies kubectl configuration to access your Giant Swarm Kubernetes cluster By executing this command, you create a new key pair for your cluster to authenticate with as a kubectl user. By default, your kubectl config is modified to add user, cluster, and context entries. The config file is assumed to be in $HOME/.kube/config. If set, the path from the $KUBECONFIG environment variable is used. Certificate files are stored in the "certs" subfolder of the gsctl config directory. See 'gsctl info'. Alternatively, the --self-contained <path> flag can be used to create a new config file with included certificates. Examples: gsctl create kubeconfig -c my0c3 gsctl create kubeconfig -c "Production cluster" --self-contained ./kubeconfig.yaml gsctl create kubeconfig -c my0c3 --ttl 3h -d "Key pair living for only 3 hours" gsctl create kubeconfig -c "Development cluster" --certificate-organizations system:masters `, PreRun: createKubeconfigPreRunOutput, Run: createKubeconfigRunOutput, } )
Functions ¶
This section is empty.
Types ¶
type Arguments ¶
type Arguments struct {
// contains filtered or unexported fields
}
Arguments is an argument struct to pass to our business function and to the validation function
type JSONOutput ¶
type JSONOutput struct { // Result of the command. should be 'ok' Result string `json:"result"` // KubeConfig is a string containing the kubeconfig KubeConfig string `json:"kubeconfig,omitempty"` // Error which occured Error error `json:"error,omitempty"` }
JSONOutput contains the fields included in JSON output of the create kubeconfig command when called with json output flag
Click to show internal directories.
Click to hide internal directories.