diff --git a/cmd/cluster/checkexpiration/checkexpiration.go b/cmd/cluster/checkexpiration/checkexpiration.go index 78d0801ba..bdfd465c7 100644 --- a/cmd/cluster/checkexpiration/checkexpiration.go +++ b/cmd/cluster/checkexpiration/checkexpiration.go @@ -25,29 +25,28 @@ import ( const ( checkLong = ` -Displays a list of certificate expirations from both the management and -workload clusters, or in a self-managed cluster. Checks for TLS Secrets, -kubeconf secrets (which gets created while creating the workload cluster) and -also the node certificates present inside /etc/kubernetes/pki directory for -each node` +Displays a list of certificate along with expirations from both the management and workload clusters, or in a +self-managed cluster. Checks for TLS Secrets, kubeconf secrets (which gets created while creating the +workload cluster) and also the node certificates present inside /etc/kubernetes/pki directory for each node. +` checkExample = ` -# To display all the expiring entities in the cluster -airshipctl cluster check-certificate-expiration --kubeconfig testconfig +To display all the expiring entities in the cluster +# airshipctl cluster check-certificate-expiration --kubeconfig testconfig -# To display the entities whose expiration is within threshold of 30 days -airshipctl cluster check-certificate-expiration -t 30 --kubeconfig testconfig +To display the entities whose expiration is within threshold of 30 days +# airshipctl cluster check-certificate-expiration -t 30 --kubeconfig testconfig -# To output the contents to json (default operation) -airshipctl cluster check-certificate-expiration -o json --kubeconfig testconfig +To output the contents to json (default operation) +# airshipctl cluster check-certificate-expiration -o json --kubeconfig testconfig or -airshipctl cluster check-certificate-expiration --kubeconfig testconfig +# airshipctl cluster check-certificate-expiration --kubeconfig testconfig -# To output the contents to yaml -airshipctl cluster check-certificate-expiration -o yaml --kubeconfig testconfig +To output the contents to yaml +# airshipctl cluster check-certificate-expiration -o yaml --kubeconfig testconfig -# To output the contents whose expiration is within 30 days to yaml -airshipctl cluster check-certificate-expiration -t 30 -o yaml --kubeconfig testconfig +To output the contents whose expiration is within 30 days to yaml +# airshipctl cluster check-certificate-expiration -t 30 -o yaml --kubeconfig testconfig ` kubeconfigFlag = "kubeconfig" @@ -62,8 +61,9 @@ func NewCheckCommand(cfgFactory config.Factory) *cobra.Command { } checkCmd := &cobra.Command{ - Use: "check-certificate-expiration", - Short: "Check for expiring TLS certificates, secrets and kubeconfigs in the kubernetes cluster", + Use: "check-certificate-expiration", + Short: "Airshipctl command to check expiring TLS certificates, " + + "secrets and kubeconfigs in the kubernetes cluster", Long: checkLong[1:], Example: checkExample, RunE: func(cmd *cobra.Command, args []string) error { @@ -71,15 +71,12 @@ func NewCheckCommand(cfgFactory config.Factory) *cobra.Command { }, } - checkCmd.Flags().IntVarP(&c.Options.Threshold, "threshold", "t", -1, - "The max expiration threshold in days before a certificate is"+ - " expiring. Displays all the certificates by default") - checkCmd.Flags().StringVarP(&c.Options.FormatType, "output", "o", "json", "Convert "+ - "output to yaml or json") + checkCmd.Flags().StringVarP(&c.Options.FormatType, "output", "o", "json", "convert output to yaml or json") + checkCmd.Flags().StringVar(&c.Options.KubeContext, "kubecontext", "", "kubeconfig context to be used") checkCmd.Flags().StringVar(&c.Options.Kubeconfig, kubeconfigFlag, "", - "Path to kubeconfig associated with cluster being managed") - checkCmd.Flags().StringVar(&c.Options.KubeContext, "kubecontext", "", - "Kubeconfig context to be used") + "path to kubeconfig associated with cluster being managed") + checkCmd.Flags().IntVarP(&c.Options.Threshold, "threshold", "t", -1, + "the max expiration threshold in days before a certificate is expiring. Displays all the certificates by default") err := checkCmd.MarkFlagRequired(kubeconfigFlag) if err != nil { diff --git a/cmd/cluster/checkexpiration/testdata/TestCheckExpirationGoldenOutput/check-expiration-with-help.golden b/cmd/cluster/checkexpiration/testdata/TestCheckExpirationGoldenOutput/check-expiration-with-help.golden index 17ad92dcd..47b9bd1d1 100644 --- a/cmd/cluster/checkexpiration/testdata/TestCheckExpirationGoldenOutput/check-expiration-with-help.golden +++ b/cmd/cluster/checkexpiration/testdata/TestCheckExpirationGoldenOutput/check-expiration-with-help.golden @@ -1,35 +1,33 @@ -Displays a list of certificate expirations from both the management and -workload clusters, or in a self-managed cluster. Checks for TLS Secrets, -kubeconf secrets (which gets created while creating the workload cluster) and -also the node certificates present inside /etc/kubernetes/pki directory for -each node +Displays a list of certificate along with expirations from both the management and workload clusters, or in a +self-managed cluster. Checks for TLS Secrets, kubeconf secrets (which gets created while creating the +workload cluster) and also the node certificates present inside /etc/kubernetes/pki directory for each node. Usage: check-certificate-expiration [flags] Examples: -# To display all the expiring entities in the cluster -airshipctl cluster check-certificate-expiration --kubeconfig testconfig +To display all the expiring entities in the cluster +# airshipctl cluster check-certificate-expiration --kubeconfig testconfig -# To display the entities whose expiration is within threshold of 30 days -airshipctl cluster check-certificate-expiration -t 30 --kubeconfig testconfig +To display the entities whose expiration is within threshold of 30 days +# airshipctl cluster check-certificate-expiration -t 30 --kubeconfig testconfig -# To output the contents to json (default operation) -airshipctl cluster check-certificate-expiration -o json --kubeconfig testconfig +To output the contents to json (default operation) +# airshipctl cluster check-certificate-expiration -o json --kubeconfig testconfig or -airshipctl cluster check-certificate-expiration --kubeconfig testconfig +# airshipctl cluster check-certificate-expiration --kubeconfig testconfig -# To output the contents to yaml -airshipctl cluster check-certificate-expiration -o yaml --kubeconfig testconfig +To output the contents to yaml +# airshipctl cluster check-certificate-expiration -o yaml --kubeconfig testconfig -# To output the contents whose expiration is within 30 days to yaml -airshipctl cluster check-certificate-expiration -t 30 -o yaml --kubeconfig testconfig +To output the contents whose expiration is within 30 days to yaml +# airshipctl cluster check-certificate-expiration -t 30 -o yaml --kubeconfig testconfig Flags: -h, --help help for check-certificate-expiration - --kubeconfig string Path to kubeconfig associated with cluster being managed - --kubecontext string Kubeconfig context to be used - -o, --output string Convert output to yaml or json (default "json") - -t, --threshold int The max expiration threshold in days before a certificate is expiring. Displays all the certificates by default (default -1) + --kubeconfig string path to kubeconfig associated with cluster being managed + --kubecontext string kubeconfig context to be used + -o, --output string convert output to yaml or json (default "json") + -t, --threshold int the max expiration threshold in days before a certificate is expiring. Displays all the certificates by default (default -1) diff --git a/cmd/cluster/cluster.go b/cmd/cluster/cluster.go index 5643cf424..b53426f4c 100644 --- a/cmd/cluster/cluster.go +++ b/cmd/cluster/cluster.go @@ -25,7 +25,7 @@ import ( const ( // TODO: (kkalynovskyi) Add more description when more subcommands are added clusterLong = ` -This command provides capabilities for interacting with a Kubernetes cluster, +Provides capabilities for interacting with a Kubernetes cluster, such as getting status and deploying initial infrastructure. ` ) @@ -34,7 +34,7 @@ such as getting status and deploying initial infrastructure. func NewClusterCommand(cfgFactory config.Factory) *cobra.Command { clusterRootCmd := &cobra.Command{ Use: "cluster", - Short: "Manage Kubernetes clusters", + Short: "Airshipctl command to manage kubernetes clusters", Long: clusterLong[1:], } diff --git a/cmd/cluster/get_kubeconfig.go b/cmd/cluster/get_kubeconfig.go index 8e215218b..082bd59db 100644 --- a/cmd/cluster/get_kubeconfig.go +++ b/cmd/cluster/get_kubeconfig.go @@ -23,18 +23,20 @@ import ( const ( getKubeconfigLong = ` -Retrieve cluster kubeconfig and print it to stdout +Retrieves kubeconfig of the cluster and prints it to stdout. + If you specify clusterName, kubeconfig will have a CurrentContext set to clusterName and -will have this context defined +will have its context defined. + If you don't specify clusterName, kubeconfig will have multiple contexts for every cluster -in the airship site. Context names will correspond to cluster names. CurrentContext will be empty +in the airship site. Context names will correspond to cluster names. CurrentContext will be empty. ` getKubeconfigExample = ` -# Retrieve target-cluster kubeconfig -airshipctl cluster get-kubeconfig target-cluster +Retrieve target-cluster kubeconfig +# airshipctl cluster get-kubeconfig target-cluster -# Retrieve kubeconfig for the entire site; the kubeconfig will have context for every cluster -airshipctl cluster get-kubeconfig +Retrieve kubeconfig for the entire site; the kubeconfig will have context for every cluster +# airshipctl cluster get-kubeconfig ` ) @@ -42,11 +44,11 @@ airshipctl cluster get-kubeconfig func NewGetKubeconfigCommand(cfgFactory config.Factory) *cobra.Command { opts := &cluster.GetKubeconfigCommand{} cmd := &cobra.Command{ - Use: "get-kubeconfig [clusterName]", - Short: "Retrieve kubeconfig for a desired cluster", + Use: "get-kubeconfig CLUSTER_NAME", + Short: "Airshipctl command to retrieve kubeconfig for a desired cluster", Long: getKubeconfigLong[1:], Args: GetKubeconfArgs(opts), - Example: getKubeconfigExample[1:], + Example: getKubeconfigExample, RunE: func(cmd *cobra.Command, args []string) error { return opts.RunE(cfgFactory, cmd.OutOrStdout()) }, diff --git a/cmd/cluster/list.go b/cmd/cluster/list.go index ee424be3b..76ac358d2 100755 --- a/cmd/cluster/list.go +++ b/cmd/cluster/list.go @@ -22,12 +22,15 @@ import ( ) const ( - listShort = "Retrieve the list of defined clusters" + listLong = ` +Retrieve and list the defined clusters in the table form or display just the name as specified. +` + listExample = ` -# Retrieve cluster list -airshipctl cluster list --airshipconf /tmp/airconfig -airshipctl cluster list -o table -airshipctl cluster list -o name +Retrieve list of clusters +# airshipctl cluster list --airshipconf /tmp/airconfig +# airshipctl cluster list -o table +# airshipctl cluster list -o name ` ) @@ -36,15 +39,13 @@ func NewListCommand(cfgFactory config.Factory) *cobra.Command { o := &phase.ClusterListCommand{Factory: cfgFactory} cmd := &cobra.Command{ Use: "list", - Short: listShort, - Example: listExample[1:], + Short: "Airshipctl command to get and list defined clusters", + Long: listLong, + Example: listExample, RunE: listRunE(o), } flags := cmd.Flags() - flags.StringVarP(&o.Format, - "output", "o", "name", "'table' "+ - "and 'name' are available "+ - "output formats") + flags.StringVarP(&o.Format, "output", "o", "name", "output formats. Supported options are 'table' and 'name'") return cmd } diff --git a/cmd/cluster/resetsatoken/resetsatoken.go b/cmd/cluster/resetsatoken/resetsatoken.go index 7d9045915..37226c3cc 100644 --- a/cmd/cluster/resetsatoken/resetsatoken.go +++ b/cmd/cluster/resetsatoken/resetsatoken.go @@ -24,19 +24,19 @@ import ( const ( resetLong = ` -Use to reset/rotate the Service Account(SA) tokens and additionally restart the -corresponding pods to get the latest token data reflected in the pod spec +Reset/rotate the Service Account(SA) tokens and additionally restart the corresponding pods to get the latest +token data reflected in the pod spec. -Secret-namespace is a mandatory field and secret-name is optional. If secret- -name is not given, all the SA tokens in that particular namespace is considered, -else only that particular input secret-name` +Secret-namespace is a mandatory flag and secret-name is optional. If secret-name is not given, all the SA tokens +in that particular namespace is considered, else only that particular input secret-name. +` resetExample = ` -# To rotate a particular SA token -airshipctl cluster rotate-sa-token -n cert-manager -s cert-manager-token-vvn9p +To rotate a particular SA token +# airshipctl cluster rotate-sa-token -n cert-manager -s cert-manager-token-vvn9p -# To rotate all the SA tokens in cert-manager namespace -airshipctl cluster rotate-sa-token -n cert-manager +To rotate all the SA tokens in cert-manager namespace +# airshipctl cluster rotate-sa-token -n cert-manager ` ) @@ -49,7 +49,7 @@ func NewResetCommand(cfgFactory config.Factory) *cobra.Command { resetCmd := &cobra.Command{ Use: "rotate-sa-token", - Short: "Rotate tokens of Service Accounts", + Short: "Airshipctl command to rotate tokens of Service Account(s)", Long: resetLong[1:], Example: resetExample, RunE: func(cmd *cobra.Command, args []string) error { @@ -62,7 +62,7 @@ func NewResetCommand(cfgFactory config.Factory) *cobra.Command { resetCmd.Flags().StringVarP(&r.Options.SecretName, "secret-name", "s", "", "name of the secret containing Service Account Token") resetCmd.Flags().StringVar(&r.Options.Kubeconfig, "kubeconfig", "", - "Path to kubeconfig associated with cluster being managed") + "path to kubeconfig associated with cluster being managed") err := resetCmd.MarkFlagRequired("secret-namespace") if err != nil { diff --git a/cmd/cluster/resetsatoken/testdata/TestResetTokenGoldenOutput/reset-with-help.golden b/cmd/cluster/resetsatoken/testdata/TestResetTokenGoldenOutput/reset-with-help.golden index 7a1f49531..a806dbd70 100644 --- a/cmd/cluster/resetsatoken/testdata/TestResetTokenGoldenOutput/reset-with-help.golden +++ b/cmd/cluster/resetsatoken/testdata/TestResetTokenGoldenOutput/reset-with-help.golden @@ -1,24 +1,23 @@ -Use to reset/rotate the Service Account(SA) tokens and additionally restart the -corresponding pods to get the latest token data reflected in the pod spec +Reset/rotate the Service Account(SA) tokens and additionally restart the corresponding pods to get the latest +token data reflected in the pod spec. -Secret-namespace is a mandatory field and secret-name is optional. If secret- -name is not given, all the SA tokens in that particular namespace is considered, -else only that particular input secret-name +Secret-namespace is a mandatory flag and secret-name is optional. If secret-name is not given, all the SA tokens +in that particular namespace is considered, else only that particular input secret-name. Usage: rotate-sa-token [flags] Examples: -# To rotate a particular SA token -airshipctl cluster rotate-sa-token -n cert-manager -s cert-manager-token-vvn9p +To rotate a particular SA token +# airshipctl cluster rotate-sa-token -n cert-manager -s cert-manager-token-vvn9p -# To rotate all the SA tokens in cert-manager namespace -airshipctl cluster rotate-sa-token -n cert-manager +To rotate all the SA tokens in cert-manager namespace +# airshipctl cluster rotate-sa-token -n cert-manager Flags: -h, --help help for rotate-sa-token - --kubeconfig string Path to kubeconfig associated with cluster being managed + --kubeconfig string path to kubeconfig associated with cluster being managed -s, --secret-name string name of the secret containing Service Account Token -n, --secret-namespace string namespace of the Service Account Token diff --git a/cmd/cluster/testdata/TestNewClusterCommandGoldenOutput/cluster-cmd-with-help.golden b/cmd/cluster/testdata/TestNewClusterCommandGoldenOutput/cluster-cmd-with-help.golden index 6bf069357..bc29129a1 100644 --- a/cmd/cluster/testdata/TestNewClusterCommandGoldenOutput/cluster-cmd-with-help.golden +++ b/cmd/cluster/testdata/TestNewClusterCommandGoldenOutput/cluster-cmd-with-help.golden @@ -1,15 +1,15 @@ -This command provides capabilities for interacting with a Kubernetes cluster, +Provides capabilities for interacting with a Kubernetes cluster, such as getting status and deploying initial infrastructure. Usage: cluster [command] Available Commands: - check-certificate-expiration Check for expiring TLS certificates, secrets and kubeconfigs in the kubernetes cluster - get-kubeconfig Retrieve kubeconfig for a desired cluster + check-certificate-expiration Airshipctl command to check expiring TLS certificates, secrets and kubeconfigs in the kubernetes cluster + get-kubeconfig Airshipctl command to retrieve kubeconfig for a desired cluster help Help about any command - list Retrieve the list of defined clusters - rotate-sa-token Rotate tokens of Service Accounts + list Airshipctl command to get and list defined clusters + rotate-sa-token Airshipctl command to rotate tokens of Service Account(s) status Retrieve statuses of deployed cluster components Flags: diff --git a/cmd/cluster/testdata/TestNewKubeConfigCommandCmdGoldenOutput/cluster-get-kubeconfig-cmd-with-help.golden b/cmd/cluster/testdata/TestNewKubeConfigCommandCmdGoldenOutput/cluster-get-kubeconfig-cmd-with-help.golden index 5006793d0..49098c1d5 100644 --- a/cmd/cluster/testdata/TestNewKubeConfigCommandCmdGoldenOutput/cluster-get-kubeconfig-cmd-with-help.golden +++ b/cmd/cluster/testdata/TestNewKubeConfigCommandCmdGoldenOutput/cluster-get-kubeconfig-cmd-with-help.golden @@ -1,18 +1,21 @@ -Retrieve cluster kubeconfig and print it to stdout +Retrieves kubeconfig of the cluster and prints it to stdout. + If you specify clusterName, kubeconfig will have a CurrentContext set to clusterName and -will have this context defined +will have its context defined. + If you don't specify clusterName, kubeconfig will have multiple contexts for every cluster -in the airship site. Context names will correspond to cluster names. CurrentContext will be empty +in the airship site. Context names will correspond to cluster names. CurrentContext will be empty. Usage: - get-kubeconfig [clusterName] [flags] + get-kubeconfig CLUSTER_NAME [flags] Examples: -# Retrieve target-cluster kubeconfig -airshipctl cluster get-kubeconfig target-cluster -# Retrieve kubeconfig for the entire site; the kubeconfig will have context for every cluster -airshipctl cluster get-kubeconfig +Retrieve target-cluster kubeconfig +# airshipctl cluster get-kubeconfig target-cluster + +Retrieve kubeconfig for the entire site; the kubeconfig will have context for every cluster +# airshipctl cluster get-kubeconfig Flags: diff --git a/cmd/cluster/testdata/TestNewListCommandGoldenOutput/cluster-list-cmd-with-help.golden b/cmd/cluster/testdata/TestNewListCommandGoldenOutput/cluster-list-cmd-with-help.golden index ab18d64f9..906ecd688 100644 --- a/cmd/cluster/testdata/TestNewListCommandGoldenOutput/cluster-list-cmd-with-help.golden +++ b/cmd/cluster/testdata/TestNewListCommandGoldenOutput/cluster-list-cmd-with-help.golden @@ -1,15 +1,17 @@ -Retrieve the list of defined clusters + +Retrieve and list the defined clusters in the table form or display just the name as specified. Usage: list [flags] Examples: -# Retrieve cluster list -airshipctl cluster list --airshipconf /tmp/airconfig -airshipctl cluster list -o table -airshipctl cluster list -o name + +Retrieve list of clusters +# airshipctl cluster list --airshipconf /tmp/airconfig +# airshipctl cluster list -o table +# airshipctl cluster list -o name Flags: -h, --help help for list - -o, --output string 'table' and 'name' are available output formats (default "name") + -o, --output string output formats. Supported options are 'table' and 'name' (default "name") diff --git a/cmd/testdata/TestRootGoldenOutput/rootCmd-with-default-subcommands.golden b/cmd/testdata/TestRootGoldenOutput/rootCmd-with-default-subcommands.golden index 642f4e986..be661a787 100644 --- a/cmd/testdata/TestRootGoldenOutput/rootCmd-with-default-subcommands.golden +++ b/cmd/testdata/TestRootGoldenOutput/rootCmd-with-default-subcommands.golden @@ -5,7 +5,7 @@ Usage: Available Commands: baremetal Airshipctl command to manage bare metal host(s) - cluster Manage Kubernetes clusters + cluster Airshipctl command to manage kubernetes clusters completion Generate completion script for the specified shell (bash or zsh) config Manage the airshipctl config file document Manage deployment documents diff --git a/docs/source/cli/airshipctl.md b/docs/source/cli/airshipctl.md index 0335c87d2..d59b938b1 100644 --- a/docs/source/cli/airshipctl.md +++ b/docs/source/cli/airshipctl.md @@ -17,7 +17,7 @@ A unified entrypoint to various airship components ### SEE ALSO * [airshipctl baremetal](airshipctl_baremetal.md) - Airshipctl command to manage bare metal host(s) -* [airshipctl cluster](airshipctl_cluster.md) - Manage Kubernetes clusters +* [airshipctl cluster](airshipctl_cluster.md) - Airshipctl command to manage kubernetes clusters * [airshipctl completion](airshipctl_completion.md) - Generate completion script for the specified shell (bash or zsh) * [airshipctl config](airshipctl_config.md) - Manage the airshipctl config file * [airshipctl document](airshipctl_document.md) - Manage deployment documents diff --git a/docs/source/cli/airshipctl_cluster.md b/docs/source/cli/airshipctl_cluster.md index d2d18ea7d..0b9c677cc 100644 --- a/docs/source/cli/airshipctl_cluster.md +++ b/docs/source/cli/airshipctl_cluster.md @@ -1,10 +1,10 @@ ## airshipctl cluster -Manage Kubernetes clusters +Airshipctl command to manage kubernetes clusters ### Synopsis -This command provides capabilities for interacting with a Kubernetes cluster, +Provides capabilities for interacting with a Kubernetes cluster, such as getting status and deploying initial infrastructure. @@ -24,9 +24,9 @@ such as getting status and deploying initial infrastructure. ### SEE ALSO * [airshipctl](airshipctl.md) - A unified entrypoint to various airship components -* [airshipctl cluster check-certificate-expiration](airshipctl_cluster_check-certificate-expiration.md) - Check for expiring TLS certificates, secrets and kubeconfigs in the kubernetes cluster -* [airshipctl cluster get-kubeconfig](airshipctl_cluster_get-kubeconfig.md) - Retrieve kubeconfig for a desired cluster -* [airshipctl cluster list](airshipctl_cluster_list.md) - Retrieve the list of defined clusters -* [airshipctl cluster rotate-sa-token](airshipctl_cluster_rotate-sa-token.md) - Rotate tokens of Service Accounts +* [airshipctl cluster check-certificate-expiration](airshipctl_cluster_check-certificate-expiration.md) - Airshipctl command to check expiring TLS certificates, secrets and kubeconfigs in the kubernetes cluster +* [airshipctl cluster get-kubeconfig](airshipctl_cluster_get-kubeconfig.md) - Airshipctl command to retrieve kubeconfig for a desired cluster +* [airshipctl cluster list](airshipctl_cluster_list.md) - Airshipctl command to get and list defined clusters +* [airshipctl cluster rotate-sa-token](airshipctl_cluster_rotate-sa-token.md) - Airshipctl command to rotate tokens of Service Account(s) * [airshipctl cluster status](airshipctl_cluster_status.md) - Retrieve statuses of deployed cluster components diff --git a/docs/source/cli/airshipctl_cluster_check-certificate-expiration.md b/docs/source/cli/airshipctl_cluster_check-certificate-expiration.md index efed78c70..dfaf276c6 100644 --- a/docs/source/cli/airshipctl_cluster_check-certificate-expiration.md +++ b/docs/source/cli/airshipctl_cluster_check-certificate-expiration.md @@ -1,14 +1,13 @@ ## airshipctl cluster check-certificate-expiration -Check for expiring TLS certificates, secrets and kubeconfigs in the kubernetes cluster +Airshipctl command to check expiring TLS certificates, secrets and kubeconfigs in the kubernetes cluster ### Synopsis -Displays a list of certificate expirations from both the management and -workload clusters, or in a self-managed cluster. Checks for TLS Secrets, -kubeconf secrets (which gets created while creating the workload cluster) and -also the node certificates present inside /etc/kubernetes/pki directory for -each node +Displays a list of certificate along with expirations from both the management and workload clusters, or in a +self-managed cluster. Checks for TLS Secrets, kubeconf secrets (which gets created while creating the +workload cluster) and also the node certificates present inside /etc/kubernetes/pki directory for each node. + ``` airshipctl cluster check-certificate-expiration [flags] @@ -18,22 +17,22 @@ airshipctl cluster check-certificate-expiration [flags] ``` -# To display all the expiring entities in the cluster -airshipctl cluster check-certificate-expiration --kubeconfig testconfig +To display all the expiring entities in the cluster +# airshipctl cluster check-certificate-expiration --kubeconfig testconfig -# To display the entities whose expiration is within threshold of 30 days -airshipctl cluster check-certificate-expiration -t 30 --kubeconfig testconfig +To display the entities whose expiration is within threshold of 30 days +# airshipctl cluster check-certificate-expiration -t 30 --kubeconfig testconfig -# To output the contents to json (default operation) -airshipctl cluster check-certificate-expiration -o json --kubeconfig testconfig +To output the contents to json (default operation) +# airshipctl cluster check-certificate-expiration -o json --kubeconfig testconfig or -airshipctl cluster check-certificate-expiration --kubeconfig testconfig +# airshipctl cluster check-certificate-expiration --kubeconfig testconfig -# To output the contents to yaml -airshipctl cluster check-certificate-expiration -o yaml --kubeconfig testconfig +To output the contents to yaml +# airshipctl cluster check-certificate-expiration -o yaml --kubeconfig testconfig -# To output the contents whose expiration is within 30 days to yaml -airshipctl cluster check-certificate-expiration -t 30 -o yaml --kubeconfig testconfig +To output the contents whose expiration is within 30 days to yaml +# airshipctl cluster check-certificate-expiration -t 30 -o yaml --kubeconfig testconfig ``` @@ -41,10 +40,10 @@ airshipctl cluster check-certificate-expiration -t 30 -o yaml --kubeconfig testc ``` -h, --help help for check-certificate-expiration - --kubeconfig string Path to kubeconfig associated with cluster being managed - --kubecontext string Kubeconfig context to be used - -o, --output string Convert output to yaml or json (default "json") - -t, --threshold int The max expiration threshold in days before a certificate is expiring. Displays all the certificates by default (default -1) + --kubeconfig string path to kubeconfig associated with cluster being managed + --kubecontext string kubeconfig context to be used + -o, --output string convert output to yaml or json (default "json") + -t, --threshold int the max expiration threshold in days before a certificate is expiring. Displays all the certificates by default (default -1) ``` ### Options inherited from parent commands @@ -56,5 +55,5 @@ airshipctl cluster check-certificate-expiration -t 30 -o yaml --kubeconfig testc ### SEE ALSO -* [airshipctl cluster](airshipctl_cluster.md) - Manage Kubernetes clusters +* [airshipctl cluster](airshipctl_cluster.md) - Airshipctl command to manage kubernetes clusters diff --git a/docs/source/cli/airshipctl_cluster_get-kubeconfig.md b/docs/source/cli/airshipctl_cluster_get-kubeconfig.md index dfe55b4ca..28bf7c8b8 100644 --- a/docs/source/cli/airshipctl_cluster_get-kubeconfig.md +++ b/docs/source/cli/airshipctl_cluster_get-kubeconfig.md @@ -1,28 +1,31 @@ ## airshipctl cluster get-kubeconfig -Retrieve kubeconfig for a desired cluster +Airshipctl command to retrieve kubeconfig for a desired cluster ### Synopsis -Retrieve cluster kubeconfig and print it to stdout +Retrieves kubeconfig of the cluster and prints it to stdout. + If you specify clusterName, kubeconfig will have a CurrentContext set to clusterName and -will have this context defined +will have its context defined. + If you don't specify clusterName, kubeconfig will have multiple contexts for every cluster -in the airship site. Context names will correspond to cluster names. CurrentContext will be empty +in the airship site. Context names will correspond to cluster names. CurrentContext will be empty. ``` -airshipctl cluster get-kubeconfig [clusterName] [flags] +airshipctl cluster get-kubeconfig CLUSTER_NAME [flags] ``` ### Examples ``` -# Retrieve target-cluster kubeconfig -airshipctl cluster get-kubeconfig target-cluster -# Retrieve kubeconfig for the entire site; the kubeconfig will have context for every cluster -airshipctl cluster get-kubeconfig +Retrieve target-cluster kubeconfig +# airshipctl cluster get-kubeconfig target-cluster + +Retrieve kubeconfig for the entire site; the kubeconfig will have context for every cluster +# airshipctl cluster get-kubeconfig ``` @@ -41,5 +44,5 @@ airshipctl cluster get-kubeconfig ### SEE ALSO -* [airshipctl cluster](airshipctl_cluster.md) - Manage Kubernetes clusters +* [airshipctl cluster](airshipctl_cluster.md) - Airshipctl command to manage kubernetes clusters diff --git a/docs/source/cli/airshipctl_cluster_list.md b/docs/source/cli/airshipctl_cluster_list.md index a7fdc2df9..a6c801568 100644 --- a/docs/source/cli/airshipctl_cluster_list.md +++ b/docs/source/cli/airshipctl_cluster_list.md @@ -1,10 +1,12 @@ ## airshipctl cluster list -Retrieve the list of defined clusters +Airshipctl command to get and list defined clusters ### Synopsis -Retrieve the list of defined clusters + +Retrieve and list the defined clusters in the table form or display just the name as specified. + ``` airshipctl cluster list [flags] @@ -13,10 +15,11 @@ airshipctl cluster list [flags] ### Examples ``` -# Retrieve cluster list -airshipctl cluster list --airshipconf /tmp/airconfig -airshipctl cluster list -o table -airshipctl cluster list -o name + +Retrieve list of clusters +# airshipctl cluster list --airshipconf /tmp/airconfig +# airshipctl cluster list -o table +# airshipctl cluster list -o name ``` @@ -24,7 +27,7 @@ airshipctl cluster list -o name ``` -h, --help help for list - -o, --output string 'table' and 'name' are available output formats (default "name") + -o, --output string output formats. Supported options are 'table' and 'name' (default "name") ``` ### Options inherited from parent commands @@ -36,5 +39,5 @@ airshipctl cluster list -o name ### SEE ALSO -* [airshipctl cluster](airshipctl_cluster.md) - Manage Kubernetes clusters +* [airshipctl cluster](airshipctl_cluster.md) - Airshipctl command to manage kubernetes clusters diff --git a/docs/source/cli/airshipctl_cluster_rotate-sa-token.md b/docs/source/cli/airshipctl_cluster_rotate-sa-token.md index f5a0aa307..190194f9b 100644 --- a/docs/source/cli/airshipctl_cluster_rotate-sa-token.md +++ b/docs/source/cli/airshipctl_cluster_rotate-sa-token.md @@ -1,15 +1,15 @@ ## airshipctl cluster rotate-sa-token -Rotate tokens of Service Accounts +Airshipctl command to rotate tokens of Service Account(s) ### Synopsis -Use to reset/rotate the Service Account(SA) tokens and additionally restart the -corresponding pods to get the latest token data reflected in the pod spec +Reset/rotate the Service Account(SA) tokens and additionally restart the corresponding pods to get the latest +token data reflected in the pod spec. + +Secret-namespace is a mandatory flag and secret-name is optional. If secret-name is not given, all the SA tokens +in that particular namespace is considered, else only that particular input secret-name. -Secret-namespace is a mandatory field and secret-name is optional. If secret- -name is not given, all the SA tokens in that particular namespace is considered, -else only that particular input secret-name ``` airshipctl cluster rotate-sa-token [flags] @@ -19,11 +19,11 @@ airshipctl cluster rotate-sa-token [flags] ``` -# To rotate a particular SA token -airshipctl cluster rotate-sa-token -n cert-manager -s cert-manager-token-vvn9p +To rotate a particular SA token +# airshipctl cluster rotate-sa-token -n cert-manager -s cert-manager-token-vvn9p -# To rotate all the SA tokens in cert-manager namespace -airshipctl cluster rotate-sa-token -n cert-manager +To rotate all the SA tokens in cert-manager namespace +# airshipctl cluster rotate-sa-token -n cert-manager ``` @@ -31,7 +31,7 @@ airshipctl cluster rotate-sa-token -n cert-manager ``` -h, --help help for rotate-sa-token - --kubeconfig string Path to kubeconfig associated with cluster being managed + --kubeconfig string path to kubeconfig associated with cluster being managed -s, --secret-name string name of the secret containing Service Account Token -n, --secret-namespace string namespace of the Service Account Token ``` @@ -45,5 +45,5 @@ airshipctl cluster rotate-sa-token -n cert-manager ### SEE ALSO -* [airshipctl cluster](airshipctl_cluster.md) - Manage Kubernetes clusters +* [airshipctl cluster](airshipctl_cluster.md) - Airshipctl command to manage kubernetes clusters diff --git a/docs/source/cli/airshipctl_cluster_status.md b/docs/source/cli/airshipctl_cluster_status.md index 4f0271a82..99cd3e50b 100644 --- a/docs/source/cli/airshipctl_cluster_status.md +++ b/docs/source/cli/airshipctl_cluster_status.md @@ -26,5 +26,5 @@ airshipctl cluster status [flags] ### SEE ALSO -* [airshipctl cluster](airshipctl_cluster.md) - Manage Kubernetes clusters +* [airshipctl cluster](airshipctl_cluster.md) - Airshipctl command to manage kubernetes clusters