# Functions
AddSelfHostedPrefix adds the self-hosted- prefix to the component name.
CreateTempDirForKubeadm is a function that creates a temporary directory under /etc/kubernetes/tmp (not using /tmp as that would potentially be dangerous).
CreateTimestampDirForKubeadm is a function that creates a temporary directory under /etc/kubernetes/tmp formatted with the current date.
EtcdSupportedVersion returns officially supported version of etcd for a specific Kubernetes release if passed version is not listed, the function returns nil and an error.
GetAdminKubeConfigPath returns the location on the disk where admin kubeconfig is located by default.
GetAPIServerVirtualIP returns the IP of the internal Kubernetes API service.
GetBootstrapKubeletKubeConfigPath returns the location on the disk where bootstrap kubelet kubeconfig is located by default.
GetDNSIP returns a dnsIP, which is 10th IP in svcSubnet CIDR range.
GetDNSVersion is a handy function that returns the DNS version by DNS type.
GetKubeletConfigMapName returns the right ConfigMap name for the right branch of k8s.
GetKubeletKubeConfigPath returns the location on the disk where kubelet kubeconfig is located by default.
GetKubernetesServiceCIDR returns the default Service CIDR for the Kubernetes internal service.
GetStaticPodAuditPolicyFile returns the path to the audit policy file within a static pod.
GetStaticPodDirectory returns the location on the disk where the Static Pod should be present.
GetStaticPodFilepath returns the location on the disk where the Static Pod should be present.
# Constants
AdminKubeConfigFileName defines name for the kubeconfig aimed to be used by the superuser/admin of the cluster.
AnnotationKubeadmCRISocket specifies the annotation kubeadm uses to preserve the crisocket information given to kubeadm at init/join time for use later.
APICallRetryInterval defines how long kubeadm should wait before retrying a failed API operation.
APIServerCertAndKeyBaseName defines API's server certificate and key base name.
APIServerCertCommonName defines API's server certificate common name (CN).
APIServerCertName defines API's server certificate name.
APIServerEtcdClientCertAndKeyBaseName defines apiserver's etcd client certificate and key base name.
APIServerEtcdClientCertCommonName defines apiserver's etcd client certificate common name (CN).
APIServerEtcdClientCertName defines apiserver's etcd client certificate name.
APIServerEtcdClientKeyName defines apiserver's etcd client key name.
APIServerKeyName defines API's server key name.
APIServerKubeletClientCertAndKeyBaseName defines kubelet client certificate and key base name.
APIServerKubeletClientCertCommonName defines kubelet client certificate common name (CN).
APIServerKubeletClientCertName defines kubelet client certificate name.
APIServerKubeletClientKeyName defines kubelet client key name.
AuditPolicyDir is the directory that will contain the audit policy.
AuditPolicyFile is the name of the audit policy file itself.
CACertAndKeyBaseName defines certificate authority base name.
CACertName defines certificate name.
CAKeyName defines certificate name.
CertificateKeySize specifies the size of the key used to encrypt certificates on uploadcerts phase.
CertificateValidity defines the validity for all the signed certificates generated by kubeadm.
ClusterConfigurationConfigMapKey specifies in what ConfigMap key the cluster configuration should be stored.
ClusterConfigurationKind is the string kind value for the ClusterConfiguration struct.
ClusterStatusConfigMapKey specifies in what ConfigMap key the cluster status should be stored.
ControllerManagerKubeConfigFileName defines the file name for the controller manager's kubeconfig file.
ControllerManagerUser defines the well-known user the controller-manager should be authenticated as.
ControlPlaneNumCPU is the number of CPUs required on control-plane.
CoreDNSConfigMap specifies in what ConfigMap in the kube-system namespace the CoreDNS config should be stored.
CoreDNSDeploymentName specifies the name of the Deployment for CoreDNS add-on.
CoreDNSImageName specifies the name of the image for CoreDNS add-on.
CoreDNSVersion is the version of CoreDNS to be deployed if it is used.
DefaultAPIServerBindAddress is the default bind address for the API Server.
DefaultCertTokenDuration specifies the default amount of time that the token used by upload certs will be valid Default behaviour is 2 hours.
DefaultCIImageRepository points to image registry where CI uploads images from ci-cross build job.
DefaultControlPlaneTimeout specifies the default control plane (actually API Server) timeout for use by kubeadm.
DefaultDockerCRISocket defines the default Docker CRI socket.
DefaultEtcdVersion indicates the default etcd version that kubeadm uses.
DefaultTokenDuration specifies the default amount of time that a bootstrap token will be valid Default behaviour is 24 hours.
DiscoveryRetryInterval specifies how long kubeadm should wait before retrying to connect to the control-plane when doing discovery.
DynamicKubeletConfigurationDirectoryName specifies the directory which stores the dynamic configuration checkpoints for the kubelet This directory should exist under KubeletRunDirectory.
Etcd defines variable used internally when referring to etcd component.
EtcdCACertAndKeyBaseName defines etcd's CA certificate and key base name.
EtcdCACertName defines etcd's CA certificate name.
EtcdCAKeyName defines etcd's CA key name.
EtcdHealthcheckClientCertAndKeyBaseName defines etcd's healthcheck client certificate and key base name.
EtcdHealthcheckClientCertCommonName defines etcd's healthcheck client certificate common name (CN).
EtcdHealthcheckClientCertName defines etcd's healthcheck client certificate name.
EtcdHealthcheckClientKeyName defines etcd's healthcheck client key name.
EtcdListenClientPort defines the port etcd listen on for client traffic.
EtcdListenPeerPort defines the port etcd listen on for peer traffic.
EtcdMetricsPort is the port at which to obtain etcd metrics and health status.
EtcdPeerCertAndKeyBaseName defines etcd's peer certificate and key base name.
EtcdPeerCertName defines etcd's peer certificate name.
EtcdPeerKeyName defines etcd's peer key name.
EtcdServerCertAndKeyBaseName defines etcd's server certificate and key base name.
EtcdServerCertName defines etcd's server certificate name.
EtcdServerKeyName defines etcd's server key name.
FrontProxyCACertAndKeyBaseName defines front proxy CA certificate and key base name.
FrontProxyCACertName defines front proxy CA certificate name.
FrontProxyCAKeyName defines front proxy CA key name.
FrontProxyClientCertAndKeyBaseName defines front proxy certificate and key base name.
used as subject.commonname attribute (CN).
FrontProxyClientCertName defines front proxy certificate name.
FrontProxyClientKeyName defines front proxy key name.
HyperKube defines variable used internally when referring to the hyperkube image.
InitConfigurationKind is the string kind value for the InitConfiguration struct.
InsecureKubeControllerManagerPort is the default port for the controller manager status server.
InsecureSchedulerPort is the default port for the scheduler status server.
JoinConfigurationKind is the string kind value for the JoinConfiguration struct.
KubeadmCertsSecret specifies in what Secret in the kube-system namespace the certificates should be stored.
KubeadmConfigConfigMap specifies in what ConfigMap in the kube-system namespace the `kubeadm init` configuration should be stored.
KubeAPIServer defines variable used internally when referring to kube-apiserver component.
KubeCertificatesVolumeName specifies the name for the Volume that is used for injecting certificates to control plane components (can be both a hostPath volume or a projected, all-in-one volume).
KubeConfigVolumeName specifies the name for the Volume that is used for injecting the kubeconfig to talk securely to the api server for a control plane component if applicable.
KubeControllerManager defines variable used internally when referring to kube-controller-manager component.
KubeDNSConfigMap specifies in what ConfigMap in the kube-system namespace the kube-dns config should be stored.
KubeDNSDeploymentName specifies the name of the Deployment for kube-dns add-on.
KubeDNSDnsMasqNannyImageName specifies the name of the image for the dnsmasq container in the kube-dns add-on.
KubeDNSKubeDNSImageName specifies the name of the image for the kubedns container in the kube-dns add-on.
KubeDNSSidecarImageName specifies the name of the image for the sidecar container in the kube-dns add-on.
KubeDNSVersion is the version of kube-dns to be deployed if it is used.
KubeletBaseConfigMapRolePrefix defines the base kubelet configuration ConfigMap.
KubeletBaseConfigurationConfigMapKey specifies in what ConfigMap key the initial remote configuration of kubelet should be stored.
KubeletBaseConfigurationConfigMapPrefix specifies in what ConfigMap in the kube-system namespace the initial remote configuration of kubelet should be stored.
KubeletBootstrapKubeConfigFileName defines the file name for the kubeconfig that the kubelet will use to do the TLS bootstrap to get itself an unique credential.
KubeletConfigurationFileName specifies the file name on the node which stores initial remote configuration of kubelet This file should exist under KubeletRunDirectory.
KubeletEnvFileName is a file "kubeadm init" writes at runtime.
KubeletEnvFileVariableName specifies the shell script variable name "kubeadm init" should write a value to in KubeletEnvFile.
KubeletHealthzPort is the port of the kubelet healthz endpoint.
KubeletKubeConfigFileName defines the file name for the kubeconfig that the control-plane kubelet will use for talking to the API server.
KubeletPort is the default port for the kubelet server on each host machine.
KubeletRunDirectory specifies the directory where the kubelet runtime information is stored.
KubeProxy defines variable used internally when referring to kube-proxy component.
KubeProxyConfigMap specifies in what ConfigMap in the kube-system namespace the kube-proxy configuration should be stored.
KubeProxyConfigMapKey specifies in what ConfigMap key the component config of kube-proxy should be stored.
KubernetesDir is the directory Kubernetes owns for storing various configuration files.
KubeScheduler defines variable used internally when referring to kube-scheduler component.
LabelNodeRoleMaster specifies that a node is a control-plane This is a duplicate definition of the constant in pkg/controller/service/controller.go.
LeaseEndpointReconcilerType will select a storage based reconciler Copied from pkg/master/reconcilers to avoid pulling extra dependencies TODO: Import this constant from a consts only package, that does not pull any further dependencies.
ManifestsSubDirName defines directory name to store manifests.
MinExternalEtcdVersion indicates minimum external etcd version which kubeadm supports.
MinimumAddressesInServiceSubnet defines minimum amount of nodes the Service subnet should allow.
ModeABAC is the mode to use Attribute Based Access Control to authorize.
ModeAlwaysAllow is the mode to set all requests as authorized.
ModeAlwaysDeny is the mode to set no requests as authorized.
ModeNode is an authorization mode that authorizes API requests made by kubelets.
ModeRBAC is the mode to use Role Based Access Control to authorize.
ModeWebhook is the mode to make an external webhook call to authorize.
NodeBootstrapTokenAuthGroup specifies which group a Node Bootstrap Token should be authenticated in.
NodesClusterRoleBinding defines the well-known ClusterRoleBinding which binds the too permissive system:node ClusterRole to the system:nodes group.
NodesGroup defines the well-known group for all nodes.
NodesUserPrefix defines the user name prefix as requested by the Node authorizer.
PatchNodeTimeout specifies how long kubeadm should wait for applying the label and taint on the control-plane before timing out.
PauseVersion indicates the default pause image version for kubeadm.
PrepullImagesInParallelTimeout specifies how long kubeadm should wait for prepulling images in parallel before timing out.
SchedulerKubeConfigFileName defines the file name for the scheduler's kubeconfig file.
SchedulerUser defines the well-known user the scheduler should be authenticated as.
SelfHostingPrefix describes the prefix workloads that are self-hosted by kubeadm has.
ServiceAccountKeyBaseName defines SA key base name.
ServiceAccountPrivateKeyName defines SA private key base name.
ServiceAccountPublicKeyName defines SA public key base name.
StaticPodAuditPolicyLogDir is the name of the directory in the static pod that will have the audit logs.
SystemPrivilegedGroup defines the well-known group for the apiservers.
TempDirForKubeadm defines temporary directory for kubeadm should be joined with KubernetesDir.
TLSBootstrapTimeout specifies how long kubeadm should wait for the kubelet to perform the TLS Bootstrap.
YAMLDocumentSeparator is the separator for YAML documents TODO: Find a better place for this constant.
# Variables
ControlPlaneComponents defines the control-plane component names.
ControlPlaneTaint is the taint to apply on the PodSpec for being able to run that Pod on the control-plane.
ControlPlaneToleration is the toleration to apply on the PodSpec for being able to run that Pod on the control-plane.
CurrentKubernetesVersion specifies current Kubernetes version supported by kubeadm.
DefaultTokenGroups specifies the default groups that this token will authenticate as when used for authentication.
DefaultTokenUsages specifies the default functions a token will get.
KubeadmCertsClusterRoleName sets the name for the ClusterRole that allows the bootstrap tokens to access the kubeadm-certs Secret during the join of a new control-plane.
MinimumControlPlaneVersion specifies the minimum control plane version kubeadm can deploy.
MinimumKubeletVersion specifies the minimum version of kubelet which kubeadm supports.
SupportedEtcdVersion lists officially supported etcd versions with corresponding Kubernetes releases.