kubeadm: updates from v1.33.0

This commit is contained in:
rsteube 2025-04-25 18:24:33 +02:00
parent 2dfbd36daa
commit a7a15ce8f8
134 changed files with 1188 additions and 320 deletions

View File

@ -13,5 +13,6 @@ var alphaCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(alphaCmd).Standalone() carapace.Gen(alphaCmd).Standalone()
rootCmd.AddCommand(alphaCmd) rootCmd.AddCommand(alphaCmd)
} }

View File

@ -13,5 +13,6 @@ var certsCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(certsCmd).Standalone() carapace.Gen(certsCmd).Standalone()
rootCmd.AddCommand(certsCmd) rootCmd.AddCommand(certsCmd)
} }

View File

@ -13,5 +13,6 @@ var certs_certificateKeyCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(certs_certificateKeyCmd).Standalone() carapace.Gen(certs_certificateKeyCmd).Standalone()
certsCmd.AddCommand(certs_certificateKeyCmd) certsCmd.AddCommand(certs_certificateKeyCmd)
} }

View File

@ -2,6 +2,7 @@ package cmd
import ( import (
"github.com/carapace-sh/carapace" "github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/kubeadm"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -13,14 +14,19 @@ var certs_checkExpirationCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(certs_checkExpirationCmd).Standalone() carapace.Gen(certs_checkExpirationCmd).Standalone()
certs_checkExpirationCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save the certificates")
certs_checkExpirationCmd.Flags().Bool("allow-missing-template-keys", false, "If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.")
certs_checkExpirationCmd.Flags().String("cert-dir", "", "The path where to save the certificates")
certs_checkExpirationCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") certs_checkExpirationCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
certs_checkExpirationCmd.Flags().String("kubeconfig", "/etc/kubernetes/admin.conf", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.") certs_checkExpirationCmd.Flags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
certs_checkExpirationCmd.Flags().StringP("output", "o", "", "Output format. One of: text|json|yaml|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.")
certs_checkExpirationCmd.Flags().Bool("show-managed-fields", false, "If true, keep the managedFields when printing objects in JSON or YAML format.")
certsCmd.AddCommand(certs_checkExpirationCmd) certsCmd.AddCommand(certs_checkExpirationCmd)
carapace.Gen(certs_checkExpirationCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(certs_checkExpirationCmd).FlagCompletion(carapace.ActionMap{
"cert-dir": carapace.ActionDirectories(), "cert-dir": carapace.ActionDirectories(),
"config": carapace.ActionFiles(), "config": carapace.ActionFiles(),
"kubeconfig": carapace.ActionFiles(), "kubeconfig": carapace.ActionFiles(),
"output": kubeadm.ActionOutputFormats(),
}) })
} }

View File

@ -13,9 +13,10 @@ var certs_generateCsrCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(certs_generateCsrCmd).Standalone() carapace.Gen(certs_generateCsrCmd).Standalone()
certs_generateCsrCmd.Flags().String("cert-dir", "", "The path where to save the certificates") certs_generateCsrCmd.Flags().String("cert-dir", "", "The path where to save the certificates")
certs_generateCsrCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") certs_generateCsrCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
certs_generateCsrCmd.Flags().String("kubeconfig-dir", "/etc/kubernetes", "The path where to save the kubeconfig file.") certs_generateCsrCmd.Flags().String("kubeconfig-dir", "", "The path where to save the kubeconfig file.")
certsCmd.AddCommand(certs_generateCsrCmd) certsCmd.AddCommand(certs_generateCsrCmd)
carapace.Gen(certs_generateCsrCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(certs_generateCsrCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,5 +13,6 @@ var certs_renewCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(certs_renewCmd).Standalone() carapace.Gen(certs_renewCmd).Standalone()
certsCmd.AddCommand(certs_renewCmd) certsCmd.AddCommand(certs_renewCmd)
} }

View File

