--- approvers: - mikedanese - luxas - jbeda title: kubeadm init --- {% capture overview %} {% endcapture %} {% capture body %} {% include_relative generated/kubeadm_init.md %} ### Init workflow {#init-workflow} `kubeadm init` bootstraps a Kubernetes master node by executing the following steps: 1. Runs a series of pre-flight checks to validate the system state before making changes. Some checks only trigger warnings, others are considered errors and will exit kubeadm until the problem is corrected or the user specifies `--skip-preflight-checks`. 1. Generates a self-signed CA (or using an existing one if provided) to set up identities for each component in the cluster. If the user has provided their own CA cert and/or key by dropping it in the cert directory configured via `--cert-dir` (`/etc/kubernetes/pki` by default) this step is skipped as described in the [Using custom certificates](#custom-certificates) document. 1. Writes kubeconfig files in `/etc/kubernetes/` for the kubelet, the controller-manager and the scheduler to use to connect to the API server, each with its own identity, as well as an additional kubeconfig file for administration named `admin.conf`. 1. Generates static Pod manifests for the API server, controller manager and scheduler. In case an external etcd is not provided, an additional static Pod manifest are generated for etcd. Static Pod manifests are written to `/etc/kubernetes/manifests`; the kubelet watches this directory for Pods to create on startup. Once control plane Pods are up and running, the `kubeadm init` sequence can continue. 1. Apply labels and taints to the master node so that no additional workloads will run there. 1. Generates the token that additional nodes can use to register themselves with the master in the future. Optionally, the user can provide a token via `--token`, as described in the [kubeadm token](kubeadm-token.md) docs. 1. Makes all the necessary configurations for allowing node joining with the [Bootstrap Tokens](/docs/admin/bootstrap-tokens/) and [TLS Bootstrap](/docs/admin/kubelet-tls-bootstrapping/) mechanism: - Write a ConfigMap for making available all the information required for joining, and set up related RBAC access rules. - Let Bootstrap Tokens access the CSR signing API. - Configure auto-approval for new CSR requests. See [kubeadm join](kubeadm-join.md) for additional info. 1. Installs the internal DNS server and the kube-proxy addon components via the API server. Please note that although the DNS server is deployed, it will not be scheduled until CNI is installed. 1. If `kubeadm init` is invoked with the alpha self-hosting feature enabled, (`--feature-gates=SelfHosting=true`), the static Pod based control plane is transformed into a [self-hosted control plane](#self-hosting). ### Using kubeadm init with a configuration file {#config-file} **Caution:** The config file is still considered alpha and may change in future versions. {: .caution} It's possible to configure `kubeadm init` with a configuration file instead of command line flags, and some more advanced features may only be available as configuration file options. This file is passed in the `--config` option. ```yaml apiVersion: kubeadm.k8s.io/v1alpha1 kind: MasterConfiguration api: advertiseAddress: bindPort: etcd: endpoints: - - caFile: certFile: keyFile: dataDir: extraArgs: : : image: networking: dnsDomain: serviceSubnet: podSubnet: kubernetesVersion: cloudProvider: nodeName: authorizationModes: - - token: tokenTTL: