Beginning with v1.8.0, kubeadm uploads the configuration of your cluster to a ConfigMap called
kubeadm-config
in the kube-system
namespace, and later reads the ConfigMap when upgrading.
This enables correct configuration of system components, and provides a seamless user experience.
You can execute kubeadm config view
to view the ConfigMap. If you initialized your cluster using
kubeadm v1.7.x or lower, you must use kubeadm config upload
to create the ConfigMap before you
may use kubeadm upgrade
.
In Kubernetes v1.11.0, some new commands were added. You can use kubeadm config print-default
to print the default configuration and kubeadm config migrate
to convert your old configuration
files to a newer version. kubeadm config images list
and kubeadm config images pull
can be used
to list and pull the images that kubeadm requires.
In Kubernetes v1.13.0 and later to list/pull kube-dns images instead of the CoreDNS image
the --config
method described here
has to be used.
Upload a configuration file to the in-cluster ConfigMap for kubeadm configuration.
Using this command, you can upload configuration to the ConfigMap in the cluster using the same config file you gave to ‘kubeadm init’. If you initialized your cluster using a v1.7.x or lower kubeadm client and used the –config option, you need to run this command with the same config file before upgrading to v1.8 using ‘kubeadm upgrade’.
The configuration is located in the “kube-system” namespace in the “kubeadm-config” ConfigMap.
kubeadm config upload from-file [flags]
--config string | |
Path to a kubeadm configuration file. | |
-h, --help | |
help for from-file |
--kubeconfig string Default: "/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. | |
--rootfs string | |
[EXPERIMENTAL] The path to the 'real' host root filesystem. |
Create the in-cluster configuration file for the first time from using flags.
Using this command, you can upload configuration to the ConfigMap in the cluster using the same flags you gave to ‘kubeadm init’. If you initialized your cluster using a v1.7.x or lower kubeadm client and set certain flags, you need to run this command with the same flags before upgrading to v1.8 using ‘kubeadm upgrade’.
The configuration is located in the “kube-system” namespace in the “kubeadm-config” ConfigMap.
kubeadm config upload from-flags [flags]
--apiserver-advertise-address string | |
The IP address the API Server will advertise it's listening on. If not set the default network interface will be used. | |
--apiserver-bind-port int32 Default: 6443 | |
Port for the API Server to bind to. | |
--apiserver-cert-extra-sans stringSlice | |
Optional extra Subject Alternative Names (SANs) to use for the API Server serving certificate. Can be both IP addresses and DNS names. | |
--cert-dir string Default: "/etc/kubernetes/pki" | |
The path where to save and store the certificates. | |
--cri-socket string | |
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. | |
--feature-gates string | |
A set of key=value pairs that describe feature gates for various features. Options are: |
|
-h, --help | |
help for from-flags | |
--kubernetes-version string Default: "stable-1" | |
Choose a specific Kubernetes version for the control plane. | |
--node-name string | |
Specify the node name. | |
--pod-network-cidr string | |
Specify range of IP addresses for the pod network. If set, the control plane will automatically allocate CIDRs for every node. | |
--service-cidr string Default: "10.96.0.0/12" | |
Use alternative range of IP address for service VIPs. | |
--service-dns-domain string Default: "cluster.local" | |
Use alternative domain for services, e.g. "myorg.internal". |
--kubeconfig string Default: "/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. | |
--rootfs string | |
[EXPERIMENTAL] The path to the 'real' host root filesystem. |
View the kubeadm configuration stored inside the cluster.
Using this command, you can view the ConfigMap in the cluster where the configuration for kubeadm is located.
The configuration is located in the “kube-system” namespace in the “kubeadm-config” ConfigMap.
kubeadm config view [flags]
-h, --help | |
help for view |
--kubeconfig string Default: "/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. | |
--rootfs string | |
[EXPERIMENTAL] The path to the 'real' host root filesystem. |
Print default init configuration, that can be used for ‘kubeadm init’
This command prints objects such as the default init configuration that is used for ‘kubeadm init’.
Note that sensitive values like the Bootstrap Token fields are replaced with placeholder values like {“abcdef.0123456789abcdef” “” “nil”
kubeadm config print init-defaults [flags]
--component-configs stringSlice | |
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. | |
-h, --help | |
help for init-defaults |
--kubeconfig string Default: "/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. | |
--rootfs string | |
[EXPERIMENTAL] The path to the 'real' host root filesystem. |
Print default join configuration, that can be used for ‘kubeadm join’
This command prints objects such as the default join configuration that is used for ‘kubeadm join’.
Note that sensitive values like the Bootstrap Token fields are replaced with placeholder values like {“abcdef.0123456789abcdef” “” “nil”
kubeadm config print join-defaults [flags]
--component-configs stringSlice | |
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. | |
-h, --help | |
help for join-defaults |
--kubeconfig string Default: "/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. | |
--rootfs string | |
[EXPERIMENTAL] The path to the 'real' host root filesystem. |
Read an older version of the kubeadm configuration API types from a file, and output the similar config object for the newer version.
This command lets you convert configuration objects of older versions to the latest supported version, locally in the CLI tool without ever touching anything in the cluster. In this version of kubeadm, the following API versions are supported: - kubeadm.k8s.io/v1alpha3 - kubeadm.k8s.io/v1beta1
Further, kubeadm can only write out config of version “kubeadm.k8s.io/v1beta1”, but read both types. So regardless of what version you pass to the –old-config parameter here, the API object will be read, deserialized, defaulted, converted, validated, and re-serialized when written to stdout or –new-config if specified.
In other words, the output of this command is what kubeadm actually would read internally if you submitted this file to “kubeadm init”
kubeadm config migrate [flags]
-h, --help | |
help for migrate | |
--new-config string | |
Path to the resulting equivalent kubeadm config file using the new API version. Optional, if not specified output will be sent to STDOUT. | |
--old-config string | |
Path to the kubeadm config file that is using an old API version and should be converted. This flag is mandatory. |
--kubeconfig string Default: "/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. | |
--rootfs string | |
[EXPERIMENTAL] The path to the 'real' host root filesystem. |
Print a list of images kubeadm will use. The configuration file is used in case any images or image repositories are customized.
Print a list of images kubeadm will use. The configuration file is used in case any images or image repositories are customized.
kubeadm config images list [flags]
--config string | |
Path to kubeadm config file. | |
--feature-gates string | |
A set of key=value pairs that describe feature gates for various features. Options are: |
|
-h, --help | |
help for list | |
--kubernetes-version string Default: "stable-1" | |
Choose a specific Kubernetes version for the control plane. |
--kubeconfig string Default: "/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. | |
--rootfs string | |
[EXPERIMENTAL] The path to the 'real' host root filesystem. |
Pull images used by kubeadm.
Pull images used by kubeadm.
kubeadm config images pull [flags]
--config string | |
Path to kubeadm config file. | |
--cri-socket string | |
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. | |
--feature-gates string | |
A set of key=value pairs that describe feature gates for various features. Options are: |
|
-h, --help | |
help for pull | |
--kubernetes-version string Default: "stable-1" | |
Choose a specific Kubernetes version for the control plane. |
--kubeconfig string Default: "/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. | |
--rootfs string | |
[EXPERIMENTAL] The path to the 'real' host root filesystem. |
Was this page helpful?
Thanks for the feedback. If you have a specific, answerable question about how to use Kubernetes, ask it on Stack Overflow. Open an issue in the GitHub repo if you want to report a problem or suggest an improvement.