options

package
v1.13.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package options provide a central point for defining flags for kubeadm cobra commands, no matter if hard coded commands or autogenerated command for phases.

New kubeadm flags should always be defined in this package as a constant before their usage, in order to enforce naming consistency across different commands and to control flag proliferation.

In addition to defining the flags, the package also contains set of utilities for flag management.

For additional details about how flags are managed in phases, please refer to the "k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow" package.

Index

Constants

View Source
const APIServerAdvertiseAddress = "apiserver-advertise-address"

APIServerAdvertiseAddress flag sets the IP address the API Server will advertise it's listening on. Specify '0.0.0.0' to use the address of the default network interface.

View Source
const APIServerBindPort = "apiserver-bind-port"

APIServerBindPort flag sets the port for the API Server to bind to.

View Source
const APIServerCertSANs = "apiserver-cert-extra-sans"

APIServerCertSANs flag sets extra Subject Alternative Names (SANs) to use for the API Server serving certificate. Can be both IP addresses and DNS names.

View Source
const APIServerExtraArgs = "apiserver-extra-args"

APIServerExtraArgs flag sets a extra flags to pass to the API Server or override default ones in form of <flagname>=<value>.

View Source
const CSRDir = "csr-dir"

CSRDir flag sets the location for CSRs and flags to be output

View Source
const CSROnly = "csr-only"

CSROnly flag instructs kubeadm to create CSRs instead of automatically creating or renewing certs

View Source
const CertificatesDir = "cert-dir"

CertificatesDir flag sets the path where to save and read the certificates.

View Source
const CfgPath = "config"

CfgPath flag sets the path to kubeadm config file.

View Source
const ControllerManagerExtraArgs = "controller-manager-extra-args"

ControllerManagerExtraArgs flag sets extra flags to pass to the Controller Manager or override default ones in form of <flagname>=<value>.

View Source
const DryRun = "dry-run"

DryRun flag instruct kubeadm to don't apply any changes; just output what would be done.

View Source
const FeatureGatesString = "feature-gates"

FeatureGatesString flag sets key=value pairs that describe feature gates for various features.

View Source
const IgnorePreflightErrors = "ignore-preflight-errors"

IgnorePreflightErrors sets the path a list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedUser,Swap'. Value 'all' ignores errors from all checks.

View Source
const ImageRepository = "image-repository"

ImageRepository sets the container registry to pull control plane images from.

View Source
const KubeconfigDir = "kubeconfig-dir"

KubeconfigDir flag sets the path where to save the kubeconfig file.

View Source
const KubeconfigPath = "kubeconfig"

KubeconfigPath flag sets the kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations are searched for an existing KubeConfig file.

View Source
const KubernetesVersion = "kubernetes-version"

KubernetesVersion flag sets the Kubernetes version for the control plane.

View Source
const NetworkingDNSDomain = "service-dns-domain"

NetworkingDNSDomain flag sets the domain for services, e.g. "myorg.internal".

View Source
const NetworkingPodSubnet = "pod-network-cidr"

NetworkingPodSubnet flag sets the range of IP addresses for the pod network. If set, the control plane will automatically allocate CIDRs for every node.

View Source
const NetworkingServiceSubnet = "service-cidr"

NetworkingServiceSubnet flag sets the range of IP address for service VIPs.

View Source
const NodeCRISocket = "cri-socket"

NodeCRISocket flag sets the CRI socket to connect to.

View Source
const NodeName = "node-name"

NodeName flag sets the node name.

View Source
const SchedulerExtraArgs = "scheduler-extra-args"

SchedulerExtraArgs flag sets extra flags to pass to the Scheduler or override default ones in form of <flagname>=<value>".

View Source
const SkipTokenPrint = "skip-token-print"

SkipTokenPrint flag instruct kubeadm to skip printing of the default bootstrap token generated by 'kubeadm init'.

Variables

This section is empty.

Functions

func AddCSRDirFlag added in v1.13.0

func AddCSRDirFlag(fs *pflag.FlagSet, csrDir *string)

AddCSRDirFlag adds the --csr-dir flag to the given flagset

