Merge "Cluster- updating cmd files for documentation"

This commit is contained in:
Zuul 2021-05-11 09:38:12 +00:00 committed by Gerrit Code Review
commit bcb6f959ab
18 changed files with 177 additions and 170 deletions

View File

@ -25,29 +25,28 @@ import (
const ( const (
checkLong = ` checkLong = `
Displays a list of certificate expirations from both the management and Displays a list of certificate along with expirations from both the management and workload clusters, or in a
workload clusters, or in a self-managed cluster. Checks for TLS Secrets, self-managed cluster. Checks for TLS Secrets, kubeconf secrets (which gets created while creating the
kubeconf secrets (which gets created while creating the workload cluster) and workload cluster) and also the node certificates present inside /etc/kubernetes/pki directory for each node.
also the node certificates present inside /etc/kubernetes/pki directory for `
each node`
checkExample = ` checkExample = `
# To display all the expiring entities in the cluster To display all the expiring entities in the cluster
airshipctl cluster check-certificate-expiration --kubeconfig testconfig # airshipctl cluster check-certificate-expiration --kubeconfig testconfig
# To display the entities whose expiration is within threshold of 30 days To display the entities whose expiration is within threshold of 30 days
airshipctl cluster check-certificate-expiration -t 30 --kubeconfig testconfig # airshipctl cluster check-certificate-expiration -t 30 --kubeconfig testconfig
# To output the contents to json (default operation) To output the contents to json (default operation)
airshipctl cluster check-certificate-expiration -o json --kubeconfig testconfig # airshipctl cluster check-certificate-expiration -o json --kubeconfig testconfig
or or
airshipctl cluster check-certificate-expiration --kubeconfig testconfig # airshipctl cluster check-certificate-expiration --kubeconfig testconfig
# To output the contents to yaml To output the contents to yaml
airshipctl cluster check-certificate-expiration -o yaml --kubeconfig testconfig # airshipctl cluster check-certificate-expiration -o yaml --kubeconfig testconfig
# To output the contents whose expiration is within 30 days to yaml To output the contents whose expiration is within 30 days to yaml
airshipctl cluster check-certificate-expiration -t 30 -o yaml --kubeconfig testconfig # airshipctl cluster check-certificate-expiration -t 30 -o yaml --kubeconfig testconfig
` `
kubeconfigFlag = "kubeconfig" kubeconfigFlag = "kubeconfig"
@ -63,7 +62,8 @@ func NewCheckCommand(cfgFactory config.Factory) *cobra.Command {
checkCmd := &cobra.Command{ checkCmd := &cobra.Command{
Use: "check-certificate-expiration", Use: "check-certificate-expiration",
Short: "Check for expiring TLS certificates, secrets and kubeconfigs in the kubernetes cluster", Short: "Airshipctl command to check expiring TLS certificates, " +
"secrets and kubeconfigs in the kubernetes cluster",
Long: checkLong[1:], Long: checkLong[1:],
Example: checkExample, Example: checkExample,
RunE: func(cmd *cobra.Command, args []string) error { 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, checkCmd.Flags().StringVarP(&c.Options.FormatType, "output", "o", "json", "convert output to yaml or json")
"The max expiration threshold in days before a certificate is"+ checkCmd.Flags().StringVar(&c.Options.KubeContext, "kubecontext", "", "kubeconfig context to be used")
" expiring. Displays all the certificates by default")
checkCmd.Flags().StringVarP(&c.Options.FormatType, "output", "o", "json", "Convert "+
"output to yaml or json")
checkCmd.Flags().StringVar(&c.Options.Kubeconfig, kubeconfigFlag, "", checkCmd.Flags().StringVar(&c.Options.Kubeconfig, kubeconfigFlag, "",
"Path to kubeconfig associated with cluster being managed") "path to kubeconfig associated with cluster being managed")
checkCmd.Flags().StringVar(&c.Options.KubeContext, "kubecontext", "", checkCmd.Flags().IntVarP(&c.Options.Threshold, "threshold", "t", -1,
"Kubeconfig context to be used") "the max expiration threshold in days before a certificate is expiring. Displays all the certificates by default")
err := checkCmd.MarkFlagRequired(kubeconfigFlag) err := checkCmd.MarkFlagRequired(kubeconfigFlag)
if err != nil { if err != nil {

View File

@ -1,35 +1,33 @@
Displays a list of certificate expirations from both the management and Displays a list of certificate along with expirations from both the management and workload clusters, or in a
workload clusters, or in a self-managed cluster. Checks for TLS Secrets, self-managed cluster. Checks for TLS Secrets, kubeconf secrets (which gets created while creating the
kubeconf secrets (which gets created while creating the workload cluster) and workload cluster) and also the node certificates present inside /etc/kubernetes/pki directory for each node.
also the node certificates present inside /etc/kubernetes/pki directory for
each node
Usage: Usage:
check-certificate-expiration [flags] check-certificate-expiration [flags]
Examples: Examples:
# To display all the expiring entities in the cluster To display all the expiring entities in the cluster
airshipctl cluster check-certificate-expiration --kubeconfig testconfig # airshipctl cluster check-certificate-expiration --kubeconfig testconfig
# To display the entities whose expiration is within threshold of 30 days To display the entities whose expiration is within threshold of 30 days
airshipctl cluster check-certificate-expiration -t 30 --kubeconfig testconfig # airshipctl cluster check-certificate-expiration -t 30 --kubeconfig testconfig
# To output the contents to json (default operation) To output the contents to json (default operation)
airshipctl cluster check-certificate-expiration -o json --kubeconfig testconfig # airshipctl cluster check-certificate-expiration -o json --kubeconfig testconfig
or or
airshipctl cluster check-certificate-expiration --kubeconfig testconfig # airshipctl cluster check-certificate-expiration --kubeconfig testconfig
# To output the contents to yaml To output the contents to yaml
airshipctl cluster check-certificate-expiration -o yaml --kubeconfig testconfig # airshipctl cluster check-certificate-expiration -o yaml --kubeconfig testconfig
# To output the contents whose expiration is within 30 days to yaml To output the contents whose expiration is within 30 days to yaml
airshipctl cluster check-certificate-expiration -t 30 -o yaml --kubeconfig testconfig # airshipctl cluster check-certificate-expiration -t 30 -o yaml --kubeconfig testconfig
Flags: Flags:
-h, --help help for check-certificate-expiration -h, --help help for check-certificate-expiration
--kubeconfig string Path to kubeconfig associated with cluster being managed --kubeconfig string path to kubeconfig associated with cluster being managed
--kubecontext string Kubeconfig context to be used --kubecontext string kubeconfig context to be used
-o, --output string Convert output to yaml or json (default "json") -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) -t, --threshold int the max expiration threshold in days before a certificate is expiring. Displays all the certificates by default (default -1)

View File

@ -25,7 +25,7 @@ import (
const ( const (
// TODO: (kkalynovskyi) Add more description when more subcommands are added // TODO: (kkalynovskyi) Add more description when more subcommands are added
clusterLong = ` 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. 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 { func NewClusterCommand(cfgFactory config.Factory) *cobra.Command {
clusterRootCmd := &cobra.Command{ clusterRootCmd := &cobra.Command{
Use: "cluster", Use: "cluster",
Short: "Manage Kubernetes clusters", Short: "Airshipctl command to manage kubernetes clusters",
Long: clusterLong[1:], Long: clusterLong[1:],
} }

View File

@ -23,18 +23,20 @@ import (
const ( const (
getKubeconfigLong = ` 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 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 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 = ` getKubeconfigExample = `
# Retrieve target-cluster kubeconfig Retrieve target-cluster kubeconfig
airshipctl cluster get-kubeconfig target-cluster # airshipctl cluster get-kubeconfig target-cluster
# Retrieve kubeconfig for the entire site; the kubeconfig will have context for every cluster Retrieve kubeconfig for the entire site; the kubeconfig will have context for every cluster
airshipctl cluster get-kubeconfig # airshipctl cluster get-kubeconfig
` `
) )
@ -42,11 +44,11 @@ airshipctl cluster get-kubeconfig
func NewGetKubeconfigCommand(cfgFactory config.Factory) *cobra.Command { func NewGetKubeconfigCommand(cfgFactory config.Factory) *cobra.Command {
opts := &cluster.GetKubeconfigCommand{} opts := &cluster.GetKubeconfigCommand{}
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "get-kubeconfig [clusterName]", Use: "get-kubeconfig CLUSTER_NAME",
Short: "Retrieve kubeconfig for a desired cluster", Short: "Airshipctl command to retrieve kubeconfig for a desired cluster",
Long: getKubeconfigLong[1:], Long: getKubeconfigLong[1:],
Args: GetKubeconfArgs(opts), Args: GetKubeconfArgs(opts),
Example: getKubeconfigExample[1:], Example: getKubeconfigExample,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return opts.RunE(cfgFactory, cmd.OutOrStdout()) return opts.RunE(cfgFactory, cmd.OutOrStdout())
}, },

View File

@ -22,12 +22,15 @@ import (
) )
const ( 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 = ` listExample = `
# Retrieve cluster list Retrieve list of clusters
airshipctl cluster list --airshipconf /tmp/airconfig # airshipctl cluster list --airshipconf /tmp/airconfig
airshipctl cluster list -o table # airshipctl cluster list -o table
airshipctl cluster list -o name # airshipctl cluster list -o name
` `
) )
@ -36,15 +39,13 @@ func NewListCommand(cfgFactory config.Factory) *cobra.Command {
o := &phase.ClusterListCommand{Factory: cfgFactory} o := &phase.ClusterListCommand{Factory: cfgFactory}
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "list", Use: "list",
Short: listShort, Short: "Airshipctl command to get and list defined clusters",
Example: listExample[1:], Long: listLong,
Example: listExample,
RunE: listRunE(o), RunE: listRunE(o),
} }
flags := cmd.Flags() flags := cmd.Flags()
flags.StringVarP(&o.Format, flags.StringVarP(&o.Format, "output", "o", "name", "output formats. Supported options are 'table' and 'name'")
"output", "o", "name", "'table' "+
"and 'name' are available "+
"output formats")
return cmd return cmd
} }

View File

@ -24,19 +24,19 @@ import (
const ( const (
resetLong = ` resetLong = `
Use to reset/rotate the Service Account(SA) tokens and additionally restart the Reset/rotate the Service Account(SA) tokens and additionally restart the corresponding pods to get the latest
corresponding pods to get the latest token data reflected in the pod spec token data reflected in the pod spec.
Secret-namespace is a mandatory field and secret-name is optional. If secret- Secret-namespace is a mandatory flag and secret-name is optional. If secret-name is not given, all the SA tokens
name is not given, all the SA tokens in that particular namespace is considered, in that particular namespace is considered, else only that particular input secret-name.
else only that particular input secret-name` `
resetExample = ` resetExample = `
# To rotate a particular SA token To rotate a particular SA token
airshipctl cluster rotate-sa-token -n cert-manager -s cert-manager-token-vvn9p # airshipctl cluster rotate-sa-token -n cert-manager -s cert-manager-token-vvn9p
# To rotate all the SA tokens in cert-manager namespace To rotate all the SA tokens in cert-manager namespace
airshipctl cluster rotate-sa-token -n cert-manager # airshipctl cluster rotate-sa-token -n cert-manager
` `
) )
@ -49,7 +49,7 @@ func NewResetCommand(cfgFactory config.Factory) *cobra.Command {
resetCmd := &cobra.Command{ resetCmd := &cobra.Command{
Use: "rotate-sa-token", Use: "rotate-sa-token",
Short: "Rotate tokens of Service Accounts", Short: "Airshipctl command to rotate tokens of Service Account(s)",
Long: resetLong[1:], Long: resetLong[1:],
Example: resetExample, Example: resetExample,
RunE: func(cmd *cobra.Command, args []string) error { 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", "", resetCmd.Flags().StringVarP(&r.Options.SecretName, "secret-name", "s", "",
"name of the secret containing Service Account Token") "name of the secret containing Service Account Token")
resetCmd.Flags().StringVar(&r.Options.Kubeconfig, "kubeconfig", "", 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") err := resetCmd.MarkFlagRequired("secret-namespace")
if err != nil { if err != nil {

View File

@ -1,24 +1,23 @@
Use to reset/rotate the Service Account(SA) tokens and additionally restart the Reset/rotate the Service Account(SA) tokens and additionally restart the corresponding pods to get the latest
corresponding pods to get the latest token data reflected in the pod spec token data reflected in the pod spec.
Secret-namespace is a mandatory field and secret-name is optional. If secret- Secret-namespace is a mandatory flag and secret-name is optional. If secret-name is not given, all the SA tokens
name is not given, all the SA tokens in that particular namespace is considered, in that particular namespace is considered, else only that particular input secret-name.
else only that particular input secret-name
Usage: Usage:
rotate-sa-token [flags] rotate-sa-token [flags]
Examples: Examples:
# To rotate a particular SA token To rotate a particular SA token
airshipctl cluster rotate-sa-token -n cert-manager -s cert-manager-token-vvn9p # airshipctl cluster rotate-sa-token -n cert-manager -s cert-manager-token-vvn9p
# To rotate all the SA tokens in cert-manager namespace To rotate all the SA tokens in cert-manager namespace
airshipctl cluster rotate-sa-token -n cert-manager # airshipctl cluster rotate-sa-token -n cert-manager
Flags: Flags:
-h, --help help for rotate-sa-token -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 -s, --secret-name string name of the secret containing Service Account Token
-n, --secret-namespace string namespace of the Service Account Token -n, --secret-namespace string namespace of the Service Account Token

View File

@ -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. such as getting status and deploying initial infrastructure.
Usage: Usage:
cluster [command] cluster [command]
Available Commands: Available Commands:
check-certificate-expiration Check for expiring TLS certificates, secrets and kubeconfigs in the kubernetes cluster check-certificate-expiration Airshipctl command to check expiring TLS certificates, secrets and kubeconfigs in the kubernetes cluster
get-kubeconfig Retrieve kubeconfig for a desired cluster get-kubeconfig Airshipctl command to retrieve kubeconfig for a desired cluster
help Help about any command help Help about any command
list Retrieve the list of defined clusters list Airshipctl command to get and list defined clusters
rotate-sa-token Rotate tokens of Service Accounts rotate-sa-token Airshipctl command to rotate tokens of Service Account(s)
status Retrieve statuses of deployed cluster components status Retrieve statuses of deployed cluster components
Flags: Flags:

View File

@ -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 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 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: Usage:
get-kubeconfig [clusterName] [flags] get-kubeconfig CLUSTER_NAME [flags]
Examples: 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 Retrieve target-cluster kubeconfig
airshipctl cluster get-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: Flags:

View File

@ -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: Usage:
list [flags] list [flags]
Examples: Examples:
# Retrieve cluster list
airshipctl cluster list --airshipconf /tmp/airconfig Retrieve list of clusters
airshipctl cluster list -o table # airshipctl cluster list --airshipconf /tmp/airconfig
airshipctl cluster list -o name # airshipctl cluster list -o table
# airshipctl cluster list -o name
Flags: Flags:
-h, --help help for list -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")

View File

@ -5,7 +5,7 @@ Usage:
Available Commands: Available Commands:
baremetal Airshipctl command to manage bare metal host(s) 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) completion Generate completion script for the specified shell (bash or zsh)
config Manage the airshipctl config file config Manage the airshipctl config file
document Manage deployment documents document Manage deployment documents

View File

@ -17,7 +17,7 @@ A unified entrypoint to various airship components
### SEE ALSO ### SEE ALSO
* [airshipctl baremetal](airshipctl_baremetal.md) - Airshipctl command to manage bare metal host(s) * [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 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 config](airshipctl_config.md) - Manage the airshipctl config file
* [airshipctl document](airshipctl_document.md) - Manage deployment documents * [airshipctl document](airshipctl_document.md) - Manage deployment documents

View File

@ -1,10 +1,10 @@
## airshipctl cluster ## airshipctl cluster
Manage Kubernetes clusters Airshipctl command to manage kubernetes clusters
### Synopsis ### 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. such as getting status and deploying initial infrastructure.
@ -24,9 +24,9 @@ such as getting status and deploying initial infrastructure.
### SEE ALSO ### SEE ALSO
* [airshipctl](airshipctl.md) - A unified entrypoint to various airship components * [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 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) - Retrieve kubeconfig for a desired 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) - Retrieve the list of defined clusters * [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) - Rotate tokens of Service Accounts * [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 * [airshipctl cluster status](airshipctl_cluster_status.md) - Retrieve statuses of deployed cluster components

View File

@ -1,14 +1,13 @@
## airshipctl cluster check-certificate-expiration ## 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 ### Synopsis
Displays a list of certificate expirations from both the management and Displays a list of certificate along with expirations from both the management and workload clusters, or in a
workload clusters, or in a self-managed cluster. Checks for TLS Secrets, self-managed cluster. Checks for TLS Secrets, kubeconf secrets (which gets created while creating the
kubeconf secrets (which gets created while creating the workload cluster) and workload cluster) and also the node certificates present inside /etc/kubernetes/pki directory for each node.
also the node certificates present inside /etc/kubernetes/pki directory for
each node
``` ```
airshipctl cluster check-certificate-expiration [flags] 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 To display all the expiring entities in the cluster
airshipctl cluster check-certificate-expiration --kubeconfig testconfig # airshipctl cluster check-certificate-expiration --kubeconfig testconfig
# To display the entities whose expiration is within threshold of 30 days To display the entities whose expiration is within threshold of 30 days
airshipctl cluster check-certificate-expiration -t 30 --kubeconfig testconfig # airshipctl cluster check-certificate-expiration -t 30 --kubeconfig testconfig
# To output the contents to json (default operation) To output the contents to json (default operation)
airshipctl cluster check-certificate-expiration -o json --kubeconfig testconfig # airshipctl cluster check-certificate-expiration -o json --kubeconfig testconfig
or or
airshipctl cluster check-certificate-expiration --kubeconfig testconfig # airshipctl cluster check-certificate-expiration --kubeconfig testconfig
# To output the contents to yaml To output the contents to yaml
airshipctl cluster check-certificate-expiration -o yaml --kubeconfig testconfig # airshipctl cluster check-certificate-expiration -o yaml --kubeconfig testconfig
# To output the contents whose expiration is within 30 days to yaml To output the contents whose expiration is within 30 days to yaml
airshipctl cluster check-certificate-expiration -t 30 -o yaml --kubeconfig testconfig # 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 -h, --help help for check-certificate-expiration
--kubeconfig string Path to kubeconfig associated with cluster being managed --kubeconfig string path to kubeconfig associated with cluster being managed
--kubecontext string Kubeconfig context to be used --kubecontext string kubeconfig context to be used
-o, --output string Convert output to yaml or json (default "json") -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) -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 ### Options inherited from parent commands
@ -56,5 +55,5 @@ airshipctl cluster check-certificate-expiration -t 30 -o yaml --kubeconfig testc
### SEE ALSO ### SEE ALSO
* [airshipctl cluster](airshipctl_cluster.md) - Manage Kubernetes clusters * [airshipctl cluster](airshipctl_cluster.md) - Airshipctl command to manage kubernetes clusters

View File

@ -1,28 +1,31 @@
## airshipctl cluster get-kubeconfig ## airshipctl cluster get-kubeconfig
Retrieve kubeconfig for a desired cluster Airshipctl command to retrieve kubeconfig for a desired cluster
### Synopsis ### 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 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 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 ### 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 Retrieve target-cluster kubeconfig
airshipctl cluster get-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 ### SEE ALSO
* [airshipctl cluster](airshipctl_cluster.md) - Manage Kubernetes clusters * [airshipctl cluster](airshipctl_cluster.md) - Airshipctl command to manage kubernetes clusters

View File

@ -1,10 +1,12 @@
## airshipctl cluster list ## airshipctl cluster list
Retrieve the list of defined clusters Airshipctl command to get and list defined clusters
### Synopsis ### 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] airshipctl cluster list [flags]
@ -13,10 +15,11 @@ airshipctl cluster list [flags]
### Examples ### Examples
``` ```
# Retrieve cluster list
airshipctl cluster list --airshipconf /tmp/airconfig Retrieve list of clusters
airshipctl cluster list -o table # airshipctl cluster list --airshipconf /tmp/airconfig
airshipctl cluster list -o name # airshipctl cluster list -o table
# airshipctl cluster list -o name
``` ```
@ -24,7 +27,7 @@ airshipctl cluster list -o name
``` ```
-h, --help help for list -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 ### Options inherited from parent commands
@ -36,5 +39,5 @@ airshipctl cluster list -o name
### SEE ALSO ### SEE ALSO
* [airshipctl cluster](airshipctl_cluster.md) - Manage Kubernetes clusters * [airshipctl cluster](airshipctl_cluster.md) - Airshipctl command to manage kubernetes clusters

View File

@ -1,15 +1,15 @@
## airshipctl cluster rotate-sa-token ## airshipctl cluster rotate-sa-token
Rotate tokens of Service Accounts Airshipctl command to rotate tokens of Service Account(s)
### Synopsis ### Synopsis
Use to reset/rotate the Service Account(SA) tokens and additionally restart the Reset/rotate the Service Account(SA) tokens and additionally restart the corresponding pods to get the latest
corresponding pods to get the latest token data reflected in the pod spec 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] airshipctl cluster rotate-sa-token [flags]
@ -19,11 +19,11 @@ airshipctl cluster rotate-sa-token [flags]
``` ```
# To rotate a particular SA token To rotate a particular SA token
airshipctl cluster rotate-sa-token -n cert-manager -s cert-manager-token-vvn9p # airshipctl cluster rotate-sa-token -n cert-manager -s cert-manager-token-vvn9p
# To rotate all the SA tokens in cert-manager namespace To rotate all the SA tokens in cert-manager namespace
airshipctl cluster rotate-sa-token -n cert-manager # 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 -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 -s, --secret-name string name of the secret containing Service Account Token
-n, --secret-namespace string namespace of the 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 ### SEE ALSO
* [airshipctl cluster](airshipctl_cluster.md) - Manage Kubernetes clusters * [airshipctl cluster](airshipctl_cluster.md) - Airshipctl command to manage kubernetes clusters

View File

@ -26,5 +26,5 @@ airshipctl cluster status [flags]
### SEE ALSO ### SEE ALSO
* [airshipctl cluster](airshipctl_cluster.md) - Manage Kubernetes clusters * [airshipctl cluster](airshipctl_cluster.md) - Airshipctl command to manage kubernetes clusters