@ -13,9 +13,10 @@ var certs_renew_adminConfCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(certs_renew_adminConfCmd).Standalone() carapace.Gen(certs_renew_adminConfCmd).Standalone()
certs_renew_adminConfCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save the certificates")
certs_renew_adminConfCmd.Flags().String("cert-dir", "", "The path where to save the certificates")
certs_renew_adminConfCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") certs_renew_adminConfCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
certs_renew_adminConfCmd.Flags().String("kubeconfig", "/etc/kubernetes/admin.conf", "The kubeconfig file to use when talking to the cluster.") certs_renew_adminConfCmd.Flags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
certs_renewCmd.AddCommand(certs_renew_adminConfCmd) certs_renewCmd.AddCommand(certs_renew_adminConfCmd)
carapace.Gen(certs_renew_adminConfCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(certs_renew_adminConfCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,9 +13,10 @@ var certs_renew_allCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(certs_renew_allCmd).Standalone() carapace.Gen(certs_renew_allCmd).Standalone()
certs_renew_allCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save the certificates")
certs_renew_allCmd.Flags().String("cert-dir", "", "The path where to save the certificates")
certs_renew_allCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") certs_renew_allCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
certs_renew_allCmd.Flags().String("kubeconfig", "/etc/kubernetes/admin.conf", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.") certs_renew_allCmd.Flags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
certs_renewCmd.AddCommand(certs_renew_allCmd) certs_renewCmd.AddCommand(certs_renew_allCmd)
carapace.Gen(certs_renew_allCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(certs_renew_allCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,9 +13,10 @@ var certs_renew_apiserverCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(certs_renew_apiserverCmd).Standalone() carapace.Gen(certs_renew_apiserverCmd).Standalone()
certs_renew_apiserverCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save the certificates")
certs_renew_apiserverCmd.Flags().String("cert-dir", "", "The path where to save the certificates")
certs_renew_apiserverCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") certs_renew_apiserverCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
certs_renew_apiserverCmd.Flags().String("kubeconfig", "/etc/kubernetes/admin.conf", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.") certs_renew_apiserverCmd.Flags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
certs_renewCmd.AddCommand(certs_renew_apiserverCmd) certs_renewCmd.AddCommand(certs_renew_apiserverCmd)
carapace.Gen(certs_renew_apiserverCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(certs_renew_apiserverCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,9 +13,10 @@ var certs_renew_apiserverEtcdClientCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(certs_renew_apiserverEtcdClientCmd).Standalone() carapace.Gen(certs_renew_apiserverEtcdClientCmd).Standalone()
certs_renew_apiserverEtcdClientCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save the certificates")
certs_renew_apiserverEtcdClientCmd.Flags().String("cert-dir", "", "The path where to save the certificates")
certs_renew_apiserverEtcdClientCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") certs_renew_apiserverEtcdClientCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
certs_renew_apiserverEtcdClientCmd.Flags().String("kubeconfig", "/etc/kubernetes/admin.conf", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.") certs_renew_apiserverEtcdClientCmd.Flags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
certs_renewCmd.AddCommand(certs_renew_apiserverEtcdClientCmd) certs_renewCmd.AddCommand(certs_renew_apiserverEtcdClientCmd)
carapace.Gen(certs_renew_apiserverEtcdClientCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(certs_renew_apiserverEtcdClientCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,9 +13,10 @@ var certs_renew_apiserverKubeletClientCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(certs_renew_apiserverKubeletClientCmd).Standalone() carapace.Gen(certs_renew_apiserverKubeletClientCmd).Standalone()
certs_renew_apiserverKubeletClientCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save the certificates")
certs_renew_apiserverKubeletClientCmd.Flags().String("cert-dir", "", "The path where to save the certificates")
certs_renew_apiserverKubeletClientCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") certs_renew_apiserverKubeletClientCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
certs_renew_apiserverKubeletClientCmd.Flags().String("kubeconfig", "/etc/kubernetes/admin.conf", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.") certs_renew_apiserverKubeletClientCmd.Flags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
certs_renewCmd.AddCommand(certs_renew_apiserverKubeletClientCmd) certs_renewCmd.AddCommand(certs_renew_apiserverKubeletClientCmd)
carapace.Gen(certs_renew_apiserverKubeletClientCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(certs_renew_apiserverKubeletClientCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,9 +13,10 @@ var certs_renew_controllerManagerConfCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(certs_renew_controllerManagerConfCmd).Standalone() carapace.Gen(certs_renew_controllerManagerConfCmd).Standalone()
certs_renew_controllerManagerConfCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save the certificates")
certs_renew_controllerManagerConfCmd.Flags().String("cert-dir", "", "The path where to save the certificates")
certs_renew_controllerManagerConfCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") certs_renew_controllerManagerConfCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
certs_renew_controllerManagerConfCmd.Flags().String("kubeconfig", "/etc/kubernetes/admin.conf", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.") certs_renew_controllerManagerConfCmd.Flags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
certs_renewCmd.AddCommand(certs_renew_controllerManagerConfCmd) certs_renewCmd.AddCommand(certs_renew_controllerManagerConfCmd)
carapace.Gen(certs_renew_controllerManagerConfCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(certs_renew_controllerManagerConfCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,9 +13,10 @@ var certs_renew_etcdHealthcheckClientCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(certs_renew_etcdHealthcheckClientCmd).Standalone() carapace.Gen(certs_renew_etcdHealthcheckClientCmd).Standalone()
certs_renew_etcdHealthcheckClientCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save the certificates")
certs_renew_etcdHealthcheckClientCmd.Flags().String("cert-dir", "", "The path where to save the certificates")
certs_renew_etcdHealthcheckClientCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") certs_renew_etcdHealthcheckClientCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
certs_renew_etcdHealthcheckClientCmd.Flags().String("kubeconfig", "/etc/kubernetes/admin.conf", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.") certs_renew_etcdHealthcheckClientCmd.Flags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
certs_renewCmd.AddCommand(certs_renew_etcdHealthcheckClientCmd) certs_renewCmd.AddCommand(certs_renew_etcdHealthcheckClientCmd)
carapace.Gen(certs_renew_etcdHealthcheckClientCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(certs_renew_etcdHealthcheckClientCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,9 +13,10 @@ var certs_renew_etcdPeerCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(certs_renew_etcdPeerCmd).Standalone() carapace.Gen(certs_renew_etcdPeerCmd).Standalone()
certs_renew_etcdPeerCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save the certificates")
certs_renew_etcdPeerCmd.Flags().String("cert-dir", "", "The path where to save the certificates")
certs_renew_etcdPeerCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") certs_renew_etcdPeerCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
certs_renew_etcdPeerCmd.Flags().String("kubeconfig", "/etc/kubernetes/admin.conf", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.") certs_renew_etcdPeerCmd.Flags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
certs_renewCmd.AddCommand(certs_renew_etcdPeerCmd) certs_renewCmd.AddCommand(certs_renew_etcdPeerCmd)
carapace.Gen(certs_renew_etcdPeerCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(certs_renew_etcdPeerCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,9 +13,10 @@ var certs_renew_etcdServerCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(certs_renew_etcdServerCmd).Standalone() carapace.Gen(certs_renew_etcdServerCmd).Standalone()
certs_renew_etcdServerCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save the certificates")
certs_renew_etcdServerCmd.Flags().String("cert-dir", "", "The path where to save the certificates")
certs_renew_etcdServerCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") certs_renew_etcdServerCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
certs_renew_etcdServerCmd.Flags().String("kubeconfig", "/etc/kubernetes/admin.conf", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.") certs_renew_etcdServerCmd.Flags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
certs_renewCmd.AddCommand(certs_renew_etcdServerCmd) certs_renewCmd.AddCommand(certs_renew_etcdServerCmd)
carapace.Gen(certs_renew_etcdServerCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(certs_renew_etcdServerCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,9 +13,10 @@ var certs_renew_frontProxyClientCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(certs_renew_frontProxyClientCmd).Standalone() carapace.Gen(certs_renew_frontProxyClientCmd).Standalone()
certs_renew_frontProxyClientCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save the certificates")
certs_renew_frontProxyClientCmd.Flags().String("cert-dir", "", "The path where to save the certificates")
certs_renew_frontProxyClientCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") certs_renew_frontProxyClientCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
certs_renew_frontProxyClientCmd.Flags().String("kubeconfig", "/etc/kubernetes/admin.conf", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.") certs_renew_frontProxyClientCmd.Flags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
certs_renewCmd.AddCommand(certs_renew_frontProxyClientCmd) certs_renewCmd.AddCommand(certs_renew_frontProxyClientCmd)
carapace.Gen(certs_renew_frontProxyClientCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(certs_renew_frontProxyClientCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,9 +13,10 @@ var certs_renew_schedulerConfCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(certs_renew_schedulerConfCmd).Standalone() carapace.Gen(certs_renew_schedulerConfCmd).Standalone()
certs_renew_schedulerConfCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save the certificates")
certs_renew_schedulerConfCmd.Flags().String("cert-dir", "", "The path where to save the certificates")
certs_renew_schedulerConfCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") certs_renew_schedulerConfCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
certs_renew_schedulerConfCmd.Flags().String("kubeconfig", "/etc/kubernetes/admin.conf", "The kubeconfig file to use when talking to the cluster.") certs_renew_schedulerConfCmd.Flags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
certs_renewCmd.AddCommand(certs_renew_schedulerConfCmd) certs_renewCmd.AddCommand(certs_renew_schedulerConfCmd)
carapace.Gen(certs_renew_schedulerConfCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(certs_renew_schedulerConfCmd).FlagCompletion(carapace.ActionMap{

View File

@ -0,0 +1,27 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var certs_renew_superAdminConfCmd = &cobra.Command{
Use: "super-admin.conf",
Short: "Renew the certificate embedded in the kubeconfig file for the super-admin",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(certs_renew_superAdminConfCmd).Standalone()
certs_renew_superAdminConfCmd.Flags().String("cert-dir", "", "The path where to save the certificates")
certs_renew_superAdminConfCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
certs_renew_superAdminConfCmd.Flags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
certs_renewCmd.AddCommand(certs_renew_superAdminConfCmd)
carapace.Gen(certs_renew_superAdminConfCmd).FlagCompletion(carapace.ActionMap{
"cert-dir": carapace.ActionDirectories(),
"config": carapace.ActionFiles(),
"kubeconfig": carapace.ActionFiles(),
})
}

View File

@ -6,13 +6,14 @@ import (
) )
var completionCmd = &cobra.Command{ var completionCmd = &cobra.Command{
Use: "completion", Use: "completion SHELL",
Short: "Output shell completion code for the specified shell (bash or zsh)", Short: "Output shell completion code for the specified shell (bash or zsh)",
Run: func(cmd *cobra.Command, args []string) {}, Run: func(cmd *cobra.Command, args []string) {},
} }
func init() { func init() {
carapace.Gen(completionCmd).Standalone() carapace.Gen(completionCmd).Standalone()
rootCmd.AddCommand(completionCmd) rootCmd.AddCommand(completionCmd)
carapace.Gen(completionCmd).PositionalCompletion( carapace.Gen(completionCmd).PositionalCompletion(

View File

@ -13,7 +13,8 @@ var configCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(configCmd).Standalone() carapace.Gen(configCmd).Standalone()
configCmd.PersistentFlags().String("kubeconfig", "~/.kube/config", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
configCmd.PersistentFlags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
rootCmd.AddCommand(configCmd) rootCmd.AddCommand(configCmd)
carapace.Gen(configCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(configCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,5 +13,6 @@ var config_imagesCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(config_imagesCmd).Standalone() carapace.Gen(config_imagesCmd).Standalone()
configCmd.AddCommand(config_imagesCmd) configCmd.AddCommand(config_imagesCmd)
} }

View File

@ -2,6 +2,7 @@ package cmd
import ( import (
"github.com/carapace-sh/carapace" "github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/kubeadm"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -13,18 +14,20 @@ var config_images_listCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(config_images_listCmd).Standalone() carapace.Gen(config_images_listCmd).Standalone()
config_images_listCmd.Flags().Bool("allow-missing-template-keys", true, "If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.")
config_images_listCmd.Flags().Bool("allow-missing-template-keys", false, "If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.")
config_images_listCmd.PersistentFlags().String("config", "", "Path to a kubeadm configuration file.") config_images_listCmd.PersistentFlags().String("config", "", "Path to a kubeadm configuration file.")
config_images_listCmd.Flags().StringP("experimental-output", "o", "text", "Output format.") config_images_listCmd.PersistentFlags().String("feature-gates", "", "A set of key=value pairs that describe feature gates for various features. Options are:")
config_images_listCmd.PersistentFlags().String("feature-gates", "", "A set of key=value pairs that describe feature gates for various features.") config_images_listCmd.PersistentFlags().String("image-repository", "", "Choose a container registry to pull control plane images from")
config_images_listCmd.PersistentFlags().String("image-repository", "k8s.gcr.io", "Choose a container registry to pull control plane images from") config_images_listCmd.PersistentFlags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
config_images_listCmd.PersistentFlags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") config_images_listCmd.Flags().StringP("output", "o", "", "Output format. One of: text|json|yaml|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.")
config_images_listCmd.Flags().Bool("show-managed-fields", false, "If true, keep the managedFields when printing objects in JSON or YAML format.") config_images_listCmd.Flags().Bool("show-managed-fields", false, "If true, keep the managedFields when printing objects in JSON or YAML format.")
config_imagesCmd.AddCommand(config_images_listCmd) config_imagesCmd.AddCommand(config_images_listCmd)
// TODO feature-gates // TODO feature-gates
carapace.Gen(config_images_listCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(config_images_listCmd).FlagCompletion(carapace.ActionMap{
"config": carapace.ActionFiles(), "config": carapace.ActionFiles(),
"experimental-output": carapace.ActionValues("text", "json", "yaml", "go-template", "go-template-file", "template", "templatefile", "jsonpath", "jsonpath-as-json", "jsonpath-file"), "feature-gates": kubeadm.ActionFeatureGates(),
"output": kubeadm.ActionOutputFormats(),
}) })
} }

View File

@ -2,6 +2,7 @@ package cmd
import ( import (
"github.com/carapace-sh/carapace" "github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/kubeadm"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -13,15 +14,17 @@ var config_images_pullCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(config_images_pullCmd).Standalone() carapace.Gen(config_images_pullCmd).Standalone()
config_images_pullCmd.PersistentFlags().String("config", "", "Path to a kubeadm configuration file.") config_images_pullCmd.PersistentFlags().String("config", "", "Path to a kubeadm configuration file.")
config_images_pullCmd.PersistentFlags().String("cri-socket", "", "Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this value; use this option only if you have more than one CRI installed or if you have non-standard CRI socket.") config_images_pullCmd.PersistentFlags().String("cri-socket", "", "Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this value; use this option only if you have more than one CRI installed or if you have non-standard CRI socket.")
config_images_pullCmd.PersistentFlags().String("feature-gates", "", "A set of key=value pairs that describe feature gates for various features.") config_images_pullCmd.PersistentFlags().String("feature-gates", "", "A set of key=value pairs that describe feature gates for various features. Options are:")
config_images_pullCmd.PersistentFlags().String("image-repository", "k8s.gcr.io", "Choose a container registry to pull control plane images from") config_images_pullCmd.PersistentFlags().String("image-repository", "", "Choose a container registry to pull control plane images from")
config_images_pullCmd.PersistentFlags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") config_images_pullCmd.PersistentFlags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
config_imagesCmd.AddCommand(config_images_pullCmd) config_imagesCmd.AddCommand(config_images_pullCmd)
carapace.Gen(config_images_pullCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(config_images_pullCmd).FlagCompletion(carapace.ActionMap{
"config": carapace.ActionFiles(), "config": carapace.ActionFiles(),
"cri-socket": carapace.ActionFiles(), "cri-socket": carapace.ActionFiles(),
"feature-gates": kubeadm.ActionFeatureGates(),
}) })
} }

View File

@ -13,5 +13,6 @@ var config_printCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(config_printCmd).Standalone() carapace.Gen(config_printCmd).Standalone()
configCmd.AddCommand(config_printCmd) configCmd.AddCommand(config_printCmd)
} }

View File

@ -13,7 +13,8 @@ var config_print_initDefaultsCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(config_print_initDefaultsCmd).Standalone() carapace.Gen(config_print_initDefaultsCmd).Standalone()
config_print_initDefaultsCmd.Flags().StringSlice("component-configs", []string{}, "A comma-separated list for component config API objects to print the default values for.")
config_print_initDefaultsCmd.Flags().StringSlice("component-configs", []string{}, "A comma-separated list for component config API objects to print the default values for. Available values: [KubeProxyConfiguration KubeletConfiguration]. If this flag is not set, no component configs will be printed.")
config_printCmd.AddCommand(config_print_initDefaultsCmd) config_printCmd.AddCommand(config_print_initDefaultsCmd)
carapace.Gen(config_print_initDefaultsCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(config_print_initDefaultsCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,10 +13,6 @@ var config_print_joinDefaultsCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(config_print_joinDefaultsCmd).Standalone() carapace.Gen(config_print_joinDefaultsCmd).Standalone()
config_print_joinDefaultsCmd.Flags().StringSlice("component-configs", []string{}, "A comma-separated list for component config API objects to print the default values for. Available values: [KubeProxyConfiguration KubeletConfiguration]. If this flag is not set, no component configs will be printed.")
config_printCmd.AddCommand(config_print_joinDefaultsCmd)
carapace.Gen(config_print_joinDefaultsCmd).FlagCompletion(carapace.ActionMap{ config_printCmd.AddCommand(config_print_joinDefaultsCmd)
"component-configs": carapace.ActionValues("KubeProxyConfiguration", "KubeletConfiguration").UniqueList(","),
})
} }

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var config_print_resetDefaultsCmd = &cobra.Command{
Use: "reset-defaults",
Short: "Print default reset configuration, that can be used for 'kubeadm reset'",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(config_print_resetDefaultsCmd).Standalone()
config_printCmd.AddCommand(config_print_resetDefaultsCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var config_print_upgradeDefaultsCmd = &cobra.Command{
Use: "upgrade-defaults",
Short: "Print default upgrade configuration, that can be used for 'kubeadm upgrade'",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(config_print_upgradeDefaultsCmd).Standalone()
config_printCmd.AddCommand(config_print_upgradeDefaultsCmd)
}

View File

@ -0,0 +1,24 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var config_validateCmd = &cobra.Command{
Use: "validate",
Short: "Read a file containing the kubeadm configuration API and report any validation problems",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(config_validateCmd).Standalone()
config_validateCmd.Flags().Bool("allow-experimental-api", false, "Allow validation of experimental, unreleased APIs.")
config_validateCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
configCmd.AddCommand(config_validateCmd)
carapace.Gen(config_validateCmd).FlagCompletion(carapace.ActionMap{
"config": carapace.ActionFiles(),
})
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var helpCmd = &cobra.Command{
Use: "help [command]",
Short: "Help about any command",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(helpCmd).Standalone()
rootCmd.AddCommand(helpCmd)
}

View File

@ -3,6 +3,8 @@ package cmd
import ( import (
"github.com/carapace-sh/carapace" "github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/completers/kubeadm_completer/cmd/action" "github.com/carapace-sh/carapace-bin/completers/kubeadm_completer/cmd/action"
"github.com/carapace-sh/carapace-bin/pkg/actions/net"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/kubeadm"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -14,37 +16,40 @@ var initCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(initCmd).Standalone() carapace.Gen(initCmd).Standalone()
initCmd.Flags().String("apiserver-advertise-address", "", "The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.") initCmd.Flags().String("apiserver-advertise-address", "", "The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.")
initCmd.Flags().Int32("apiserver-bind-port", 6443, "Port for the API Server to bind to.") initCmd.Flags().String("apiserver-bind-port", "", "Port for the API Server to bind to.")
initCmd.Flags().StringSlice("apiserver-cert-extra-sans", []string{}, "Optional extra Subject Alternative Names (SANs) to use for the API Server serving certificate. Can be both IP addresses and DNS names.") initCmd.Flags().StringSlice("apiserver-cert-extra-sans", []string{}, "Optional extra Subject Alternative Names (SANs) to use for the API Server serving certificate. Can be both IP addresses and DNS names.")
initCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save and store the certificates.") initCmd.Flags().String("cert-dir", "", "The path where to save and store the certificates.")
initCmd.Flags().String("certificate-key", "", "Key used to encrypt the control-plane certificates in the kubeadm-certs Secret.") initCmd.Flags().String("certificate-key", "", "Key used to encrypt the control-plane certificates in the kubeadm-certs Secret. The certificate key is a hex encoded string that is an AES key of size 32 bytes.")
initCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") initCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
initCmd.Flags().String("control-plane-endpoint", "", "Specify a stable IP address or DNS name for the control plane.") initCmd.Flags().String("control-plane-endpoint", "", "Specify a stable IP address or DNS name for the control plane.")
initCmd.Flags().String("cri-socket", "", "Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this value; use this option only if you have more than one CRI installed or if you have non-standard CRI socket.") initCmd.Flags().String("cri-socket", "", "Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this value; use this option only if you have more than one CRI installed or if you have non-standard CRI socket.")
initCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.") initCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
initCmd.Flags().String("feature-gates", "", "A set of key=value pairs that describe feature gates for various features.") initCmd.Flags().String("feature-gates", "", "A set of key=value pairs that describe feature gates for various features. Options are:")
initCmd.Flags().StringSlice("ignore-preflight-errors", []string{}, "A list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedUser,Swap'. Value 'all' ignores errors from all checks.") initCmd.Flags().StringSlice("ignore-preflight-errors", []string{}, "A list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedUser,Swap'. Value 'all' ignores errors from all checks.")
initCmd.Flags().String("image-repository", "k8s.gcr.io", "Choose a container registry to pull control plane images from") initCmd.Flags().String("image-repository", "", "Choose a container registry to pull control plane images from")
initCmd.Flags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") initCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
initCmd.Flags().String("node-name", "", "Specify the node name.") initCmd.Flags().String("node-name", "", "Specify the node name.")
initCmd.Flags().String("patches", "", "Path to a directory that contains files named \"target[suffix][+patchtype].extension\".") initCmd.Flags().String("patches", "", "Path to a directory that contains files named \"target[suffix][+patchtype].extension\". For example, \"kube-apiserver0+merge.yaml\" or just \"etcd.json\". \"target\" can be one of \"kube-apiserver\", \"kube-controller-manager\", \"kube-scheduler\", \"etcd\", \"kubeletconfiguration\", \"corednsdeployment\". \"patchtype\" can be one of \"strategic\", \"merge\" or \"json\" and they match the patch formats supported by kubectl. The default \"patchtype\" is \"strategic\". \"extension\" must be either \"json\" or \"yaml\". \"suffix\" is an optional string that can be used to determine which patches are applied first alpha-numerically.")
initCmd.Flags().String("pod-network-cidr", "", "Specify range of IP addresses for the pod network.") initCmd.Flags().String("pod-network-cidr", "", "Specify range of IP addresses for the pod network. If set, the control plane will automatically allocate CIDRs for every node.")
initCmd.Flags().String("service-cidr", "10.96.0.0/12", "Use alternative range of IP address for service VIPs.") initCmd.Flags().String("service-cidr", "", "Use alternative range of IP address for service VIPs.")
initCmd.Flags().String("service-dns-domain", "cluster.local", "Use alternative domain for services, e.g. \"myorg.internal\".") initCmd.Flags().String("service-dns-domain", "", "Use alternative domain for services, e.g. \"myorg.internal\".")
initCmd.Flags().Bool("skip-certificate-key-print", false, "Don't print the key used to encrypt the control-plane certificates.") initCmd.Flags().Bool("skip-certificate-key-print", false, "Don't print the key used to encrypt the control-plane certificates.")
initCmd.Flags().StringSlice("skip-phases", []string{}, "List of phases to be skipped") initCmd.Flags().StringSlice("skip-phases", []string{}, "List of phases to be skipped")
initCmd.Flags().Bool("skip-token-print", false, "Skip printing of the default bootstrap token generated by 'kubeadm init'.") initCmd.Flags().Bool("skip-token-print", false, "Skip printing of the default bootstrap token generated by 'kubeadm init'.")
initCmd.Flags().String("token", "", "The token to use for establishing bidirectional trust between nodes and control-plane nodes.") initCmd.Flags().String("token", "", "The token to use for establishing bidirectional trust between nodes and control-plane nodes. The format is [a-z0-9]{6}\\.[a-z0-9]{16} - e.g. abcdef.0123456789abcdef")
initCmd.Flags().String("token-ttl", "", "The duration before the token is automatically deleted (e.g. 1s, 2m, 3h). If set to '0', the token will never expire") initCmd.Flags().String("token-ttl", "", "The duration before the token is automatically deleted (e.g. 1s, 2m, 3h). If set to '0', the token will never expire")
initCmd.Flags().Bool("upload-certs", false, "Upload control-plane certificates to the kubeadm-certs Secret.") initCmd.Flags().Bool("upload-certs", false, "Upload control-plane certificates to the kubeadm-certs Secret.")
rootCmd.AddCommand(initCmd) rootCmd.AddCommand(initCmd)
carapace.Gen(initCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(initCmd).FlagCompletion(carapace.ActionMap{
"apiserver-bind-port": net.ActionPorts(),
"cert-dir": carapace.ActionDirectories(), "cert-dir": carapace.ActionDirectories(),
"certificate-key": carapace.ActionFiles(), "certificate-key": carapace.ActionFiles(),
"config": carapace.ActionFiles(), "config": carapace.ActionFiles(),
"cri-socket": carapace.ActionFiles(), "cri-socket": carapace.ActionFiles(),
"feature-gates": kubeadm.ActionFeatureGates(),
"ignore-preflight-errors": action.ActionChecks().UniqueList(","), "ignore-preflight-errors": action.ActionChecks().UniqueList(","),
"patches": carapace.ActionDirectories(), "patches": carapace.ActionDirectories(),
"skip-phases": carapace.ActionMultiParts(",", func(c carapace.Context) carapace.Action { "skip-phases": carapace.ActionMultiParts(",", func(c carapace.Context) carapace.Action {

View File

@ -7,11 +7,12 @@ import (
var init_phaseCmd = &cobra.Command{ var init_phaseCmd = &cobra.Command{
Use: "phase", Use: "phase",
Short: "Use this command to invoke single phase of the init workflow", Short: "Use this command to invoke single phase of the \"init\" workflow",
Run: func(cmd *cobra.Command, args []string) {}, Run: func(cmd *cobra.Command, args []string) {},
} }
func init() { func init() {
carapace.Gen(init_phaseCmd).Standalone() carapace.Gen(init_phaseCmd).Standalone()
initCmd.AddCommand(init_phaseCmd) initCmd.AddCommand(init_phaseCmd)
} }

View File

@ -13,5 +13,6 @@ var init_phase_addonCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_addonCmd).Standalone() carapace.Gen(init_phase_addonCmd).Standalone()
init_phaseCmd.AddCommand(init_phase_addonCmd) init_phaseCmd.AddCommand(init_phase_addonCmd)
} }

View File

@ -2,6 +2,8 @@ package cmd
import ( import (
"github.com/carapace-sh/carapace" "github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/net"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/kubeadm"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -13,21 +15,25 @@ var init_phase_addon_allCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_addon_allCmd).Standalone() carapace.Gen(init_phase_addon_allCmd).Standalone()
init_phase_addon_allCmd.Flags().String("apiserver-advertise-address", "", "The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.") init_phase_addon_allCmd.Flags().String("apiserver-advertise-address", "", "The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.")
init_phase_addon_allCmd.Flags().Int32("apiserver-bind-port", 6443, "Port for the API Server to bind to.") init_phase_addon_allCmd.Flags().String("apiserver-bind-port", "", "Port for the API Server to bind to.")
init_phase_addon_allCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_addon_allCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_addon_allCmd.Flags().String("control-plane-endpoint", "", "Specify a stable IP address or DNS name for the control plane.") init_phase_addon_allCmd.Flags().String("control-plane-endpoint", "", "Specify a stable IP address or DNS name for the control plane.")
init_phase_addon_allCmd.Flags().String("feature-gates", "", "A set of key=value pairs that describe feature gates for various features.") init_phase_addon_allCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_addon_allCmd.Flags().String("image-repository", "k8s.gcr.io", "Choose a container registry to pull control plane images from") init_phase_addon_allCmd.Flags().String("feature-gates", "", "A set of key=value pairs that describe feature gates for various features. Options are:")
init_phase_addon_allCmd.Flags().String("kubeconfig", "/etc/kubernetes/admin.conf", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.") init_phase_addon_allCmd.Flags().String("image-repository", "", "Choose a container registry to pull control plane images from")
init_phase_addon_allCmd.Flags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") init_phase_addon_allCmd.Flags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
init_phase_addon_allCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
init_phase_addon_allCmd.Flags().String("pod-network-cidr", "", "Specify range of IP addresses for the pod network. If set, the control plane will automatically allocate CIDRs for every node.") init_phase_addon_allCmd.Flags().String("pod-network-cidr", "", "Specify range of IP addresses for the pod network. If set, the control plane will automatically allocate CIDRs for every node.")
init_phase_addon_allCmd.Flags().String("service-cidr", "10.96.0.0/12", "Use alternative range of IP address for service VIPs.") init_phase_addon_allCmd.Flags().String("service-cidr", "", "Use alternative range of IP address for service VIPs.")
init_phase_addon_allCmd.Flags().String("service-dns-domain", "cluster.local", "Use alternative domain for services, e.g. \"myorg.internal\".") init_phase_addon_allCmd.Flags().String("service-dns-domain", "", "Use alternative domain for services, e.g. \"myorg.internal\".")
init_phase_addonCmd.AddCommand(init_phase_addon_allCmd) init_phase_addonCmd.AddCommand(init_phase_addon_allCmd)
carapace.Gen(init_phase_addon_allCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_addon_allCmd).FlagCompletion(carapace.ActionMap{
"config": carapace.ActionFiles(), "apiserver-bind-port": net.ActionPorts(),
"kubeconfig": carapace.ActionFiles(), "config": carapace.ActionFiles(),
"feature-gates": kubeadm.ActionFeatureGates(),
"kubeconfig": carapace.ActionFiles(),
}) })
} }

View File

@ -2,6 +2,7 @@ package cmd
import ( import (
"github.com/carapace-sh/carapace" "github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/kubeadm"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -13,12 +14,21 @@ var init_phase_addon_corednsCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_addon_corednsCmd).Standalone() carapace.Gen(init_phase_addon_corednsCmd).Standalone()
init_phase_addon_corednsCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_addon_corednsCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_addon_corednsCmd.Flags().String("feature-gates", "", "A set of key=value pairs that describe feature gates for various features.") init_phase_addon_corednsCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_addon_corednsCmd.Flags().String("image-repository", "k8s.gcr.io", "Choose a container registry to pull control plane images from") init_phase_addon_corednsCmd.Flags().String("feature-gates", "", "A set of key=value pairs that describe feature gates for various features. Options are:")
init_phase_addon_corednsCmd.Flags().String("kubeconfig", "/etc/kubernetes/admin.conf", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.") init_phase_addon_corednsCmd.Flags().String("image-repository", "", "Choose a container registry to pull control plane images from")
init_phase_addon_corednsCmd.Flags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") init_phase_addon_corednsCmd.Flags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
init_phase_addon_corednsCmd.Flags().String("service-cidr", "10.96.0.0/12", "Use alternative range of IP address for service VIPs.") init_phase_addon_corednsCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
init_phase_addon_corednsCmd.Flags().String("service-dns-domain", "cluster.local", "Use alternative domain for services, e.g. \"myorg.internal\".") init_phase_addon_corednsCmd.Flags().Bool("print-manifest", false, "Print the addon manifests to STDOUT instead of installing them")
init_phase_addon_corednsCmd.Flags().String("service-cidr", "", "Use alternative range of IP address for service VIPs.")
init_phase_addon_corednsCmd.Flags().String("service-dns-domain", "", "Use alternative domain for services, e.g. \"myorg.internal\".")
init_phase_addonCmd.AddCommand(init_phase_addon_corednsCmd) init_phase_addonCmd.AddCommand(init_phase_addon_corednsCmd)
carapace.Gen(init_phase_addon_corednsCmd).FlagCompletion(carapace.ActionMap{
"config": carapace.ActionFiles(),
"feature-gates": kubeadm.ActionFeatureGates(),
"kubeconfig": carapace.ActionFiles(),
})
} }

View File

@ -2,6 +2,7 @@ package cmd
import ( import (
"github.com/carapace-sh/carapace" "github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/net"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -13,18 +14,22 @@ var init_phase_addon_kubeProxyCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_addon_kubeProxyCmd).Standalone() carapace.Gen(init_phase_addon_kubeProxyCmd).Standalone()
init_phase_addon_kubeProxyCmd.Flags().String("apiserver-advertise-address", "", "The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.") init_phase_addon_kubeProxyCmd.Flags().String("apiserver-advertise-address", "", "The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.")
init_phase_addon_kubeProxyCmd.Flags().Int32("apiserver-bind-port", 6443, "Port for the API Server to bind to.") init_phase_addon_kubeProxyCmd.Flags().String("apiserver-bind-port", "", "Port for the API Server to bind to.")
init_phase_addon_kubeProxyCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_addon_kubeProxyCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_addon_kubeProxyCmd.Flags().String("control-plane-endpoint", "", "Specify a stable IP address or DNS name for the control plane.") init_phase_addon_kubeProxyCmd.Flags().String("control-plane-endpoint", "", "Specify a stable IP address or DNS name for the control plane.")
init_phase_addon_kubeProxyCmd.Flags().String("image-repository", "k8s.gcr.io", "Choose a container registry to pull control plane images from") init_phase_addon_kubeProxyCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_addon_kubeProxyCmd.Flags().String("kubeconfig", "/etc/kubernetes/admin.conf", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.") init_phase_addon_kubeProxyCmd.Flags().String("image-repository", "", "Choose a container registry to pull control plane images from")
init_phase_addon_kubeProxyCmd.Flags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") init_phase_addon_kubeProxyCmd.Flags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
init_phase_addon_kubeProxyCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
init_phase_addon_kubeProxyCmd.Flags().String("pod-network-cidr", "", "Specify range of IP addresses for the pod network. If set, the control plane will automatically allocate CIDRs for every node.") init_phase_addon_kubeProxyCmd.Flags().String("pod-network-cidr", "", "Specify range of IP addresses for the pod network. If set, the control plane will automatically allocate CIDRs for every node.")
init_phase_addon_kubeProxyCmd.Flags().Bool("print-manifest", false, "Print the addon manifests to STDOUT instead of installing them")
init_phase_addonCmd.AddCommand(init_phase_addon_kubeProxyCmd) init_phase_addonCmd.AddCommand(init_phase_addon_kubeProxyCmd)
carapace.Gen(init_phase_addon_kubeProxyCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_addon_kubeProxyCmd).FlagCompletion(carapace.ActionMap{
"config": carapace.ActionFiles(), "apiserver-bind-port": net.ActionPorts(),
"kubeconfig": carapace.ActionFiles(), "config": carapace.ActionFiles(),
"kubeconfig": carapace.ActionFiles(),
}) })
} }

View File

@ -6,15 +6,18 @@ import (
) )
var init_phase_bootstrapTokenCmd = &cobra.Command{ var init_phase_bootstrapTokenCmd = &cobra.Command{
Use: "bootstrap-token", Use: "bootstrap-token",
Short: "Generates bootstrap tokens used to join a node to a cluster", Short: "Generates bootstrap tokens used to join a node to a cluster",
Run: func(cmd *cobra.Command, args []string) {}, Aliases: []string{"bootstraptoken"},
Run: func(cmd *cobra.Command, args []string) {},
} }
func init() { func init() {
carapace.Gen(init_phase_bootstrapTokenCmd).Standalone() carapace.Gen(init_phase_bootstrapTokenCmd).Standalone()
init_phase_bootstrapTokenCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_bootstrapTokenCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_bootstrapTokenCmd.Flags().String("kubeconfig", "/etc/kubernetes/admin.conf", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.") init_phase_bootstrapTokenCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_bootstrapTokenCmd.Flags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
init_phase_bootstrapTokenCmd.Flags().Bool("skip-token-print", false, "Skip printing of the default bootstrap token generated by 'kubeadm init'.") init_phase_bootstrapTokenCmd.Flags().Bool("skip-token-print", false, "Skip printing of the default bootstrap token generated by 'kubeadm init'.")
init_phaseCmd.AddCommand(init_phase_bootstrapTokenCmd) init_phaseCmd.AddCommand(init_phase_bootstrapTokenCmd)

View File

@ -13,5 +13,6 @@ var init_phase_certsCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_certsCmd).Standalone() carapace.Gen(init_phase_certsCmd).Standalone()
init_phaseCmd.AddCommand(init_phase_certsCmd) init_phaseCmd.AddCommand(init_phase_certsCmd)
} }

View File

@ -13,14 +13,16 @@ var init_phase_certs_allCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_certs_allCmd).Standalone() carapace.Gen(init_phase_certs_allCmd).Standalone()
init_phase_certs_allCmd.Flags().String("apiserver-advertise-address", "", "The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.") init_phase_certs_allCmd.Flags().String("apiserver-advertise-address", "", "The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.")
init_phase_certs_allCmd.Flags().StringSlice("apiserver-cert-extra-sans", []string{}, "Optional extra Subject Alternative Names (SANs) to use for the API Server serving certificate. Can be both IP addresses and DNS names.") init_phase_certs_allCmd.Flags().StringSlice("apiserver-cert-extra-sans", []string{}, "Optional extra Subject Alternative Names (SANs) to use for the API Server serving certificate. Can be both IP addresses and DNS names.")
init_phase_certs_allCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save and store the certificates.") init_phase_certs_allCmd.Flags().String("cert-dir", "", "The path where to save and store the certificates.")
init_phase_certs_allCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_certs_allCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_certs_allCmd.Flags().String("control-plane-endpoint", "", "Specify a stable IP address or DNS name for the control plane.") init_phase_certs_allCmd.Flags().String("control-plane-endpoint", "", "Specify a stable IP address or DNS name for the control plane.")
init_phase_certs_allCmd.Flags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") init_phase_certs_allCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_certs_allCmd.Flags().String("service-cidr", "10.96.0.0/12", "Use alternative range of IP address for service VIPs.") init_phase_certs_allCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
init_phase_certs_allCmd.Flags().String("service-dns-domain", "cluster.local", "Use alternative domain for services, e.g. \"myorg.internal\".") init_phase_certs_allCmd.Flags().String("service-cidr", "", "Use alternative range of IP address for service VIPs.")
init_phase_certs_allCmd.Flags().String("service-dns-domain", "", "Use alternative domain for services, e.g. \"myorg.internal\".")
init_phase_certsCmd.AddCommand(init_phase_certs_allCmd) init_phase_certsCmd.AddCommand(init_phase_certs_allCmd)
carapace.Gen(init_phase_certs_allCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_certs_allCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,14 +13,16 @@ var init_phase_certs_apiserverCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_certs_apiserverCmd).Standalone() carapace.Gen(init_phase_certs_apiserverCmd).Standalone()
init_phase_certs_apiserverCmd.Flags().String("apiserver-advertise-address", "", "The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.") init_phase_certs_apiserverCmd.Flags().String("apiserver-advertise-address", "", "The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.")
init_phase_certs_apiserverCmd.Flags().StringSlice("apiserver-cert-extra-sans", []string{}, "Optional extra Subject Alternative Names (SANs) to use for the API Server serving certificate. Can be both IP addresses and DNS names.") init_phase_certs_apiserverCmd.Flags().StringSlice("apiserver-cert-extra-sans", []string{}, "Optional extra Subject Alternative Names (SANs) to use for the API Server serving certificate. Can be both IP addresses and DNS names.")
init_phase_certs_apiserverCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save and store the certificates.") init_phase_certs_apiserverCmd.Flags().String("cert-dir", "", "The path where to save and store the certificates.")
init_phase_certs_apiserverCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_certs_apiserverCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_certs_apiserverCmd.Flags().String("control-plane-endpoint", "", "Specify a stable IP address or DNS name for the control plane.") init_phase_certs_apiserverCmd.Flags().String("control-plane-endpoint", "", "Specify a stable IP address or DNS name for the control plane.")
init_phase_certs_apiserverCmd.Flags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") init_phase_certs_apiserverCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_certs_apiserverCmd.Flags().String("service-cidr", "10.96.0.0/12", "Use alternative range of IP address for service VIPs.") init_phase_certs_apiserverCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
init_phase_certs_apiserverCmd.Flags().String("service-dns-domain", "cluster.local", "Use alternative domain for services, e.g. \"myorg.internal\".") init_phase_certs_apiserverCmd.Flags().String("service-cidr", "", "Use alternative range of IP address for service VIPs.")
init_phase_certs_apiserverCmd.Flags().String("service-dns-domain", "", "Use alternative domain for services, e.g. \"myorg.internal\".")
init_phase_certsCmd.AddCommand(init_phase_certs_apiserverCmd) init_phase_certsCmd.AddCommand(init_phase_certs_apiserverCmd)
carapace.Gen(init_phase_certs_apiserverCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_certs_apiserverCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,9 +13,11 @@ var init_phase_certs_apiserverEtcdClientCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_certs_apiserverEtcdClientCmd).Standalone() carapace.Gen(init_phase_certs_apiserverEtcdClientCmd).Standalone()
init_phase_certs_apiserverEtcdClientCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save and store the certificates.")
init_phase_certs_apiserverEtcdClientCmd.Flags().String("cert-dir", "", "The path where to save and store the certificates.")
init_phase_certs_apiserverEtcdClientCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_certs_apiserverEtcdClientCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_certs_apiserverEtcdClientCmd.Flags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") init_phase_certs_apiserverEtcdClientCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_certs_apiserverEtcdClientCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
init_phase_certsCmd.AddCommand(init_phase_certs_apiserverEtcdClientCmd) init_phase_certsCmd.AddCommand(init_phase_certs_apiserverEtcdClientCmd)
carapace.Gen(init_phase_certs_apiserverEtcdClientCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_certs_apiserverEtcdClientCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,9 +13,11 @@ var init_phase_certs_apiserverKubeletClientCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_certs_apiserverKubeletClientCmd).Standalone() carapace.Gen(init_phase_certs_apiserverKubeletClientCmd).Standalone()
init_phase_certs_apiserverKubeletClientCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save and store the certificates.")
init_phase_certs_apiserverKubeletClientCmd.Flags().String("cert-dir", "", "The path where to save and store the certificates.")
init_phase_certs_apiserverKubeletClientCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_certs_apiserverKubeletClientCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_certs_apiserverKubeletClientCmd.Flags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") init_phase_certs_apiserverKubeletClientCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_certs_apiserverKubeletClientCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
init_phase_certsCmd.AddCommand(init_phase_certs_apiserverKubeletClientCmd) init_phase_certsCmd.AddCommand(init_phase_certs_apiserverKubeletClientCmd)
carapace.Gen(init_phase_certs_apiserverKubeletClientCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_certs_apiserverKubeletClientCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,9 +13,11 @@ var init_phase_certs_caCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_certs_caCmd).Standalone() carapace.Gen(init_phase_certs_caCmd).Standalone()
init_phase_certs_caCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save and store the certificates.")
init_phase_certs_caCmd.Flags().String("cert-dir", "", "The path where to save and store the certificates.")
init_phase_certs_caCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_certs_caCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_certs_caCmd.Flags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") init_phase_certs_caCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_certs_caCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
init_phase_certsCmd.AddCommand(init_phase_certs_caCmd) init_phase_certsCmd.AddCommand(init_phase_certs_caCmd)
carapace.Gen(init_phase_certs_caCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_certs_caCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,9 +13,11 @@ var init_phase_certs_etcdCaCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_certs_etcdCaCmd).Standalone() carapace.Gen(init_phase_certs_etcdCaCmd).Standalone()
init_phase_certs_etcdCaCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save and store the certificates.")
init_phase_certs_etcdCaCmd.Flags().String("cert-dir", "", "The path where to save and store the certificates.")
init_phase_certs_etcdCaCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_certs_etcdCaCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_certs_etcdCaCmd.Flags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") init_phase_certs_etcdCaCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_certs_etcdCaCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
init_phase_certsCmd.AddCommand(init_phase_certs_etcdCaCmd) init_phase_certsCmd.AddCommand(init_phase_certs_etcdCaCmd)
carapace.Gen(init_phase_certs_etcdCaCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_certs_etcdCaCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,9 +13,11 @@ var init_phase_certs_etcdHealthcheckClientCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_certs_etcdHealthcheckClientCmd).Standalone() carapace.Gen(init_phase_certs_etcdHealthcheckClientCmd).Standalone()
init_phase_certs_etcdHealthcheckClientCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save and store the certificates.")
init_phase_certs_etcdHealthcheckClientCmd.Flags().String("cert-dir", "", "The path where to save and store the certificates.")
init_phase_certs_etcdHealthcheckClientCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_certs_etcdHealthcheckClientCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_certs_etcdHealthcheckClientCmd.Flags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") init_phase_certs_etcdHealthcheckClientCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_certs_etcdHealthcheckClientCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
init_phase_certsCmd.AddCommand(init_phase_certs_etcdHealthcheckClientCmd) init_phase_certsCmd.AddCommand(init_phase_certs_etcdHealthcheckClientCmd)
carapace.Gen(init_phase_certs_etcdHealthcheckClientCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_certs_etcdHealthcheckClientCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,9 +13,11 @@ var init_phase_certs_etcdPeerCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_certs_etcdPeerCmd).Standalone() carapace.Gen(init_phase_certs_etcdPeerCmd).Standalone()
init_phase_certs_etcdPeerCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save and store the certificates.")
init_phase_certs_etcdPeerCmd.Flags().String("cert-dir", "", "The path where to save and store the certificates.")
init_phase_certs_etcdPeerCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_certs_etcdPeerCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_certs_etcdPeerCmd.Flags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") init_phase_certs_etcdPeerCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_certs_etcdPeerCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
init_phase_certsCmd.AddCommand(init_phase_certs_etcdPeerCmd) init_phase_certsCmd.AddCommand(init_phase_certs_etcdPeerCmd)
carapace.Gen(init_phase_certs_etcdPeerCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_certs_etcdPeerCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,9 +13,11 @@ var init_phase_certs_etcdServerCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_certs_etcdServerCmd).Standalone() carapace.Gen(init_phase_certs_etcdServerCmd).Standalone()
init_phase_certs_etcdServerCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save and store the certificates.")
init_phase_certs_etcdServerCmd.Flags().String("cert-dir", "", "The path where to save and store the certificates.")
init_phase_certs_etcdServerCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_certs_etcdServerCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_certs_etcdServerCmd.Flags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") init_phase_certs_etcdServerCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_certs_etcdServerCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
init_phase_certsCmd.AddCommand(init_phase_certs_etcdServerCmd) init_phase_certsCmd.AddCommand(init_phase_certs_etcdServerCmd)
carapace.Gen(init_phase_certs_etcdServerCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_certs_etcdServerCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,9 +13,11 @@ var init_phase_certs_frontProxyCaCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_certs_frontProxyCaCmd).Standalone() carapace.Gen(init_phase_certs_frontProxyCaCmd).Standalone()
init_phase_certs_frontProxyCaCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save and store the certificates.")
init_phase_certs_frontProxyCaCmd.Flags().String("cert-dir", "", "The path where to save and store the certificates.")
init_phase_certs_frontProxyCaCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_certs_frontProxyCaCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_certs_frontProxyCaCmd.Flags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") init_phase_certs_frontProxyCaCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_certs_frontProxyCaCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
init_phase_certsCmd.AddCommand(init_phase_certs_frontProxyCaCmd) init_phase_certsCmd.AddCommand(init_phase_certs_frontProxyCaCmd)
carapace.Gen(init_phase_certs_frontProxyCaCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_certs_frontProxyCaCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,9 +13,11 @@ var init_phase_certs_frontProxyClientCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_certs_frontProxyClientCmd).Standalone() carapace.Gen(init_phase_certs_frontProxyClientCmd).Standalone()
init_phase_certs_frontProxyClientCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save and store the certificates.")
init_phase_certs_frontProxyClientCmd.Flags().String("cert-dir", "", "The path where to save and store the certificates.")
init_phase_certs_frontProxyClientCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_certs_frontProxyClientCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_certs_frontProxyClientCmd.Flags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") init_phase_certs_frontProxyClientCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_certs_frontProxyClientCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
init_phase_certsCmd.AddCommand(init_phase_certs_frontProxyClientCmd) init_phase_certsCmd.AddCommand(init_phase_certs_frontProxyClientCmd)
carapace.Gen(init_phase_certs_frontProxyClientCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_certs_frontProxyClientCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,10 +13,15 @@ var init_phase_certs_saCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_certs_saCmd).Standalone() carapace.Gen(init_phase_certs_saCmd).Standalone()
init_phase_certs_saCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save and store the certificates.")
init_phase_certs_saCmd.Flags().String("cert-dir", "", "The path where to save and store the certificates.")
init_phase_certs_saCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_certs_saCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_certs_saCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
init_phase_certsCmd.AddCommand(init_phase_certs_saCmd) init_phase_certsCmd.AddCommand(init_phase_certs_saCmd)
carapace.Gen(init_phase_certs_saCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_certs_saCmd).FlagCompletion(carapace.ActionMap{
"cert-dir": carapace.ActionDirectories(), "cert-dir": carapace.ActionDirectories(),
"config": carapace.ActionFiles(),
}) })
} }

View File

@ -2,6 +2,8 @@ package cmd
import ( import (
"github.com/carapace-sh/carapace" "github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/net"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/kubeadm"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -13,26 +15,32 @@ var init_phase_controlPlane_allCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_controlPlane_allCmd).Standalone() carapace.Gen(init_phase_controlPlane_allCmd).Standalone()
init_phase_controlPlane_allCmd.Flags().String("apiserver-advertise-address", "", "The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.") init_phase_controlPlane_allCmd.Flags().String("apiserver-advertise-address", "", "The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.")
init_phase_controlPlane_allCmd.Flags().Int32("apiserver-bind-port", 6443, "Port for the API Server to bind to.") init_phase_controlPlane_allCmd.Flags().String("apiserver-bind-port", "", "Port for the API Server to bind to.")
init_phase_controlPlane_allCmd.Flags().String("apiserver-extra-args", "", "A set of extra flags to pass to the API Server or override default ones in form of <flagname>=<value>") init_phase_controlPlane_allCmd.Flags().String("apiserver-extra-args", "", "A set of extra flags to pass to the API Server or override default ones in form of <flagname>=<value>")
init_phase_controlPlane_allCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save and store the certificates.") init_phase_controlPlane_allCmd.Flags().String("cert-dir", "", "The path where to save and store the certificates.")
init_phase_controlPlane_allCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_controlPlane_allCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_controlPlane_allCmd.Flags().String("control-plane-endpoint", "", "Specify a stable IP address or DNS name for the control plane.") init_phase_controlPlane_allCmd.Flags().String("control-plane-endpoint", "", "Specify a stable IP address or DNS name for the control plane.")
init_phase_controlPlane_allCmd.Flags().String("controller-manager-extra-args", "", "A set of extra flags to pass to the Controller Manager or override default ones in form of <flagname>=<value>") init_phase_controlPlane_allCmd.Flags().String("controller-manager-extra-args", "", "A set of extra flags to pass to the Controller Manager or override default ones in form of <flagname>=<value>")
init_phase_controlPlane_allCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.") init_phase_controlPlane_allCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_controlPlane_allCmd.Flags().String("feature-gates", "", "A set of key=value pairs that describe feature gates for various features.") init_phase_controlPlane_allCmd.Flags().String("feature-gates", "", "A set of key=value pairs that describe feature gates for various features. Options are:")
init_phase_controlPlane_allCmd.Flags().String("image-repository", "k8s.gcr.io", "Choose a container registry to pull control plane images from") init_phase_controlPlane_allCmd.Flags().String("image-repository", "", "Choose a container registry to pull control plane images from")
init_phase_controlPlane_allCmd.Flags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") init_phase_controlPlane_allCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
init_phase_controlPlane_allCmd.Flags().String("patches", "", "Path to a directory that contains files named \"target[suffix][+patchtype].extension\".") init_phase_controlPlane_allCmd.Flags().String("patches", "", "Path to a directory that contains files named \"target[suffix][+patchtype].extension\". For example, \"kube-apiserver0+merge.yaml\" or just \"etcd.json\". \"target\" can be one of \"kube-apiserver\", \"kube-controller-manager\", \"kube-scheduler\", \"etcd\", \"kubeletconfiguration\", \"corednsdeployment\". \"patchtype\" can be one of \"strategic\", \"merge\" or \"json\" and they match the patch formats supported by kubectl. The default \"patchtype\" is \"strategic\". \"extension\" must be either \"json\" or \"yaml\". \"suffix\" is an optional string that can be used to determine which patches are applied first alpha-numerically.")
init_phase_controlPlane_allCmd.Flags().String("pod-network-cidr", "", "Specify range of IP addresses for the pod network. If set, the control plane will automatically allocate CIDRs for every node.") init_phase_controlPlane_allCmd.Flags().String("pod-network-cidr", "", "Specify range of IP addresses for the pod network. If set, the control plane will automatically allocate CIDRs for every node.")
init_phase_controlPlane_allCmd.Flags().String("scheduler-extra-args", "", "A set of extra flags to pass to the Scheduler or override default ones in form of <flagname>=<value>") init_phase_controlPlane_allCmd.Flags().String("scheduler-extra-args", "", "A set of extra flags to pass to the Scheduler or override default ones in form of <flagname>=<value>")
init_phase_controlPlane_allCmd.Flags().String("service-cidr", "10.96.0.0/12", "Use alternative range of IP address for service VIPs.") init_phase_controlPlane_allCmd.Flags().String("service-cidr", "", "Use alternative range of IP address for service VIPs.")
init_phase_controlPlane_allCmd.Flag("apiserver-extra-args").Hidden = true
init_phase_controlPlane_allCmd.Flag("controller-manager-extra-args").Hidden = true
init_phase_controlPlane_allCmd.Flag("scheduler-extra-args").Hidden = true
init_phase_controlPlaneCmd.AddCommand(init_phase_controlPlane_allCmd) init_phase_controlPlaneCmd.AddCommand(init_phase_controlPlane_allCmd)
carapace.Gen(init_phase_controlPlane_allCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_controlPlane_allCmd).FlagCompletion(carapace.ActionMap{
"cert-dir": carapace.ActionDirectories(), "apiserver-bind-port": net.ActionPorts(),
"config": carapace.ActionFiles(), "cert-dir": carapace.ActionDirectories(),
"patches": carapace.ActionDirectories(), "config": carapace.ActionFiles(),
"feature-gates": kubeadm.ActionFeatureGates(),
"patches": carapace.ActionDirectories(),
}) })
} }

View File

@ -2,6 +2,8 @@ package cmd
import ( import (
"github.com/carapace-sh/carapace" "github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/net"
"github.com/carapace-sh/carapace-bin/pkg/actions/tools/kubeadm"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -13,23 +15,27 @@ var init_phase_controlPlane_apiserverCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_controlPlane_apiserverCmd).Standalone() carapace.Gen(init_phase_controlPlane_apiserverCmd).Standalone()
init_phase_controlPlane_apiserverCmd.Flags().String("apiserver-advertise-address", "", "The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.") init_phase_controlPlane_apiserverCmd.Flags().String("apiserver-advertise-address", "", "The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.")
init_phase_controlPlane_apiserverCmd.Flags().Int32("apiserver-bind-port", 6443, "Port for the API Server to bind to.") init_phase_controlPlane_apiserverCmd.Flags().String("apiserver-bind-port", "", "Port for the API Server to bind to.")
init_phase_controlPlane_apiserverCmd.Flags().String("apiserver-extra-args", "", "A set of extra flags to pass to the API Server or override default ones in form of <flagname>=<value>") init_phase_controlPlane_apiserverCmd.Flags().String("apiserver-extra-args", "", "A set of extra flags to pass to the API Server or override default ones in form of <flagname>=<value>")
init_phase_controlPlane_apiserverCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save and store the certificates.") init_phase_controlPlane_apiserverCmd.Flags().String("cert-dir", "", "The path where to save and store the certificates.")
init_phase_controlPlane_apiserverCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_controlPlane_apiserverCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_controlPlane_apiserverCmd.Flags().String("control-plane-endpoint", "", "Specify a stable IP address or DNS name for the control plane.") init_phase_controlPlane_apiserverCmd.Flags().String("control-plane-endpoint", "", "Specify a stable IP address or DNS name for the control plane.")
init_phase_controlPlane_apiserverCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.") init_phase_controlPlane_apiserverCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_controlPlane_apiserverCmd.Flags().String("feature-gates", "", "A set of key=value pairs that describe feature gates for various features.") init_phase_controlPlane_apiserverCmd.Flags().String("feature-gates", "", "A set of key=value pairs that describe feature gates for various features. Options are:")
init_phase_controlPlane_apiserverCmd.Flags().String("image-repository", "k8s.gcr.io", "Choose a container registry to pull control plane images from") init_phase_controlPlane_apiserverCmd.Flags().String("image-repository", "", "Choose a container registry to pull control plane images from")
init_phase_controlPlane_apiserverCmd.Flags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") init_phase_controlPlane_apiserverCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
init_phase_controlPlane_apiserverCmd.Flags().String("patches", "", "Path to a directory that contains files named \"target[suffix][+patchtype].extension\".") init_phase_controlPlane_apiserverCmd.Flags().String("patches", "", "Path to a directory that contains files named \"target[suffix][+patchtype].extension\". For example, \"kube-apiserver0+merge.yaml\" or just \"etcd.json\". \"target\" can be one of \"kube-apiserver\", \"kube-controller-manager\", \"kube-scheduler\", \"etcd\", \"kubeletconfiguration\", \"corednsdeployment\". \"patchtype\" can be one of \"strategic\", \"merge\" or \"json\" and they match the patch formats supported by kubectl. The default \"patchtype\" is \"strategic\". \"extension\" must be either \"json\" or \"yaml\". \"suffix\" is an optional string that can be used to determine which patches are applied first alpha-numerically.")
init_phase_controlPlane_apiserverCmd.Flags().String("service-cidr", "10.96.0.0/12", "Use alternative range of IP address for service VIPs.") init_phase_controlPlane_apiserverCmd.Flags().String("service-cidr", "", "Use alternative range of IP address for service VIPs.")
init_phase_controlPlane_apiserverCmd.Flag("apiserver-extra-args").Hidden = true
init_phase_controlPlaneCmd.AddCommand(init_phase_controlPlane_apiserverCmd) init_phase_controlPlaneCmd.AddCommand(init_phase_controlPlane_apiserverCmd)
carapace.Gen(init_phase_controlPlane_apiserverCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_controlPlane_apiserverCmd).FlagCompletion(carapace.ActionMap{
"cert-dir": carapace.ActionDirectories(), "apiserver-bind-port": net.ActionPorts(),
"config": carapace.ActionFiles(), "cert-dir": carapace.ActionDirectories(),
"patches": carapace.ActionDirectories(), "config": carapace.ActionFiles(),
"feature-gates": kubeadm.ActionFeatureGates(),
"patches": carapace.ActionDirectories(),
}) })
} }

View File

@ -13,14 +13,16 @@ var init_phase_controlPlane_controllerManagerCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_controlPlane_controllerManagerCmd).Standalone() carapace.Gen(init_phase_controlPlane_controllerManagerCmd).Standalone()
init_phase_controlPlane_controllerManagerCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save and store the certificates.")
init_phase_controlPlane_controllerManagerCmd.Flags().String("cert-dir", "", "The path where to save and store the certificates.")
init_phase_controlPlane_controllerManagerCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_controlPlane_controllerManagerCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_controlPlane_controllerManagerCmd.Flags().String("controller-manager-extra-args", "", "A set of extra flags to pass to the Controller Manager or override default ones in form of <flagname>=<value>") init_phase_controlPlane_controllerManagerCmd.Flags().String("controller-manager-extra-args", "", "A set of extra flags to pass to the Controller Manager or override default ones in form of <flagname>=<value>")
init_phase_controlPlane_controllerManagerCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.") init_phase_controlPlane_controllerManagerCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_controlPlane_controllerManagerCmd.Flags().String("image-repository", "k8s.gcr.io", "Choose a container registry to pull control plane images from") init_phase_controlPlane_controllerManagerCmd.Flags().String("image-repository", "", "Choose a container registry to pull control plane images from")
init_phase_controlPlane_controllerManagerCmd.Flags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") init_phase_controlPlane_controllerManagerCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
init_phase_controlPlane_controllerManagerCmd.Flags().String("patches", "", "Path to a directory that contains files named \"target[suffix][+patchtype].extension\".") init_phase_controlPlane_controllerManagerCmd.Flags().String("patches", "", "Path to a directory that contains files named \"target[suffix][+patchtype].extension\". For example, \"kube-apiserver0+merge.yaml\" or just \"etcd.json\". \"target\" can be one of \"kube-apiserver\", \"kube-controller-manager\", \"kube-scheduler\", \"etcd\", \"kubeletconfiguration\", \"corednsdeployment\". \"patchtype\" can be one of \"strategic\", \"merge\" or \"json\" and they match the patch formats supported by kubectl. The default \"patchtype\" is \"strategic\". \"extension\" must be either \"json\" or \"yaml\". \"suffix\" is an optional string that can be used to determine which patches are applied first alpha-numerically.")
init_phase_controlPlane_controllerManagerCmd.Flags().String("pod-network-cidr", "", "Specify range of IP addresses for the pod network. If set, the control plane will automatically allocate CIDRs for every node.") init_phase_controlPlane_controllerManagerCmd.Flags().String("pod-network-cidr", "", "Specify range of IP addresses for the pod network. If set, the control plane will automatically allocate CIDRs for every node.")
init_phase_controlPlane_controllerManagerCmd.Flag("controller-manager-extra-args").Hidden = true
init_phase_controlPlaneCmd.AddCommand(init_phase_controlPlane_controllerManagerCmd) init_phase_controlPlaneCmd.AddCommand(init_phase_controlPlane_controllerManagerCmd)
carapace.Gen(init_phase_controlPlane_controllerManagerCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_controlPlane_controllerManagerCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,5 +13,6 @@ var init_phase_etcdCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_etcdCmd).Standalone() carapace.Gen(init_phase_etcdCmd).Standalone()
init_phaseCmd.AddCommand(init_phase_etcdCmd) init_phaseCmd.AddCommand(init_phase_etcdCmd)
} }

View File

@ -13,5 +13,6 @@ var init_phase_kubeconfigCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_kubeconfigCmd).Standalone() carapace.Gen(init_phase_kubeconfigCmd).Standalone()
init_phaseCmd.AddCommand(init_phase_kubeconfigCmd) init_phaseCmd.AddCommand(init_phase_kubeconfigCmd)
} }

View File

@ -2,6 +2,7 @@ package cmd
import ( import (
"github.com/carapace-sh/carapace" "github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/net"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -13,18 +14,21 @@ var init_phase_kubeconfig_adminCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_kubeconfig_adminCmd).Standalone() carapace.Gen(init_phase_kubeconfig_adminCmd).Standalone()
init_phase_kubeconfig_adminCmd.Flags().String("apiserver-advertise-address", "", "The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.") init_phase_kubeconfig_adminCmd.Flags().String("apiserver-advertise-address", "", "The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.")
init_phase_kubeconfig_adminCmd.Flags().Int32("apiserver-bind-port", 6443, "Port for the API Server to bind to.") init_phase_kubeconfig_adminCmd.Flags().String("apiserver-bind-port", "", "Port for the API Server to bind to.")
init_phase_kubeconfig_adminCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save and store the certificates.") init_phase_kubeconfig_adminCmd.Flags().String("cert-dir", "", "The path where to save and store the certificates.")
init_phase_kubeconfig_adminCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_kubeconfig_adminCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_kubeconfig_adminCmd.Flags().String("control-plane-endpoint", "", "Specify a stable IP address or DNS name for the control plane.") init_phase_kubeconfig_adminCmd.Flags().String("control-plane-endpoint", "", "Specify a stable IP address or DNS name for the control plane.")
init_phase_kubeconfig_adminCmd.Flags().String("kubeconfig-dir", "/etc/kubernetes", "The path where to save the kubeconfig file.") init_phase_kubeconfig_adminCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_kubeconfig_adminCmd.Flags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") init_phase_kubeconfig_adminCmd.Flags().String("kubeconfig-dir", "", "The path where to save the kubeconfig file.")
init_phase_kubeconfig_adminCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
init_phase_kubeconfigCmd.AddCommand(init_phase_kubeconfig_adminCmd) init_phase_kubeconfigCmd.AddCommand(init_phase_kubeconfig_adminCmd)
carapace.Gen(init_phase_kubeconfig_adminCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_kubeconfig_adminCmd).FlagCompletion(carapace.ActionMap{
"cert-dir": carapace.ActionDirectories(), "apiserver-bind-port": net.ActionPorts(),
"config": carapace.ActionFiles(), "cert-dir": carapace.ActionDirectories(),
"kubeconfig-dir": carapace.ActionDirectories(), "config": carapace.ActionFiles(),
"kubeconfig-dir": carapace.ActionDirectories(),
}) })
} }

View File

@ -2,6 +2,7 @@ package cmd
import ( import (
"github.com/carapace-sh/carapace" "github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/net"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -13,18 +14,21 @@ var init_phase_kubeconfig_controllerManagerCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_kubeconfig_controllerManagerCmd).Standalone() carapace.Gen(init_phase_kubeconfig_controllerManagerCmd).Standalone()
init_phase_kubeconfig_controllerManagerCmd.Flags().String("apiserver-advertise-address", "", "The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.") init_phase_kubeconfig_controllerManagerCmd.Flags().String("apiserver-advertise-address", "", "The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.")
init_phase_kubeconfig_controllerManagerCmd.Flags().Int32("apiserver-bind-port", 6443, "Port for the API Server to bind to.") init_phase_kubeconfig_controllerManagerCmd.Flags().String("apiserver-bind-port", "", "Port for the API Server to bind to.")
init_phase_kubeconfig_controllerManagerCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save and store the certificates.") init_phase_kubeconfig_controllerManagerCmd.Flags().String("cert-dir", "", "The path where to save and store the certificates.")
init_phase_kubeconfig_controllerManagerCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_kubeconfig_controllerManagerCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_kubeconfig_controllerManagerCmd.Flags().String("control-plane-endpoint", "", "Specify a stable IP address or DNS name for the control plane.") init_phase_kubeconfig_controllerManagerCmd.Flags().String("control-plane-endpoint", "", "Specify a stable IP address or DNS name for the control plane.")
init_phase_kubeconfig_controllerManagerCmd.Flags().String("kubeconfig-dir", "/etc/kubernetes", "The path where to save the kubeconfig file.") init_phase_kubeconfig_controllerManagerCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_kubeconfig_controllerManagerCmd.Flags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") init_phase_kubeconfig_controllerManagerCmd.Flags().String("kubeconfig-dir", "", "The path where to save the kubeconfig file.")
init_phase_kubeconfig_controllerManagerCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
init_phase_kubeconfigCmd.AddCommand(init_phase_kubeconfig_controllerManagerCmd) init_phase_kubeconfigCmd.AddCommand(init_phase_kubeconfig_controllerManagerCmd)
carapace.Gen(init_phase_kubeconfig_controllerManagerCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_kubeconfig_controllerManagerCmd).FlagCompletion(carapace.ActionMap{
"cert-dir": carapace.ActionDirectories(), "apiserver-bind-port": net.ActionPorts(),
"config": carapace.ActionFiles(), "cert-dir": carapace.ActionDirectories(),
"kubeconfig-dir": carapace.ActionDirectories(), "config": carapace.ActionFiles(),
"kubeconfig-dir": carapace.ActionDirectories(),
}) })
} }

View File

@ -2,6 +2,7 @@ package cmd
import ( import (
"github.com/carapace-sh/carapace" "github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/net"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -13,19 +14,22 @@ var init_phase_kubeconfig_kubeletCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_kubeconfig_kubeletCmd).Standalone() carapace.Gen(init_phase_kubeconfig_kubeletCmd).Standalone()
init_phase_kubeconfig_kubeletCmd.Flags().String("apiserver-advertise-address", "", "The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.") init_phase_kubeconfig_kubeletCmd.Flags().String("apiserver-advertise-address", "", "The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.")
init_phase_kubeconfig_kubeletCmd.Flags().Int32("apiserver-bind-port", 6443, "Port for the API Server to bind to.") init_phase_kubeconfig_kubeletCmd.Flags().String("apiserver-bind-port", "", "Port for the API Server to bind to.")
init_phase_kubeconfig_kubeletCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save and store the certificates.") init_phase_kubeconfig_kubeletCmd.Flags().String("cert-dir", "", "The path where to save and store the certificates.")
init_phase_kubeconfig_kubeletCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_kubeconfig_kubeletCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_kubeconfig_kubeletCmd.Flags().String("control-plane-endpoint", "", "Specify a stable IP address or DNS name for the control plane.") init_phase_kubeconfig_kubeletCmd.Flags().String("control-plane-endpoint", "", "Specify a stable IP address or DNS name for the control plane.")
init_phase_kubeconfig_kubeletCmd.Flags().String("kubeconfig-dir", "/etc/kubernetes", "The path where to save the kubeconfig file.") init_phase_kubeconfig_kubeletCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_kubeconfig_kubeletCmd.Flags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") init_phase_kubeconfig_kubeletCmd.Flags().String("kubeconfig-dir", "", "The path where to save the kubeconfig file.")
init_phase_kubeconfig_kubeletCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
init_phase_kubeconfig_kubeletCmd.Flags().String("node-name", "", "Specify the node name.") init_phase_kubeconfig_kubeletCmd.Flags().String("node-name", "", "Specify the node name.")
init_phase_kubeconfigCmd.AddCommand(init_phase_kubeconfig_kubeletCmd) init_phase_kubeconfigCmd.AddCommand(init_phase_kubeconfig_kubeletCmd)
carapace.Gen(init_phase_kubeconfig_kubeletCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_kubeconfig_kubeletCmd).FlagCompletion(carapace.ActionMap{
"cert-dir": carapace.ActionDirectories(), "apiserver-bind-port": net.ActionPorts(),
"config": carapace.ActionFiles(), "cert-dir": carapace.ActionDirectories(),
"kubeconfig-dir": carapace.ActionDirectories(), "config": carapace.ActionFiles(),
"kubeconfig-dir": carapace.ActionDirectories(),
}) })
} }

View File

@ -2,6 +2,7 @@ package cmd
import ( import (
"github.com/carapace-sh/carapace" "github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/net"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -13,18 +14,21 @@ var init_phase_kubeconfig_schedulerCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_kubeconfig_schedulerCmd).Standalone() carapace.Gen(init_phase_kubeconfig_schedulerCmd).Standalone()
init_phase_kubeconfig_schedulerCmd.Flags().String("apiserver-advertise-address", "", "The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.") init_phase_kubeconfig_schedulerCmd.Flags().String("apiserver-advertise-address", "", "The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.")
init_phase_kubeconfig_schedulerCmd.Flags().Int32("apiserver-bind-port", 6443, "Port for the API Server to bind to.") init_phase_kubeconfig_schedulerCmd.Flags().String("apiserver-bind-port", "", "Port for the API Server to bind to.")
init_phase_kubeconfig_schedulerCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save and store the certificates.") init_phase_kubeconfig_schedulerCmd.Flags().String("cert-dir", "", "The path where to save and store the certificates.")
init_phase_kubeconfig_schedulerCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_kubeconfig_schedulerCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_kubeconfig_schedulerCmd.Flags().String("control-plane-endpoint", "", "Specify a stable IP address or DNS name for the control plane.") init_phase_kubeconfig_schedulerCmd.Flags().String("control-plane-endpoint", "", "Specify a stable IP address or DNS name for the control plane.")
init_phase_kubeconfig_schedulerCmd.Flags().String("kubeconfig-dir", "/etc/kubernetes", "The path where to save the kubeconfig file.") init_phase_kubeconfig_schedulerCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_kubeconfig_schedulerCmd.Flags().String("kubernetes-version", "stable-1", "Choose a specific Kubernetes version for the control plane.") init_phase_kubeconfig_schedulerCmd.Flags().String("kubeconfig-dir", "", "The path where to save the kubeconfig file.")
init_phase_kubeconfig_schedulerCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
init_phase_kubeconfigCmd.AddCommand(init_phase_kubeconfig_schedulerCmd) init_phase_kubeconfigCmd.AddCommand(init_phase_kubeconfig_schedulerCmd)
carapace.Gen(init_phase_kubeconfig_schedulerCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_kubeconfig_schedulerCmd).FlagCompletion(carapace.ActionMap{
"cert-dir": carapace.ActionDirectories(), "apiserver-bind-port": net.ActionPorts(),
"config": carapace.ActionFiles(), "cert-dir": carapace.ActionDirectories(),
"kubeconfig-dir": carapace.ActionDirectories(), "config": carapace.ActionFiles(),
"kubeconfig-dir": carapace.ActionDirectories(),
}) })
} }

View File

@ -0,0 +1,35 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/pkg/actions/net"
"github.com/spf13/cobra"
)
var init_phase_kubeconfig_superAdminCmd = &cobra.Command{
Use: "super-admin",
Short: "Generate a kubeconfig file for the super-admin",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(init_phase_kubeconfig_superAdminCmd).Standalone()
init_phase_kubeconfig_superAdminCmd.Flags().String("apiserver-advertise-address", "", "The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.")
init_phase_kubeconfig_superAdminCmd.Flags().String("apiserver-bind-port", "", "Port for the API Server to bind to.")
init_phase_kubeconfig_superAdminCmd.Flags().String("cert-dir", "", "The path where to save and store the certificates.")
init_phase_kubeconfig_superAdminCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_kubeconfig_superAdminCmd.Flags().String("control-plane-endpoint", "", "Specify a stable IP address or DNS name for the control plane.")
init_phase_kubeconfig_superAdminCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_kubeconfig_superAdminCmd.Flags().String("kubeconfig-dir", "", "The path where to save the kubeconfig file.")
init_phase_kubeconfig_superAdminCmd.Flags().String("kubernetes-version", "", "Choose a specific Kubernetes version for the control plane.")
init_phase_kubeconfigCmd.AddCommand(init_phase_kubeconfig_superAdminCmd)
carapace.Gen(init_phase_kubeconfig_superAdminCmd).FlagCompletion(carapace.ActionMap{
"apiserver-bind-port": net.ActionPorts(),
"cert-dir": carapace.ActionDirectories(),
"config": carapace.ActionFiles(),
"kubeconfig-dir": carapace.ActionDirectories(),
})
}

View File

@ -13,5 +13,6 @@ var init_phase_kubeletFinalizeCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_kubeletFinalizeCmd).Standalone() carapace.Gen(init_phase_kubeletFinalizeCmd).Standalone()
init_phaseCmd.AddCommand(init_phase_kubeletFinalizeCmd) init_phaseCmd.AddCommand(init_phase_kubeletFinalizeCmd)
} }

View File

@ -13,8 +13,10 @@ var init_phase_kubeletFinalize_allCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_kubeletFinalize_allCmd).Standalone() carapace.Gen(init_phase_kubeletFinalize_allCmd).Standalone()
init_phase_kubeletFinalize_allCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save and store the certificates.")
init_phase_kubeletFinalize_allCmd.Flags().String("cert-dir", "", "The path where to save and store the certificates.")
init_phase_kubeletFinalize_allCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_kubeletFinalize_allCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_kubeletFinalize_allCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_kubeletFinalizeCmd.AddCommand(init_phase_kubeletFinalize_allCmd) init_phase_kubeletFinalizeCmd.AddCommand(init_phase_kubeletFinalize_allCmd)
carapace.Gen(init_phase_kubeletFinalize_allCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_kubeletFinalize_allCmd).FlagCompletion(carapace.ActionMap{

View File

@ -0,0 +1,26 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var init_phase_kubeletFinalize_enableClientCertRotationCmd = &cobra.Command{
Use: "enable-client-cert-rotation",
Short: "Enable kubelet client certificate rotation",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(init_phase_kubeletFinalize_enableClientCertRotationCmd).Standalone()
init_phase_kubeletFinalize_enableClientCertRotationCmd.Flags().String("cert-dir", "", "The path where to save and store the certificates.")
init_phase_kubeletFinalize_enableClientCertRotationCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_kubeletFinalize_enableClientCertRotationCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_kubeletFinalizeCmd.AddCommand(init_phase_kubeletFinalize_enableClientCertRotationCmd)
carapace.Gen(init_phase_kubeletFinalize_enableClientCertRotationCmd).FlagCompletion(carapace.ActionMap{
"cert-dir": carapace.ActionDirectories(),
"config": carapace.ActionFiles(),
})
}

View File

@ -1,24 +0,0 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var init_phase_kubeletFinalize_experimentalCertRotationCmd = &cobra.Command{
Use: "experimental-cert-rotation",
Short: "Enable kubelet client certificate rotation",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(init_phase_kubeletFinalize_experimentalCertRotationCmd).Standalone()
init_phase_kubeletFinalize_experimentalCertRotationCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path where to save and store the certificates.")
init_phase_kubeletFinalize_experimentalCertRotationCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_kubeletFinalizeCmd.AddCommand(init_phase_kubeletFinalize_experimentalCertRotationCmd)
carapace.Gen(init_phase_kubeletFinalize_experimentalCertRotationCmd).FlagCompletion(carapace.ActionMap{
"cert-dir": carapace.ActionDirectories(),
"config": carapace.ActionFiles(),
})
}

View File

@ -13,9 +13,13 @@ var init_phase_kubeletStartCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_kubeletStartCmd).Standalone() carapace.Gen(init_phase_kubeletStartCmd).Standalone()
init_phase_kubeletStartCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_kubeletStartCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_kubeletStartCmd.Flags().String("cri-socket", "", "Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this value; use this option only if you have more than one CRI installed or if you have non-standard CRI socket.") init_phase_kubeletStartCmd.Flags().String("cri-socket", "", "Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this value; use this option only if you have more than one CRI installed or if you have non-standard CRI socket.")
init_phase_kubeletStartCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_kubeletStartCmd.Flags().String("image-repository", "", "Choose a container registry to pull control plane images from")
init_phase_kubeletStartCmd.Flags().String("node-name", "", "Specify the node name.") init_phase_kubeletStartCmd.Flags().String("node-name", "", "Specify the node name.")
init_phase_kubeletStartCmd.Flags().String("patches", "", "Path to a directory that contains files named \"target[suffix][+patchtype].extension\". For example, \"kube-apiserver0+merge.yaml\" or just \"etcd.json\". \"target\" can be one of \"kube-apiserver\", \"kube-controller-manager\", \"kube-scheduler\", \"etcd\", \"kubeletconfiguration\", \"corednsdeployment\". \"patchtype\" can be one of \"strategic\", \"merge\" or \"json\" and they match the patch formats supported by kubectl. The default \"patchtype\" is \"strategic\". \"extension\" must be either \"json\" or \"yaml\". \"suffix\" is an optional string that can be used to determine which patches are applied first alpha-numerically.")
init_phaseCmd.AddCommand(init_phase_kubeletStartCmd) init_phaseCmd.AddCommand(init_phase_kubeletStartCmd)
carapace.Gen(init_phase_kubeletStartCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_kubeletStartCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,7 +13,9 @@ var init_phase_markControlPlaneCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_markControlPlaneCmd).Standalone() carapace.Gen(init_phase_markControlPlaneCmd).Standalone()
init_phase_markControlPlaneCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_markControlPlaneCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_markControlPlaneCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_markControlPlaneCmd.Flags().String("node-name", "", "Specify the node name.") init_phase_markControlPlaneCmd.Flags().String("node-name", "", "Specify the node name.")
init_phaseCmd.AddCommand(init_phase_markControlPlaneCmd) init_phaseCmd.AddCommand(init_phase_markControlPlaneCmd)

View File

@ -14,8 +14,12 @@ var init_phase_preflightCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_preflightCmd).Standalone() carapace.Gen(init_phase_preflightCmd).Standalone()
init_phase_preflightCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_preflightCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_preflightCmd.Flags().String("cri-socket", "", "Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this value; use this option only if you have more than one CRI installed or if you have non-standard CRI socket.")
init_phase_preflightCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_preflightCmd.Flags().StringSlice("ignore-preflight-errors", []string{}, "A list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedUser,Swap'. Value 'all' ignores errors from all checks.") init_phase_preflightCmd.Flags().StringSlice("ignore-preflight-errors", []string{}, "A list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedUser,Swap'. Value 'all' ignores errors from all checks.")
init_phase_preflightCmd.Flags().String("image-repository", "", "Choose a container registry to pull control plane images from")
init_phaseCmd.AddCommand(init_phase_preflightCmd) init_phaseCmd.AddCommand(init_phase_preflightCmd)
carapace.Gen(init_phase_preflightCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_preflightCmd).FlagCompletion(carapace.ActionMap{

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var init_phase_showJoinCommandCmd = &cobra.Command{
Use: "show-join-command",
Short: "Show the join command for control-plane and worker node",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(init_phase_showJoinCommandCmd).Standalone()
init_phaseCmd.AddCommand(init_phase_showJoinCommandCmd)
}

View File

@ -13,9 +13,11 @@ var init_phase_uploadCertsCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_uploadCertsCmd).Standalone() carapace.Gen(init_phase_uploadCertsCmd).Standalone()
init_phase_uploadCertsCmd.Flags().String("certificate-key", "", "Key used to encrypt the control-plane certificates in the kubeadm-certs Secret.")
init_phase_uploadCertsCmd.Flags().String("certificate-key", "", "Key used to encrypt the control-plane certificates in the kubeadm-certs Secret. The certificate key is a hex encoded string that is an AES key of size 32 bytes.")
init_phase_uploadCertsCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_uploadCertsCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_uploadCertsCmd.Flags().String("kubeconfig", "/etc/kubernetes/admin.conf", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.") init_phase_uploadCertsCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_uploadCertsCmd.Flags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
init_phase_uploadCertsCmd.Flags().Bool("skip-certificate-key-print", false, "Don't print the key used to encrypt the control-plane certificates.") init_phase_uploadCertsCmd.Flags().Bool("skip-certificate-key-print", false, "Don't print the key used to encrypt the control-plane certificates.")
init_phase_uploadCertsCmd.Flags().Bool("upload-certs", false, "Upload control-plane certificates to the kubeadm-certs Secret.") init_phase_uploadCertsCmd.Flags().Bool("upload-certs", false, "Upload control-plane certificates to the kubeadm-certs Secret.")
init_phaseCmd.AddCommand(init_phase_uploadCertsCmd) init_phaseCmd.AddCommand(init_phase_uploadCertsCmd)

View File

@ -6,12 +6,14 @@ import (
) )
var init_phase_uploadConfigCmd = &cobra.Command{ var init_phase_uploadConfigCmd = &cobra.Command{
Use: "upload-config", Use: "upload-config",
Short: "Upload the kubeadm and kubelet configuration to a ConfigMap", Short: "Upload the kubeadm and kubelet configuration to a ConfigMap",
Run: func(cmd *cobra.Command, args []string) {}, Aliases: []string{"uploadconfig"},
Run: func(cmd *cobra.Command, args []string) {},
} }
func init() { func init() {
carapace.Gen(init_phase_uploadConfigCmd).Standalone() carapace.Gen(init_phase_uploadConfigCmd).Standalone()
init_phaseCmd.AddCommand(init_phase_uploadConfigCmd) init_phaseCmd.AddCommand(init_phase_uploadConfigCmd)
} }

View File

@ -13,8 +13,11 @@ var init_phase_uploadConfig_allCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_uploadConfig_allCmd).Standalone() carapace.Gen(init_phase_uploadConfig_allCmd).Standalone()
init_phase_uploadConfig_allCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_uploadConfig_allCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_uploadConfig_allCmd.Flags().String("kubeconfig", "/etc/kubernetes/admin.conf", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.") init_phase_uploadConfig_allCmd.Flags().String("cri-socket", "", "Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this value; use this option only if you have more than one CRI installed or if you have non-standard CRI socket.")
init_phase_uploadConfig_allCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_uploadConfig_allCmd.Flags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
init_phase_uploadConfigCmd.AddCommand(init_phase_uploadConfig_allCmd) init_phase_uploadConfigCmd.AddCommand(init_phase_uploadConfig_allCmd)
carapace.Gen(init_phase_uploadConfig_allCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_uploadConfig_allCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,8 +13,11 @@ var init_phase_uploadConfig_kubeadmCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_uploadConfig_kubeadmCmd).Standalone() carapace.Gen(init_phase_uploadConfig_kubeadmCmd).Standalone()
init_phase_uploadConfig_kubeadmCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_uploadConfig_kubeadmCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_uploadConfig_kubeadmCmd.Flags().String("kubeconfig", "/etc/kubernetes/admin.conf", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.") init_phase_uploadConfig_kubeadmCmd.Flags().String("cri-socket", "", "Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this value; use this option only if you have more than one CRI installed or if you have non-standard CRI socket.")
init_phase_uploadConfig_kubeadmCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_uploadConfig_kubeadmCmd.Flags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
init_phase_uploadConfigCmd.AddCommand(init_phase_uploadConfig_kubeadmCmd) init_phase_uploadConfigCmd.AddCommand(init_phase_uploadConfig_kubeadmCmd)
carapace.Gen(init_phase_uploadConfig_kubeadmCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_uploadConfig_kubeadmCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,8 +13,11 @@ var init_phase_uploadConfig_kubeletCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(init_phase_uploadConfig_kubeletCmd).Standalone() carapace.Gen(init_phase_uploadConfig_kubeletCmd).Standalone()
init_phase_uploadConfig_kubeletCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") init_phase_uploadConfig_kubeletCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
init_phase_uploadConfig_kubeletCmd.Flags().String("kubeconfig", "/etc/kubernetes/admin.conf", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.") init_phase_uploadConfig_kubeletCmd.Flags().String("cri-socket", "", "Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this value; use this option only if you have more than one CRI installed or if you have non-standard CRI socket.")
init_phase_uploadConfig_kubeletCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
init_phase_uploadConfig_kubeletCmd.Flags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
init_phase_uploadConfigCmd.AddCommand(init_phase_uploadConfig_kubeletCmd) init_phase_uploadConfigCmd.AddCommand(init_phase_uploadConfig_kubeletCmd)
carapace.Gen(init_phase_uploadConfig_kubeletCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(init_phase_uploadConfig_kubeletCmd).FlagCompletion(carapace.ActionMap{

View File

@ -3,21 +3,23 @@ package cmd
import ( import (
"github.com/carapace-sh/carapace" "github.com/carapace-sh/carapace"
"github.com/carapace-sh/carapace-bin/completers/kubeadm_completer/cmd/action" "github.com/carapace-sh/carapace-bin/completers/kubeadm_completer/cmd/action"
"github.com/carapace-sh/carapace-bin/pkg/actions/net"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
var joinCmd = &cobra.Command{ var joinCmd = &cobra.Command{
Use: "join", Use: "join [api-server-endpoint]",
Short: "Run this on any machine you wish to join an existing cluster", Short: "Run this on any machine you wish to join an existing cluster",
Run: func(cmd *cobra.Command, args []string) {}, Run: func(cmd *cobra.Command, args []string) {},
} }
func init() { func init() {
carapace.Gen(joinCmd).Standalone() carapace.Gen(joinCmd).Standalone()
joinCmd.Flags().String("apiserver-advertise-address", "", "If the node should host a new control plane instance, the IP address the API Server will advertise it's listening on. If not set the default network interface will be used.") joinCmd.Flags().String("apiserver-advertise-address", "", "If the node should host a new control plane instance, the IP address the API Server will advertise it's listening on. If not set the default network interface will be used.")
joinCmd.Flags().Int32("apiserver-bind-port", 6443, "If the node should host a new control plane instance, the port for the API Server to bind to.") joinCmd.Flags().String("apiserver-bind-port", "", "If the node should host a new control plane instance, the port for the API Server to bind to.")
joinCmd.Flags().String("certificate-key", "", "Use this key to decrypt the certificate secrets uploaded by init.") joinCmd.Flags().String("certificate-key", "", "Use this key to decrypt the certificate secrets uploaded by init. The certificate key is a hex encoded string that is an AES key of size 32 bytes.")
joinCmd.Flags().String("config", "", "Path to kubeadm config file.") joinCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
joinCmd.Flags().Bool("control-plane", false, "Create a new control plane instance on this node") joinCmd.Flags().Bool("control-plane", false, "Create a new control plane instance on this node")
joinCmd.Flags().String("cri-socket", "", "Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this value; use this option only if you have more than one CRI installed or if you have non-standard CRI socket.") joinCmd.Flags().String("cri-socket", "", "Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this value; use this option only if you have more than one CRI installed or if you have non-standard CRI socket.")
joinCmd.Flags().String("discovery-file", "", "For file-based discovery, a file or URL from which to load cluster information.") joinCmd.Flags().String("discovery-file", "", "For file-based discovery, a file or URL from which to load cluster information.")
@ -27,13 +29,14 @@ func init() {
joinCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.") joinCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
joinCmd.Flags().StringSlice("ignore-preflight-errors", []string{}, "A list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedUser,Swap'. Value 'all' ignores errors from all checks.") joinCmd.Flags().StringSlice("ignore-preflight-errors", []string{}, "A list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedUser,Swap'. Value 'all' ignores errors from all checks.")
joinCmd.Flags().String("node-name", "", "Specify the node name.") joinCmd.Flags().String("node-name", "", "Specify the node name.")
joinCmd.Flags().String("patches", "", "Path to a directory that contains files named \"target[suffix][+patchtype].extension\".") joinCmd.Flags().String("patches", "", "Path to a directory that contains files named \"target[suffix][+patchtype].extension\". For example, \"kube-apiserver0+merge.yaml\" or just \"etcd.json\". \"target\" can be one of \"kube-apiserver\", \"kube-controller-manager\", \"kube-scheduler\", \"etcd\", \"kubeletconfiguration\", \"corednsdeployment\". \"patchtype\" can be one of \"strategic\", \"merge\" or \"json\" and they match the patch formats supported by kubectl. The default \"patchtype\" is \"strategic\". \"extension\" must be either \"json\" or \"yaml\". \"suffix\" is an optional string that can be used to determine which patches are applied first alpha-numerically.")
joinCmd.Flags().StringSlice("skip-phases", []string{}, "List of phases to be skipped") joinCmd.Flags().StringSlice("skip-phases", []string{}, "List of phases to be skipped")
joinCmd.Flags().String("tls-bootstrap-token", "", "Specify the token used to temporarily authenticate with the Kubernetes Control Plane while joining the node.") joinCmd.Flags().String("tls-bootstrap-token", "", "Specify the token used to temporarily authenticate with the Kubernetes Control Plane while joining the node.")
joinCmd.Flags().String("token", "", "Use this token for both discovery-token and tls-bootstrap-token when those values are not provided.") joinCmd.Flags().String("token", "", "Use this token for both discovery-token and tls-bootstrap-token when those values are not provided.")
rootCmd.AddCommand(joinCmd) rootCmd.AddCommand(joinCmd)
carapace.Gen(joinCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(joinCmd).FlagCompletion(carapace.ActionMap{
"apiserver-bind-port": net.ActionPorts(),
"config": carapace.ActionFiles(), "config": carapace.ActionFiles(),
"cri-socket": carapace.ActionFiles(), "cri-socket": carapace.ActionFiles(),
"discovery-file": carapace.ActionFiles(), "discovery-file": carapace.ActionFiles(),

View File

@ -7,11 +7,12 @@ import (
var join_phaseCmd = &cobra.Command{ var join_phaseCmd = &cobra.Command{
Use: "phase", Use: "phase",
Short: "Use this command to invoke single phase of the join workflow", Short: "Use this command to invoke single phase of the \"join\" workflow",
Run: func(cmd *cobra.Command, args []string) {}, Run: func(cmd *cobra.Command, args []string) {},
} }
func init() { func init() {
carapace.Gen(join_phaseCmd).Standalone() carapace.Gen(join_phaseCmd).Standalone()
joinCmd.AddCommand(join_phaseCmd) joinCmd.AddCommand(join_phaseCmd)
} }

View File

@ -13,5 +13,6 @@ var join_phase_controlPlaneJoinCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(join_phase_controlPlaneJoinCmd).Standalone() carapace.Gen(join_phase_controlPlaneJoinCmd).Standalone()
join_phaseCmd.AddCommand(join_phase_controlPlaneJoinCmd) join_phaseCmd.AddCommand(join_phase_controlPlaneJoinCmd)
} }

View File

@ -13,11 +13,13 @@ var join_phase_controlPlaneJoin_allCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(join_phase_controlPlaneJoin_allCmd).Standalone() carapace.Gen(join_phase_controlPlaneJoin_allCmd).Standalone()
join_phase_controlPlaneJoin_allCmd.Flags().String("apiserver-advertise-address", "", "If the node should host a new control plane instance, the IP address the API Server will advertise it's listening on. If not set the default network interface will be used.") join_phase_controlPlaneJoin_allCmd.Flags().String("apiserver-advertise-address", "", "If the node should host a new control plane instance, the IP address the API Server will advertise it's listening on. If not set the default network interface will be used.")
join_phase_controlPlaneJoin_allCmd.Flags().String("config", "", "Path to kubeadm config file.") join_phase_controlPlaneJoin_allCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
join_phase_controlPlaneJoin_allCmd.Flags().Bool("control-plane", false, "Create a new control plane instance on this node") join_phase_controlPlaneJoin_allCmd.Flags().Bool("control-plane", false, "Create a new control plane instance on this node")
join_phase_controlPlaneJoin_allCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
join_phase_controlPlaneJoin_allCmd.Flags().String("node-name", "", "Specify the node name.") join_phase_controlPlaneJoin_allCmd.Flags().String("node-name", "", "Specify the node name.")
join_phase_controlPlaneJoin_allCmd.Flags().String("patches", "", "Path to a directory that contains files named \"target[suffix][+patchtype].extension\".") join_phase_controlPlaneJoin_allCmd.Flags().String("patches", "", "Path to a directory that contains files named \"target[suffix][+patchtype].extension\". For example, \"kube-apiserver0+merge.yaml\" or just \"etcd.json\". \"target\" can be one of \"kube-apiserver\", \"kube-controller-manager\", \"kube-scheduler\", \"etcd\", \"kubeletconfiguration\", \"corednsdeployment\". \"patchtype\" can be one of \"strategic\", \"merge\" or \"json\" and they match the patch formats supported by kubectl. The default \"patchtype\" is \"strategic\". \"extension\" must be either \"json\" or \"yaml\". \"suffix\" is an optional string that can be used to determine which patches are applied first alpha-numerically.")
join_phase_controlPlaneJoinCmd.AddCommand(join_phase_controlPlaneJoin_allCmd) join_phase_controlPlaneJoinCmd.AddCommand(join_phase_controlPlaneJoin_allCmd)
carapace.Gen(join_phase_controlPlaneJoin_allCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(join_phase_controlPlaneJoin_allCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,11 +13,13 @@ var join_phase_controlPlaneJoin_etcdCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(join_phase_controlPlaneJoin_etcdCmd).Standalone() carapace.Gen(join_phase_controlPlaneJoin_etcdCmd).Standalone()
join_phase_controlPlaneJoin_etcdCmd.Flags().String("apiserver-advertise-address", "", "If the node should host a new control plane instance, the IP address the API Server will advertise it's listening on. If not set the default network interface will be used.") join_phase_controlPlaneJoin_etcdCmd.Flags().String("apiserver-advertise-address", "", "If the node should host a new control plane instance, the IP address the API Server will advertise it's listening on. If not set the default network interface will be used.")
join_phase_controlPlaneJoin_etcdCmd.Flags().String("config", "", "Path to kubeadm config file.") join_phase_controlPlaneJoin_etcdCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
join_phase_controlPlaneJoin_etcdCmd.Flags().Bool("control-plane", false, "Create a new control plane instance on this node") join_phase_controlPlaneJoin_etcdCmd.Flags().Bool("control-plane", false, "Create a new control plane instance on this node")
join_phase_controlPlaneJoin_etcdCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
join_phase_controlPlaneJoin_etcdCmd.Flags().String("node-name", "", "Specify the node name.") join_phase_controlPlaneJoin_etcdCmd.Flags().String("node-name", "", "Specify the node name.")
join_phase_controlPlaneJoin_etcdCmd.Flags().String("patches", "", "Path to a directory that contains files named \"target[suffix][+patchtype].extension\".") join_phase_controlPlaneJoin_etcdCmd.Flags().String("patches", "", "Path to a directory that contains files named \"target[suffix][+patchtype].extension\". For example, \"kube-apiserver0+merge.yaml\" or just \"etcd.json\". \"target\" can be one of \"kube-apiserver\", \"kube-controller-manager\", \"kube-scheduler\", \"etcd\", \"kubeletconfiguration\", \"corednsdeployment\". \"patchtype\" can be one of \"strategic\", \"merge\" or \"json\" and they match the patch formats supported by kubectl. The default \"patchtype\" is \"strategic\". \"extension\" must be either \"json\" or \"yaml\". \"suffix\" is an optional string that can be used to determine which patches are applied first alpha-numerically.")
join_phase_controlPlaneJoinCmd.AddCommand(join_phase_controlPlaneJoin_etcdCmd) join_phase_controlPlaneJoinCmd.AddCommand(join_phase_controlPlaneJoin_etcdCmd)
carapace.Gen(join_phase_controlPlaneJoin_etcdCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(join_phase_controlPlaneJoin_etcdCmd).FlagCompletion(carapace.ActionMap{

View File

@ -13,8 +13,10 @@ var join_phase_controlPlaneJoin_markControlPlaneCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(join_phase_controlPlaneJoin_markControlPlaneCmd).Standalone() carapace.Gen(join_phase_controlPlaneJoin_markControlPlaneCmd).Standalone()
join_phase_controlPlaneJoin_markControlPlaneCmd.Flags().String("config", "", "Path to kubeadm config file.")
join_phase_controlPlaneJoin_markControlPlaneCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
join_phase_controlPlaneJoin_markControlPlaneCmd.Flags().Bool("control-plane", false, "Create a new control plane instance on this node") join_phase_controlPlaneJoin_markControlPlaneCmd.Flags().Bool("control-plane", false, "Create a new control plane instance on this node")
join_phase_controlPlaneJoin_markControlPlaneCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
join_phase_controlPlaneJoin_markControlPlaneCmd.Flags().String("node-name", "", "Specify the node name.") join_phase_controlPlaneJoin_markControlPlaneCmd.Flags().String("node-name", "", "Specify the node name.")
join_phase_controlPlaneJoinCmd.AddCommand(join_phase_controlPlaneJoin_markControlPlaneCmd) join_phase_controlPlaneJoinCmd.AddCommand(join_phase_controlPlaneJoin_markControlPlaneCmd)

View File

@ -1,25 +0,0 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var join_phase_controlPlaneJoin_updateStatusCmd = &cobra.Command{
Use: "update-status",
Short: "Register the new control-plane node into the ClusterStatus maintained in the kubeadm-config ConfigMap (DEPRECATED)",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(join_phase_controlPlaneJoin_updateStatusCmd).Standalone()
join_phase_controlPlaneJoin_updateStatusCmd.Flags().String("apiserver-advertise-address", "", "If the node should host a new control plane instance, the IP address the API Server will advertise it's listening on. If not set the default network interface will be used.")
join_phase_controlPlaneJoin_updateStatusCmd.Flags().String("config", "", "Path to kubeadm config file.")
join_phase_controlPlaneJoin_updateStatusCmd.Flags().Bool("control-plane", false, "Create a new control plane instance on this node")
join_phase_controlPlaneJoin_updateStatusCmd.Flags().String("node-name", "", "Specify the node name.")
join_phase_controlPlaneJoinCmd.AddCommand(join_phase_controlPlaneJoin_updateStatusCmd)
carapace.Gen(join_phase_controlPlaneJoin_updateStatusCmd).FlagCompletion(carapace.ActionMap{
"config": carapace.ActionFiles(),
})
}

View File

@ -13,5 +13,6 @@ var join_phase_controlPlanePrepareCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(join_phase_controlPlanePrepareCmd).Standalone() carapace.Gen(join_phase_controlPlanePrepareCmd).Standalone()
join_phaseCmd.AddCommand(join_phase_controlPlanePrepareCmd) join_phaseCmd.AddCommand(join_phase_controlPlanePrepareCmd)
} }

View File

@ -6,24 +6,26 @@ import (
) )
var join_phase_controlPlanePrepare_allCmd = &cobra.Command{ var join_phase_controlPlanePrepare_allCmd = &cobra.Command{
Use: "all", Use: "all [api-server-endpoint]",
Short: "Prepare the machine for serving a control plane", Short: "Prepare the machine for serving a control plane",
Run: func(cmd *cobra.Command, args []string) {}, Run: func(cmd *cobra.Command, args []string) {},
} }
func init() { func init() {
carapace.Gen(join_phase_controlPlanePrepare_allCmd).Standalone() carapace.Gen(join_phase_controlPlanePrepare_allCmd).Standalone()
join_phase_controlPlanePrepare_allCmd.Flags().String("apiserver-advertise-address", "", "If the node should host a new control plane instance, the IP address the API Server will advertise it's listening on. If not set the default network interface will be used.") join_phase_controlPlanePrepare_allCmd.Flags().String("apiserver-advertise-address", "", "If the node should host a new control plane instance, the IP address the API Server will advertise it's listening on. If not set the default network interface will be used.")
join_phase_controlPlanePrepare_allCmd.Flags().Int32("apiserver-bind-port", 6443, "If the node should host a new control plane instance, the port for the API Server to bind to.") join_phase_controlPlanePrepare_allCmd.Flags().String("apiserver-bind-port", "", "If the node should host a new control plane instance, the port for the API Server to bind to.")
join_phase_controlPlanePrepare_allCmd.Flags().String("certificate-key", "", "Use this key to decrypt the certificate secrets uploaded by init.") join_phase_controlPlanePrepare_allCmd.Flags().String("certificate-key", "", "Use this key to decrypt the certificate secrets uploaded by init. The certificate key is a hex encoded string that is an AES key of size 32 bytes.")
join_phase_controlPlanePrepare_allCmd.Flags().String("config", "", "Path to kubeadm config file.") join_phase_controlPlanePrepare_allCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
join_phase_controlPlanePrepare_allCmd.Flags().Bool("control-plane", false, "Create a new control plane instance on this node") join_phase_controlPlanePrepare_allCmd.Flags().Bool("control-plane", false, "Create a new control plane instance on this node")
join_phase_controlPlanePrepare_allCmd.Flags().String("discovery-file", "", "For file-based discovery, a file or URL from which to load cluster information.") join_phase_controlPlanePrepare_allCmd.Flags().String("discovery-file", "", "For file-based discovery, a file or URL from which to load cluster information.")
join_phase_controlPlanePrepare_allCmd.Flags().String("discovery-token", "", "For token-based discovery, the token used to validate cluster information fetched from the API server.") join_phase_controlPlanePrepare_allCmd.Flags().String("discovery-token", "", "For token-based discovery, the token used to validate cluster information fetched from the API server.")
join_phase_controlPlanePrepare_allCmd.Flags().StringSlice("discovery-token-ca-cert-hash", []string{}, "For token-based discovery, validate that the root CA public key matches this hash (format: \"<type>:<value>\").") join_phase_controlPlanePrepare_allCmd.Flags().StringSlice("discovery-token-ca-cert-hash", []string{}, "For token-based discovery, validate that the root CA public key matches this hash (format: \"<type>:<value>\").")
join_phase_controlPlanePrepare_allCmd.Flags().Bool("discovery-token-unsafe-skip-ca-verification", false, "For token-based discovery, allow joining without --discovery-token-ca-cert-hash pinning.") join_phase_controlPlanePrepare_allCmd.Flags().Bool("discovery-token-unsafe-skip-ca-verification", false, "For token-based discovery, allow joining without --discovery-token-ca-cert-hash pinning.")
join_phase_controlPlanePrepare_allCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
join_phase_controlPlanePrepare_allCmd.Flags().String("node-name", "", "Specify the node name.") join_phase_controlPlanePrepare_allCmd.Flags().String("node-name", "", "Specify the node name.")
join_phase_controlPlanePrepare_allCmd.Flags().String("patches", "", "Path to a directory that contains files named \"target[suffix][+patchtype].extension\".") join_phase_controlPlanePrepare_allCmd.Flags().String("patches", "", "Path to a directory that contains files named \"target[suffix][+patchtype].extension\". For example, \"kube-apiserver0+merge.yaml\" or just \"etcd.json\". \"target\" can be one of \"kube-apiserver\", \"kube-controller-manager\", \"kube-scheduler\", \"etcd\", \"kubeletconfiguration\", \"corednsdeployment\". \"patchtype\" can be one of \"strategic\", \"merge\" or \"json\" and they match the patch formats supported by kubectl. The default \"patchtype\" is \"strategic\". \"extension\" must be either \"json\" or \"yaml\". \"suffix\" is an optional string that can be used to determine which patches are applied first alpha-numerically.")
join_phase_controlPlanePrepare_allCmd.Flags().String("tls-bootstrap-token", "", "Specify the token used to temporarily authenticate with the Kubernetes Control Plane while joining the node.") join_phase_controlPlanePrepare_allCmd.Flags().String("tls-bootstrap-token", "", "Specify the token used to temporarily authenticate with the Kubernetes Control Plane while joining the node.")
join_phase_controlPlanePrepare_allCmd.Flags().String("token", "", "Use this token for both discovery-token and tls-bootstrap-token when those values are not provided.") join_phase_controlPlanePrepare_allCmd.Flags().String("token", "", "Use this token for both discovery-token and tls-bootstrap-token when those values are not provided.")
join_phase_controlPlanePrepareCmd.AddCommand(join_phase_controlPlanePrepare_allCmd) join_phase_controlPlanePrepareCmd.AddCommand(join_phase_controlPlanePrepare_allCmd)

View File

@ -6,20 +6,22 @@ import (
) )
var join_phase_controlPlanePrepare_certsCmd = &cobra.Command{ var join_phase_controlPlanePrepare_certsCmd = &cobra.Command{
Use: "certs", Use: "certs [api-server-endpoint]",
Short: "Generate the certificates for the new control plane components", Short: "Generate the certificates for the new control plane components",
Run: func(cmd *cobra.Command, args []string) {}, Run: func(cmd *cobra.Command, args []string) {},
} }
func init() { func init() {
carapace.Gen(join_phase_controlPlanePrepare_certsCmd).Standalone() carapace.Gen(join_phase_controlPlanePrepare_certsCmd).Standalone()
join_phase_controlPlanePrepare_certsCmd.Flags().String("apiserver-advertise-address", "", "If the node should host a new control plane instance, the IP address the API Server will advertise it's listening on. If not set the default network interface will be used.") join_phase_controlPlanePrepare_certsCmd.Flags().String("apiserver-advertise-address", "", "If the node should host a new control plane instance, the IP address the API Server will advertise it's listening on. If not set the default network interface will be used.")
join_phase_controlPlanePrepare_certsCmd.Flags().String("config", "", "Path to kubeadm config file.") join_phase_controlPlanePrepare_certsCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
join_phase_controlPlanePrepare_certsCmd.Flags().Bool("control-plane", false, "Create a new control plane instance on this node") join_phase_controlPlanePrepare_certsCmd.Flags().Bool("control-plane", false, "Create a new control plane instance on this node")
join_phase_controlPlanePrepare_certsCmd.Flags().String("discovery-file", "", "For file-based discovery, a file or URL from which to load cluster information.") join_phase_controlPlanePrepare_certsCmd.Flags().String("discovery-file", "", "For file-based discovery, a file or URL from which to load cluster information.")
join_phase_controlPlanePrepare_certsCmd.Flags().String("discovery-token", "", "For token-based discovery, the token used to validate cluster information fetched from the API server.") join_phase_controlPlanePrepare_certsCmd.Flags().String("discovery-token", "", "For token-based discovery, the token used to validate cluster information fetched from the API server.")
join_phase_controlPlanePrepare_certsCmd.Flags().StringSlice("discovery-token-ca-cert-hash", []string{}, "For token-based discovery, validate that the root CA public key matches this hash (format: \"<type>:<value>\").") join_phase_controlPlanePrepare_certsCmd.Flags().StringSlice("discovery-token-ca-cert-hash", []string{}, "For token-based discovery, validate that the root CA public key matches this hash (format: \"<type>:<value>\").")
join_phase_controlPlanePrepare_certsCmd.Flags().Bool("discovery-token-unsafe-skip-ca-verification", false, "For token-based discovery, allow joining without --discovery-token-ca-cert-hash pinning.") join_phase_controlPlanePrepare_certsCmd.Flags().Bool("discovery-token-unsafe-skip-ca-verification", false, "For token-based discovery, allow joining without --discovery-token-ca-cert-hash pinning.")
join_phase_controlPlanePrepare_certsCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
join_phase_controlPlanePrepare_certsCmd.Flags().String("node-name", "", "Specify the node name.") join_phase_controlPlanePrepare_certsCmd.Flags().String("node-name", "", "Specify the node name.")
join_phase_controlPlanePrepare_certsCmd.Flags().String("tls-bootstrap-token", "", "Specify the token used to temporarily authenticate with the Kubernetes Control Plane while joining the node.") join_phase_controlPlanePrepare_certsCmd.Flags().String("tls-bootstrap-token", "", "Specify the token used to temporarily authenticate with the Kubernetes Control Plane while joining the node.")
join_phase_controlPlanePrepare_certsCmd.Flags().String("token", "", "Use this token for both discovery-token and tls-bootstrap-token when those values are not provided.") join_phase_controlPlanePrepare_certsCmd.Flags().String("token", "", "Use this token for both discovery-token and tls-bootstrap-token when those values are not provided.")

View File

@ -13,11 +13,13 @@ var join_phase_controlPlanePrepare_controlPlaneCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(join_phase_controlPlanePrepare_controlPlaneCmd).Standalone() carapace.Gen(join_phase_controlPlanePrepare_controlPlaneCmd).Standalone()
join_phase_controlPlanePrepare_controlPlaneCmd.Flags().String("apiserver-advertise-address", "", "If the node should host a new control plane instance, the IP address the API Server will advertise it's listening on. If not set the default network interface will be used.") join_phase_controlPlanePrepare_controlPlaneCmd.Flags().String("apiserver-advertise-address", "", "If the node should host a new control plane instance, the IP address the API Server will advertise it's listening on. If not set the default network interface will be used.")
join_phase_controlPlanePrepare_controlPlaneCmd.Flags().Int32("apiserver-bind-port", 6443, "If the node should host a new control plane instance, the port for the API Server to bind to.") join_phase_controlPlanePrepare_controlPlaneCmd.Flags().String("apiserver-bind-port", "", "If the node should host a new control plane instance, the port for the API Server to bind to.")
join_phase_controlPlanePrepare_controlPlaneCmd.Flags().String("config", "", "Path to kubeadm config file.") join_phase_controlPlanePrepare_controlPlaneCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
join_phase_controlPlanePrepare_controlPlaneCmd.Flags().Bool("control-plane", false, "Create a new control plane instance on this node") join_phase_controlPlanePrepare_controlPlaneCmd.Flags().Bool("control-plane", false, "Create a new control plane instance on this node")
join_phase_controlPlanePrepare_controlPlaneCmd.Flags().String("patches", "", "Path to a directory that contains files named \"target[suffix][+patchtype].extension\".") join_phase_controlPlanePrepare_controlPlaneCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
join_phase_controlPlanePrepare_controlPlaneCmd.Flags().String("patches", "", "Path to a directory that contains files named \"target[suffix][+patchtype].extension\". For example, \"kube-apiserver0+merge.yaml\" or just \"etcd.json\". \"target\" can be one of \"kube-apiserver\", \"kube-controller-manager\", \"kube-scheduler\", \"etcd\", \"kubeletconfiguration\", \"corednsdeployment\". \"patchtype\" can be one of \"strategic\", \"merge\" or \"json\" and they match the patch formats supported by kubectl. The default \"patchtype\" is \"strategic\". \"extension\" must be either \"json\" or \"yaml\". \"suffix\" is an optional string that can be used to determine which patches are applied first alpha-numerically.")
join_phase_controlPlanePrepareCmd.AddCommand(join_phase_controlPlanePrepare_controlPlaneCmd) join_phase_controlPlanePrepareCmd.AddCommand(join_phase_controlPlanePrepare_controlPlaneCmd)
carapace.Gen(join_phase_controlPlanePrepare_controlPlaneCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(join_phase_controlPlanePrepare_controlPlaneCmd).FlagCompletion(carapace.ActionMap{

View File

@ -6,20 +6,22 @@ import (
) )
var join_phase_controlPlanePrepare_downloadCertsCmd = &cobra.Command{ var join_phase_controlPlanePrepare_downloadCertsCmd = &cobra.Command{
Use: "download-certs", Use: "download-certs [api-server-endpoint]",
Short: "[EXPERIMENTAL] Download certificates shared among control-plane nodes from the kubeadm-certs Secret", Short: "Download certificates shared among control-plane nodes from the kubeadm-certs Secret",
Run: func(cmd *cobra.Command, args []string) {}, Run: func(cmd *cobra.Command, args []string) {},
} }
func init() { func init() {
carapace.Gen(join_phase_controlPlanePrepare_downloadCertsCmd).Standalone() carapace.Gen(join_phase_controlPlanePrepare_downloadCertsCmd).Standalone()
join_phase_controlPlanePrepare_downloadCertsCmd.Flags().String("certificate-key", "", "Use this key to decrypt the certificate secrets uploaded by init.")
join_phase_controlPlanePrepare_downloadCertsCmd.Flags().String("config", "", "Path to kubeadm config file.") join_phase_controlPlanePrepare_downloadCertsCmd.Flags().String("certificate-key", "", "Use this key to decrypt the certificate secrets uploaded by init. The certificate key is a hex encoded string that is an AES key of size 32 bytes.")
join_phase_controlPlanePrepare_downloadCertsCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
join_phase_controlPlanePrepare_downloadCertsCmd.Flags().Bool("control-plane", false, "Create a new control plane instance on this node") join_phase_controlPlanePrepare_downloadCertsCmd.Flags().Bool("control-plane", false, "Create a new control plane instance on this node")
join_phase_controlPlanePrepare_downloadCertsCmd.Flags().String("discovery-file", "", "For file-based discovery, a file or URL from which to load cluster information.") join_phase_controlPlanePrepare_downloadCertsCmd.Flags().String("discovery-file", "", "For file-based discovery, a file or URL from which to load cluster information.")
join_phase_controlPlanePrepare_downloadCertsCmd.Flags().String("discovery-token", "", "For token-based discovery, the token used to validate cluster information fetched from the API server.") join_phase_controlPlanePrepare_downloadCertsCmd.Flags().String("discovery-token", "", "For token-based discovery, the token used to validate cluster information fetched from the API server.")
join_phase_controlPlanePrepare_downloadCertsCmd.Flags().StringSlice("discovery-token-ca-cert-hash", []string{}, "For token-based discovery, validate that the root CA public key matches this hash (format: \"<type>:<value>\").") join_phase_controlPlanePrepare_downloadCertsCmd.Flags().StringSlice("discovery-token-ca-cert-hash", []string{}, "For token-based discovery, validate that the root CA public key matches this hash (format: \"<type>:<value>\").")
join_phase_controlPlanePrepare_downloadCertsCmd.Flags().Bool("discovery-token-unsafe-skip-ca-verification", false, "For token-based discovery, allow joining without --discovery-token-ca-cert-hash pinning.") join_phase_controlPlanePrepare_downloadCertsCmd.Flags().Bool("discovery-token-unsafe-skip-ca-verification", false, "For token-based discovery, allow joining without --discovery-token-ca-cert-hash pinning.")
join_phase_controlPlanePrepare_downloadCertsCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
join_phase_controlPlanePrepare_downloadCertsCmd.Flags().String("tls-bootstrap-token", "", "Specify the token used to temporarily authenticate with the Kubernetes Control Plane while joining the node.") join_phase_controlPlanePrepare_downloadCertsCmd.Flags().String("tls-bootstrap-token", "", "Specify the token used to temporarily authenticate with the Kubernetes Control Plane while joining the node.")
join_phase_controlPlanePrepare_downloadCertsCmd.Flags().String("token", "", "Use this token for both discovery-token and tls-bootstrap-token when those values are not provided.") join_phase_controlPlanePrepare_downloadCertsCmd.Flags().String("token", "", "Use this token for both discovery-token and tls-bootstrap-token when those values are not provided.")
join_phase_controlPlanePrepareCmd.AddCommand(join_phase_controlPlanePrepare_downloadCertsCmd) join_phase_controlPlanePrepareCmd.AddCommand(join_phase_controlPlanePrepare_downloadCertsCmd)

View File

@ -6,20 +6,22 @@ import (
) )
var join_phase_controlPlanePrepare_kubeconfigCmd = &cobra.Command{ var join_phase_controlPlanePrepare_kubeconfigCmd = &cobra.Command{
Use: "kubeconfig", Use: "kubeconfig [api-server-endpoint]",
Short: "Generate the kubeconfig for the new control plane components", Short: "Generate the kubeconfig for the new control plane components",
Run: func(cmd *cobra.Command, args []string) {}, Run: func(cmd *cobra.Command, args []string) {},
} }
func init() { func init() {
carapace.Gen(join_phase_controlPlanePrepare_kubeconfigCmd).Standalone() carapace.Gen(join_phase_controlPlanePrepare_kubeconfigCmd).Standalone()
join_phase_controlPlanePrepare_kubeconfigCmd.Flags().String("certificate-key", "", "Use this key to decrypt the certificate secrets uploaded by init.")
join_phase_controlPlanePrepare_kubeconfigCmd.Flags().String("config", "", "Path to kubeadm config file.") join_phase_controlPlanePrepare_kubeconfigCmd.Flags().String("certificate-key", "", "Use this key to decrypt the certificate secrets uploaded by init. The certificate key is a hex encoded string that is an AES key of size 32 bytes.")
join_phase_controlPlanePrepare_kubeconfigCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
join_phase_controlPlanePrepare_kubeconfigCmd.Flags().Bool("control-plane", false, "Create a new control plane instance on this node") join_phase_controlPlanePrepare_kubeconfigCmd.Flags().Bool("control-plane", false, "Create a new control plane instance on this node")
join_phase_controlPlanePrepare_kubeconfigCmd.Flags().String("discovery-file", "", "For file-based discovery, a file or URL from which to load cluster information.") join_phase_controlPlanePrepare_kubeconfigCmd.Flags().String("discovery-file", "", "For file-based discovery, a file or URL from which to load cluster information.")
join_phase_controlPlanePrepare_kubeconfigCmd.Flags().String("discovery-token", "", "For token-based discovery, the token used to validate cluster information fetched from the API server.") join_phase_controlPlanePrepare_kubeconfigCmd.Flags().String("discovery-token", "", "For token-based discovery, the token used to validate cluster information fetched from the API server.")
join_phase_controlPlanePrepare_kubeconfigCmd.Flags().StringSlice("discovery-token-ca-cert-hash", []string{}, "For token-based discovery, validate that the root CA public key matches this hash (format: \"<type>:<value>\").") join_phase_controlPlanePrepare_kubeconfigCmd.Flags().StringSlice("discovery-token-ca-cert-hash", []string{}, "For token-based discovery, validate that the root CA public key matches this hash (format: \"<type>:<value>\").")
join_phase_controlPlanePrepare_kubeconfigCmd.Flags().Bool("discovery-token-unsafe-skip-ca-verification", false, "For token-based discovery, allow joining without --discovery-token-ca-cert-hash pinning.") join_phase_controlPlanePrepare_kubeconfigCmd.Flags().Bool("discovery-token-unsafe-skip-ca-verification", false, "For token-based discovery, allow joining without --discovery-token-ca-cert-hash pinning.")
join_phase_controlPlanePrepare_kubeconfigCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
join_phase_controlPlanePrepare_kubeconfigCmd.Flags().String("tls-bootstrap-token", "", "Specify the token used to temporarily authenticate with the Kubernetes Control Plane while joining the node.") join_phase_controlPlanePrepare_kubeconfigCmd.Flags().String("tls-bootstrap-token", "", "Specify the token used to temporarily authenticate with the Kubernetes Control Plane while joining the node.")
join_phase_controlPlanePrepare_kubeconfigCmd.Flags().String("token", "", "Use this token for both discovery-token and tls-bootstrap-token when those values are not provided.") join_phase_controlPlanePrepare_kubeconfigCmd.Flags().String("token", "", "Use this token for both discovery-token and tls-bootstrap-token when those values are not provided.")
join_phase_controlPlanePrepareCmd.AddCommand(join_phase_controlPlanePrepare_kubeconfigCmd) join_phase_controlPlanePrepareCmd.AddCommand(join_phase_controlPlanePrepare_kubeconfigCmd)

View File

@ -6,20 +6,23 @@ import (
) )
var join_phase_kubeletStartCmd = &cobra.Command{ var join_phase_kubeletStartCmd = &cobra.Command{
Use: "kubelet-start", Use: "kubelet-start [api-server-endpoint]",
Short: "Write kubelet settings, certificates and (re)start the kubelet", Short: "Write kubelet settings, certificates and (re)start the kubelet",
Run: func(cmd *cobra.Command, args []string) {}, Run: func(cmd *cobra.Command, args []string) {},
} }
func init() { func init() {
carapace.Gen(join_phase_kubeletStartCmd).Standalone() carapace.Gen(join_phase_kubeletStartCmd).Standalone()
join_phase_kubeletStartCmd.Flags().String("config", "", "Path to kubeadm config file.")
join_phase_kubeletStartCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
join_phase_kubeletStartCmd.Flags().String("cri-socket", "", "Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this value; use this option only if you have more than one CRI installed or if you have non-standard CRI socket.") join_phase_kubeletStartCmd.Flags().String("cri-socket", "", "Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this value; use this option only if you have more than one CRI installed or if you have non-standard CRI socket.")
join_phase_kubeletStartCmd.Flags().String("discovery-file", "", "For file-based discovery, a file or URL from which to load cluster information.") join_phase_kubeletStartCmd.Flags().String("discovery-file", "", "For file-based discovery, a file or URL from which to load cluster information.")
join_phase_kubeletStartCmd.Flags().String("discovery-token", "", "For token-based discovery, the token used to validate cluster information fetched from the API server.") join_phase_kubeletStartCmd.Flags().String("discovery-token", "", "For token-based discovery, the token used to validate cluster information fetched from the API server.")
join_phase_kubeletStartCmd.Flags().StringSlice("discovery-token-ca-cert-hash", []string{}, "For token-based discovery, validate that the root CA public key matches this hash (format: \"<type>:<value>\").") join_phase_kubeletStartCmd.Flags().StringSlice("discovery-token-ca-cert-hash", []string{}, "For token-based discovery, validate that the root CA public key matches this hash (format: \"<type>:<value>\").")
join_phase_kubeletStartCmd.Flags().Bool("discovery-token-unsafe-skip-ca-verification", false, "For token-based discovery, allow joining without --discovery-token-ca-cert-hash pinning.") join_phase_kubeletStartCmd.Flags().Bool("discovery-token-unsafe-skip-ca-verification", false, "For token-based discovery, allow joining without --discovery-token-ca-cert-hash pinning.")
join_phase_kubeletStartCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
join_phase_kubeletStartCmd.Flags().String("node-name", "", "Specify the node name.") join_phase_kubeletStartCmd.Flags().String("node-name", "", "Specify the node name.")
join_phase_kubeletStartCmd.Flags().String("patches", "", "Path to a directory that contains files named \"target[suffix][+patchtype].extension\". For example, \"kube-apiserver0+merge.yaml\" or just \"etcd.json\". \"target\" can be one of \"kube-apiserver\", \"kube-controller-manager\", \"kube-scheduler\", \"etcd\", \"kubeletconfiguration\", \"corednsdeployment\". \"patchtype\" can be one of \"strategic\", \"merge\" or \"json\" and they match the patch formats supported by kubectl. The default \"patchtype\" is \"strategic\". \"extension\" must be either \"json\" or \"yaml\". \"suffix\" is an optional string that can be used to determine which patches are applied first alpha-numerically.")
join_phase_kubeletStartCmd.Flags().String("tls-bootstrap-token", "", "Specify the token used to temporarily authenticate with the Kubernetes Control Plane while joining the node.") join_phase_kubeletStartCmd.Flags().String("tls-bootstrap-token", "", "Specify the token used to temporarily authenticate with the Kubernetes Control Plane while joining the node.")
join_phase_kubeletStartCmd.Flags().String("token", "", "Use this token for both discovery-token and tls-bootstrap-token when those values are not provided.") join_phase_kubeletStartCmd.Flags().String("token", "", "Use this token for both discovery-token and tls-bootstrap-token when those values are not provided.")
join_phaseCmd.AddCommand(join_phase_kubeletStartCmd) join_phaseCmd.AddCommand(join_phase_kubeletStartCmd)

View File

@ -7,23 +7,25 @@ import (
) )
var join_phase_preflightCmd = &cobra.Command{ var join_phase_preflightCmd = &cobra.Command{
Use: "preflight", Use: "preflight [api-server-endpoint]",
Short: "Run join pre-flight checks", Short: "Run join pre-flight checks",
Run: func(cmd *cobra.Command, args []string) {}, Run: func(cmd *cobra.Command, args []string) {},
} }
func init() { func init() {
carapace.Gen(join_phase_preflightCmd).Standalone() carapace.Gen(join_phase_preflightCmd).Standalone()
join_phase_preflightCmd.Flags().String("apiserver-advertise-address", "", "If the node should host a new control plane instance, the IP address the API Server will advertise it's listening on. If not set the default network interface will be used.") join_phase_preflightCmd.Flags().String("apiserver-advertise-address", "", "If the node should host a new control plane instance, the IP address the API Server will advertise it's listening on. If not set the default network interface will be used.")
join_phase_preflightCmd.Flags().Int32("apiserver-bind-port", 6443, "If the node should host a new control plane instance, the port for the API Server to bind to.") join_phase_preflightCmd.Flags().String("apiserver-bind-port", "", "If the node should host a new control plane instance, the port for the API Server to bind to.")
join_phase_preflightCmd.Flags().String("certificate-key", "", "Use this key to decrypt the certificate secrets uploaded by init.") join_phase_preflightCmd.Flags().String("certificate-key", "", "Use this key to decrypt the certificate secrets uploaded by init. The certificate key is a hex encoded string that is an AES key of size 32 bytes.")
join_phase_preflightCmd.Flags().String("config", "", "Path to kubeadm config file.") join_phase_preflightCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
join_phase_preflightCmd.Flags().Bool("control-plane", false, "Create a new control plane instance on this node") join_phase_preflightCmd.Flags().Bool("control-plane", false, "Create a new control plane instance on this node")
join_phase_preflightCmd.Flags().String("cri-socket", "", "Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this value; use this option only if you have more than one CRI installed or if you have non-standard CRI socket.") join_phase_preflightCmd.Flags().String("cri-socket", "", "Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this value; use this option only if you have more than one CRI installed or if you have non-standard CRI socket.")
join_phase_preflightCmd.Flags().String("discovery-file", "", "For file-based discovery, a file or URL from which to load cluster information.") join_phase_preflightCmd.Flags().String("discovery-file", "", "For file-based discovery, a file or URL from which to load cluster information.")
join_phase_preflightCmd.Flags().String("discovery-token", "", "For token-based discovery, the token used to validate cluster information fetched from the API server.") join_phase_preflightCmd.Flags().String("discovery-token", "", "For token-based discovery, the token used to validate cluster information fetched from the API server.")
join_phase_preflightCmd.Flags().StringSlice("discovery-token-ca-cert-hash", []string{}, "For token-based discovery, validate that the root CA public key matches this hash (format: \"<type>:<value>\").") join_phase_preflightCmd.Flags().StringSlice("discovery-token-ca-cert-hash", []string{}, "For token-based discovery, validate that the root CA public key matches this hash (format: \"<type>:<value>\").")
join_phase_preflightCmd.Flags().Bool("discovery-token-unsafe-skip-ca-verification", false, "For token-based discovery, allow joining without --discovery-token-ca-cert-hash pinning.") join_phase_preflightCmd.Flags().Bool("discovery-token-unsafe-skip-ca-verification", false, "For token-based discovery, allow joining without --discovery-token-ca-cert-hash pinning.")
join_phase_preflightCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
join_phase_preflightCmd.Flags().StringSlice("ignore-preflight-errors", []string{}, "A list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedUser,Swap'. Value 'all' ignores errors from all checks.") join_phase_preflightCmd.Flags().StringSlice("ignore-preflight-errors", []string{}, "A list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedUser,Swap'. Value 'all' ignores errors from all checks.")
join_phase_preflightCmd.Flags().String("node-name", "", "Specify the node name.") join_phase_preflightCmd.Flags().String("node-name", "", "Specify the node name.")
join_phase_preflightCmd.Flags().String("tls-bootstrap-token", "", "Specify the token used to temporarily authenticate with the Kubernetes Control Plane while joining the node.") join_phase_preflightCmd.Flags().String("tls-bootstrap-token", "", "Specify the token used to temporarily authenticate with the Kubernetes Control Plane while joining the node.")

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var join_phase_waitControlPlaneCmd = &cobra.Command{
Use: "wait-control-plane",
Short: "EXPERIMENTAL: Wait for the control plane to start",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(join_phase_waitControlPlaneCmd).Standalone()
join_phaseCmd.AddCommand(join_phase_waitControlPlaneCmd)
}

View File

@ -13,5 +13,6 @@ var kubeconfigCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(kubeconfigCmd).Standalone() carapace.Gen(kubeconfigCmd).Standalone()
rootCmd.AddCommand(kubeconfigCmd) rootCmd.AddCommand(kubeconfigCmd)
} }

View File

@ -13,11 +13,13 @@ var kubeconfig_userCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(kubeconfig_userCmd).Standalone() carapace.Gen(kubeconfig_userCmd).Standalone()
kubeconfig_userCmd.Flags().String("client-name", "", "The name of user. It will be used as the CN if client certificates are created") kubeconfig_userCmd.Flags().String("client-name", "", "The name of user. It will be used as the CN if client certificates are created")
kubeconfig_userCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") kubeconfig_userCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
kubeconfig_userCmd.Flags().StringSlice("org", []string{}, "The orgnizations of the client certificate. It will be used as the O if client certificates are created") kubeconfig_userCmd.Flags().StringSlice("org", []string{}, "The organizations of the client certificate. It will be used as the O if client certificates are created")
kubeconfig_userCmd.Flags().String("token", "", "The token that should be used as the authentication mechanism for this kubeconfig, instead of client certificates") kubeconfig_userCmd.Flags().String("token", "", "The token that should be used as the authentication mechanism for this kubeconfig, instead of client certificates")
kubeconfig_userCmd.Flags().String("validity-period", "", "The validity period of the client certificate. It is an offset from the current time.") kubeconfig_userCmd.Flags().String("validity-period", "", "The validity period of the client certificate. It is an offset from the current time.")
kubeconfig_userCmd.MarkFlagRequired("client-name")
kubeconfigCmd.AddCommand(kubeconfig_userCmd) kubeconfigCmd.AddCommand(kubeconfig_userCmd)
carapace.Gen(kubeconfig_userCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(kubeconfig_userCmd).FlagCompletion(carapace.ActionMap{

View File

@ -14,11 +14,15 @@ var resetCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(resetCmd).Standalone() carapace.Gen(resetCmd).Standalone()
resetCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path to the directory where the certificates are stored. If specified, clean this directory.")
resetCmd.Flags().String("cert-dir", "", "The path to the directory where the certificates are stored. If specified, clean this directory.")
resetCmd.Flags().Bool("cleanup-tmp-dir", false, "Cleanup the \"/etc/kubernetes/tmp\" directory")
resetCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
resetCmd.Flags().String("cri-socket", "", "Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this value; use this option only if you have more than one CRI installed or if you have non-standard CRI socket.") resetCmd.Flags().String("cri-socket", "", "Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this value; use this option only if you have more than one CRI installed or if you have non-standard CRI socket.")
resetCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
resetCmd.Flags().BoolP("force", "f", false, "Reset the node without prompting for confirmation.") resetCmd.Flags().BoolP("force", "f", false, "Reset the node without prompting for confirmation.")
resetCmd.Flags().StringSlice("ignore-preflight-errors", []string{}, "A list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedUser,Swap'. Value 'all' ignores errors from all checks.") resetCmd.Flags().StringSlice("ignore-preflight-errors", []string{}, "A list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedUser,Swap'. Value 'all' ignores errors from all checks.")
resetCmd.Flags().String("kubeconfig", "/etc/kubernetes/admin.conf", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.") resetCmd.Flags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
resetCmd.Flags().StringSlice("skip-phases", []string{}, "List of phases to be skipped") resetCmd.Flags().StringSlice("skip-phases", []string{}, "List of phases to be skipped")
rootCmd.AddCommand(resetCmd) rootCmd.AddCommand(resetCmd)

View File

@ -7,11 +7,12 @@ import (
var reset_phaseCmd = &cobra.Command{ var reset_phaseCmd = &cobra.Command{
Use: "phase", Use: "phase",
Short: "Use this command to invoke single phase of the reset workflow", Short: "Use this command to invoke single phase of the \"reset\" workflow",
Run: func(cmd *cobra.Command, args []string) {}, Run: func(cmd *cobra.Command, args []string) {},
} }
func init() { func init() {
carapace.Gen(reset_phaseCmd).Standalone() carapace.Gen(reset_phaseCmd).Standalone()
resetCmd.AddCommand(reset_phaseCmd) resetCmd.AddCommand(reset_phaseCmd)
} }

View File

@ -6,15 +6,19 @@ import (
) )
var reset_phase_cleanupNodeCmd = &cobra.Command{ var reset_phase_cleanupNodeCmd = &cobra.Command{
Use: "cleanup-node", Use: "cleanup-node",
Short: "Run cleanup node.", Short: "Run cleanup node.",
Run: func(cmd *cobra.Command, args []string) {}, Aliases: []string{"cleanupnode"},
Run: func(cmd *cobra.Command, args []string) {},
} }
func init() { func init() {
carapace.Gen(reset_phase_cleanupNodeCmd).Standalone() carapace.Gen(reset_phase_cleanupNodeCmd).Standalone()
reset_phase_cleanupNodeCmd.Flags().String("cert-dir", "/etc/kubernetes/pki", "The path to the directory where the certificates are stored. If specified, clean this directory.")
reset_phase_cleanupNodeCmd.Flags().String("cert-dir", "", "The path to the directory where the certificates are stored. If specified, clean this directory.")
reset_phase_cleanupNodeCmd.Flags().Bool("cleanup-tmp-dir", false, "Cleanup the \"/etc/kubernetes/tmp\" directory")
reset_phase_cleanupNodeCmd.Flags().String("cri-socket", "", "Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this value; use this option only if you have more than one CRI installed or if you have non-standard CRI socket.") reset_phase_cleanupNodeCmd.Flags().String("cri-socket", "", "Path to the CRI socket to connect. If empty kubeadm will try to auto-detect this value; use this option only if you have more than one CRI installed or if you have non-standard CRI socket.")
reset_phase_cleanupNodeCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
reset_phaseCmd.AddCommand(reset_phase_cleanupNodeCmd) reset_phaseCmd.AddCommand(reset_phase_cleanupNodeCmd)
carapace.Gen(reset_phase_cleanupNodeCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(reset_phase_cleanupNodeCmd).FlagCompletion(carapace.ActionMap{

View File

@ -7,13 +7,16 @@ import (
) )
var reset_phase_preflightCmd = &cobra.Command{ var reset_phase_preflightCmd = &cobra.Command{
Use: "preflight", Use: "preflight",
Short: "Run reset pre-flight checks", Short: "Run reset pre-flight checks",
Run: func(cmd *cobra.Command, args []string) {}, Aliases: []string{"pre-flight"},
Run: func(cmd *cobra.Command, args []string) {},
} }
func init() { func init() {
carapace.Gen(reset_phase_preflightCmd).Standalone() carapace.Gen(reset_phase_preflightCmd).Standalone()
reset_phase_preflightCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
reset_phase_preflightCmd.Flags().BoolP("force", "f", false, "Reset the node without prompting for confirmation.") reset_phase_preflightCmd.Flags().BoolP("force", "f", false, "Reset the node without prompting for confirmation.")
reset_phase_preflightCmd.Flags().StringSlice("ignore-preflight-errors", []string{}, "A list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedUser,Swap'. Value 'all' ignores errors from all checks.") reset_phase_preflightCmd.Flags().StringSlice("ignore-preflight-errors", []string{}, "A list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedUser,Swap'. Value 'all' ignores errors from all checks.")
reset_phaseCmd.AddCommand(reset_phase_preflightCmd) reset_phaseCmd.AddCommand(reset_phase_preflightCmd)

View File

@ -13,7 +13,9 @@ var reset_phase_removeEtcdMemberCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(reset_phase_removeEtcdMemberCmd).Standalone() carapace.Gen(reset_phase_removeEtcdMemberCmd).Standalone()
reset_phase_removeEtcdMemberCmd.Flags().String("kubeconfig", "/etc/kubernetes/admin.conf", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
reset_phase_removeEtcdMemberCmd.Flags().Bool("dry-run", false, "Don't apply any changes; just output what would be done.")
reset_phase_removeEtcdMemberCmd.Flags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
reset_phaseCmd.AddCommand(reset_phase_removeEtcdMemberCmd) reset_phaseCmd.AddCommand(reset_phase_removeEtcdMemberCmd)
carapace.Gen(reset_phase_removeEtcdMemberCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(reset_phase_removeEtcdMemberCmd).FlagCompletion(carapace.ActionMap{

View File

@ -1,17 +0,0 @@
package cmd
import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)
var reset_phase_updateClusterStatusCmd = &cobra.Command{
Use: "update-cluster-status",
Short: "Remove this node from the ClusterStatus object (DEPRECATED).",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(reset_phase_updateClusterStatusCmd).Standalone()
reset_phaseCmd.AddCommand(reset_phase_updateClusterStatusCmd)
}

View File

@ -26,7 +26,7 @@ func init() {
rootCmd.PersistentFlags().Uint64("log-file-max-size", 1800, "Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited.") rootCmd.PersistentFlags().Uint64("log-file-max-size", 1800, "Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited.")
rootCmd.PersistentFlags().Bool("logtostderr", true, "log to standard error instead of files") rootCmd.PersistentFlags().Bool("logtostderr", true, "log to standard error instead of files")
rootCmd.PersistentFlags().Bool("one-output", false, "If true, only write logs to their native severity level (vs also writing to each lower severity level)") rootCmd.PersistentFlags().Bool("one-output", false, "If true, only write logs to their native severity level (vs also writing to each lower severity level)")
rootCmd.PersistentFlags().String("rootfs", "", "[EXPERIMENTAL] The path to the 'real' host root filesystem.") rootCmd.PersistentFlags().String("rootfs", "", "The path to the 'real' host root filesystem. This will cause kubeadm to chroot into the provided path.")
rootCmd.PersistentFlags().Bool("skip-headers", false, "If true, avoid header prefixes in the log messages") rootCmd.PersistentFlags().Bool("skip-headers", false, "If true, avoid header prefixes in the log messages")
rootCmd.PersistentFlags().Bool("skip-log-headers", false, "If true, avoid headers when opening log files") rootCmd.PersistentFlags().Bool("skip-log-headers", false, "If true, avoid headers when opening log files")
rootCmd.PersistentFlags().String("stderrthreshold", "", "logs at or above this threshold go to stderr") rootCmd.PersistentFlags().String("stderrthreshold", "", "logs at or above this threshold go to stderr")

View File

@ -13,6 +13,7 @@ var tokenCmd = &cobra.Command{
func init() { func init() {
carapace.Gen(tokenCmd).Standalone() carapace.Gen(tokenCmd).Standalone()
tokenCmd.PersistentFlags().Bool("dry-run", false, "Whether to enable dry-run mode or not") tokenCmd.PersistentFlags().Bool("dry-run", false, "Whether to enable dry-run mode or not")
tokenCmd.PersistentFlags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.") tokenCmd.PersistentFlags().String("kubeconfig", "", "The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.")
rootCmd.AddCommand(tokenCmd) rootCmd.AddCommand(tokenCmd)

View File

@ -6,20 +6,21 @@ import (
) )
var token_createCmd = &cobra.Command{ var token_createCmd = &cobra.Command{
Use: "create", Use: "create [token]",
Short: "Create bootstrap tokens on the server", Short: "Create bootstrap tokens on the server",
Run: func(cmd *cobra.Command, args []string) {}, Run: func(cmd *cobra.Command, args []string) {},
} }
func init() { func init() {
carapace.Gen(token_createCmd).Standalone() carapace.Gen(token_createCmd).Standalone()
token_createCmd.Flags().String("certificate-key", "", "When used together with '--print-join-command', print the full 'kubeadm join' flag needed to join the cluster as a control-plane. To create a new certificate key you must use 'kubeadm init phase upload-certs --upload-certs'.") token_createCmd.Flags().String("certificate-key", "", "When used together with '--print-join-command', print the full 'kubeadm join' flag needed to join the cluster as a control-plane. To create a new certificate key you must use 'kubeadm init phase upload-certs --upload-certs'.")
token_createCmd.Flags().String("config", "", "Path to a kubeadm configuration file.") token_createCmd.Flags().String("config", "", "Path to a kubeadm configuration file.")
token_createCmd.Flags().String("description", "", "A human friendly description of how this token is used.") token_createCmd.Flags().String("description", "", "A human friendly description of how this token is used.")
token_createCmd.Flags().StringSlice("groups", []string{"system:bootstrappers:kubeadm:default-node-token"}, "Extra groups that this token will authenticate as when used for authentication. Must match \"\\Asystem:bootstrappers:[a-z0-9:-]{0,255}[a-z0-9]\\z\"") token_createCmd.Flags().StringSlice("groups", []string{}, "Extra groups that this token will authenticate as when used for authentication. Must match \"\\Asystem:bootstrappers:[a-z0-9:-]{0,255}[a-z0-9]\\z\"")
token_createCmd.Flags().Bool("print-join-command", false, "Instead of printing only the token, print the full 'kubeadm join' flag needed to join the cluster using the token.") token_createCmd.Flags().Bool("print-join-command", false, "Instead of printing only the token, print the full 'kubeadm join' flag needed to join the cluster using the token.")
token_createCmd.Flags().String("ttl", "", "The duration before the token is automatically deleted (e.g. 1s, 2m, 3h). If set to '0', the token will never expire") token_createCmd.Flags().String("ttl", "", "The duration before the token is automatically deleted (e.g. 1s, 2m, 3h). If set to '0', the token will never expire")
token_createCmd.Flags().StringSlice("usages", []string{"signing", "authentication"}, "Describes the ways in which this token can be used. You can pass --usages multiple times or provide a comma separated list of options. Valid options: [signing,authentication]") token_createCmd.Flags().StringSlice("usages", []string{}, "Describes the ways in which this token can be used. You can pass --usages multiple times or provide a comma separated list of options. Valid options: [signing,authentication]")
tokenCmd.AddCommand(token_createCmd) tokenCmd.AddCommand(token_createCmd)
carapace.Gen(token_createCmd).FlagCompletion(carapace.ActionMap{ carapace.Gen(token_createCmd).FlagCompletion(carapace.ActionMap{

Some files were not shown because too many files have changed in this diff Show More