func AddCSRFlag added in v1.13.0

func AddCSRFlag(fs *pflag.FlagSet, csr *bool)

AddCSRFlag adds the --csr-only flag to the given flagset

func AddCertificateDirFlag added in v1.12.0

func AddCertificateDirFlag(fs *pflag.FlagSet, certsDir *string)

AddCertificateDirFlag adds the --certs-dir flag to the given flagset

func AddConfigFlag

func AddConfigFlag(fs *pflag.FlagSet, cfgPath *string)

AddConfigFlag adds the --config flag to the given flagset

func AddControlPlanExtraArgsFlags added in v1.13.0

func AddControlPlanExtraArgsFlags(fs *pflag.FlagSet, apiServerExtraArgs, controllerManagerExtraArgs, schedulerExtraArgs *map[string]string)

AddControlPlanExtraArgsFlags adds the ExtraArgs flags for control plane components

func AddIgnorePreflightErrorsFlag added in v1.12.0

func AddIgnorePreflightErrorsFlag(fs *pflag.FlagSet, ignorePreflightErrors *[]string)

AddIgnorePreflightErrorsFlag adds the --ignore-preflight-errors flag to the given flagset

func AddImageMetaFlags added in v1.13.0

func AddImageMetaFlags(fs *pflag.FlagSet, imageRepository *string)

AddImageMetaFlags adds the --image-repository flag to the given flagset

func AddKubeConfigDirFlag added in v1.13.0

func AddKubeConfigDirFlag(fs *pflag.FlagSet, kubeConfigDir *string)

AddKubeConfigDirFlag adds the --kubeconfig-dir flag to the given flagset

func AddKubeConfigFlag

func AddKubeConfigFlag(fs *pflag.FlagSet, kubeConfigFile *string)

AddKubeConfigFlag adds the --kubeconfig flag to the given flagset

Types

type BootstrapTokenOptions

type BootstrapTokenOptions struct {
	*kubeadmapiv1beta1.BootstrapToken
	TokenStr string
}

BootstrapTokenOptions is a wrapper struct for adding bootstrap token-related flags to a FlagSet and applying the parsed flags to a InitConfiguration object later at runtime TODO: In the future, we might want to group the flags in a better way than adding them all individually like this

func NewBootstrapTokenOptions

func NewBootstrapTokenOptions() *BootstrapTokenOptions

NewBootstrapTokenOptions creates a new BootstrapTokenOptions object with the default values

func (*BootstrapTokenOptions) AddDescriptionFlag

func (bto *BootstrapTokenOptions) AddDescriptionFlag(fs *pflag.FlagSet)

AddDescriptionFlag adds the --description flag to the given flagset

func (*BootstrapTokenOptions) AddGroupsFlag

func (bto *BootstrapTokenOptions) AddGroupsFlag(fs *pflag.FlagSet)

AddGroupsFlag adds the --groups flag to the given flagset

func (*BootstrapTokenOptions) AddTTLFlag

func (bto *BootstrapTokenOptions) AddTTLFlag(fs *pflag.FlagSet)

AddTTLFlag adds the --token-ttl flag to the given flagset

func (*BootstrapTokenOptions) AddTTLFlagWithName

func (bto *BootstrapTokenOptions) AddTTLFlagWithName(fs *pflag.FlagSet, flagName string)

AddTTLFlagWithName adds the --token-ttl flag with a custom flag name given flagset

func (*BootstrapTokenOptions) AddTokenFlag

func (bto *BootstrapTokenOptions) AddTokenFlag(fs *pflag.FlagSet)

AddTokenFlag adds the --token flag to the given flagset

func (*BootstrapTokenOptions) AddUsagesFlag

func (bto *BootstrapTokenOptions) AddUsagesFlag(fs *pflag.FlagSet)

AddUsagesFlag adds the --usages flag to the given flagset

func (*BootstrapTokenOptions) ApplyTo

ApplyTo applies the values set internally in the BootstrapTokenOptions object to a InitConfiguration object at runtime If --token was specified in the CLI (as a string), it's parsed and validated before it's added to the BootstrapToken object.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL