From f0d1f27f69e4583321f66c7907f994d41c7c38b5 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Thu, 13 Sep 2018 04:34:33 +0300 Subject: [PATCH] kubeadm: update API types documentation for 1.12 - v1alpha2 -> v1alpha3 - MasterConfiguration -> [new-api-types] --- .../kubeadm/implementation-details.md | 6 +- .../setup-tools/kubeadm/kubeadm-init.md | 156 +----------------- .../setup/independent/control-plane-flags.md | 26 +-- .../setup/independent/kubelet-integration.md | 22 +-- .../independent/setup-ha-etcd-with-kubeadm.md | 4 +- .../independent/troubleshooting-kubeadm.md | 2 +- 6 files changed, 35 insertions(+), 181 deletions(-) diff --git a/content/en/docs/reference/setup-tools/kubeadm/implementation-details.md b/content/en/docs/reference/setup-tools/kubeadm/implementation-details.md index 342149e7cebe8..ce9499213e569 100644 --- a/content/en/docs/reference/setup-tools/kubeadm/implementation-details.md +++ b/content/en/docs/reference/setup-tools/kubeadm/implementation-details.md @@ -324,8 +324,8 @@ Please note that: 1. To make dynamic kubelet configuration work, flag `--dynamic-config-dir=/var/lib/kubelet/config/dynamic` should be specified in `/etc/systemd/system/kubelet.service.d/10-kubeadm.conf` -1. Kubelet init configuration can be changed by using kubeadm MasterConfiguration file by setting `.kubeletConfiguration.baseConfig`. - See [using kubeadm init with a configuration file](/docs/reference/setup-tools/kubeadm/kubeadm-init/#config-file) for more detail +1. The kubelet configuration can be changed by passing a `KubeletConfiguration` object to `kubeadm init` or `kubeadm join` by using + a configuration file `--config some-file.yaml` ### Wait for the control plane to come up @@ -346,7 +346,7 @@ If kubeadm is invoked with `--feature-gates=DynamicKubeletConfig`: (that is `system:bootstrappers:kubeadm:default-node-token` and `system:nodes` groups) 3. Enable the dynamic kubelet configuration feature for the initial master node by pointing `Node.spec.configSource` to the newly-created ConfigMap -### Save kubeadm MasterConfiguration in a ConfigMap for later reference +### Save the kubeadm ClusterConfiguration in a ConfigMap for later reference kubeadm saves the configuration passed to `kubeadm init`, either via flags or the config file, in a ConfigMap named `kubeadm-config` under `kube-system` namespace. diff --git a/content/en/docs/reference/setup-tools/kubeadm/kubeadm-init.md b/content/en/docs/reference/setup-tools/kubeadm/kubeadm-init.md index 4e655c8935c56..5de9748de402c 100644 --- a/content/en/docs/reference/setup-tools/kubeadm/kubeadm-init.md +++ b/content/en/docs/reference/setup-tools/kubeadm/kubeadm-init.md @@ -102,164 +102,16 @@ configuration file options. This file is passed in the `--config` option. In Kubernetes 1.11 and later, the default configuration can be printed out using the [kubeadm config print-default](/docs/reference/setup-tools/kubeadm/kubeadm-config/) command. -It is **recommended** that you migrate your old `v1alpha1` configuration to `v1alpha2` using +It is **recommended** that you migrate your old `v1alpha2` configuration to `v1alpha3` using the [kubeadm config migrate](/docs/reference/setup-tools/kubeadm/kubeadm-config/) command, -because `v1alpha1` will be removed in Kubernetes 1.12. +because `v1alpha2` will be removed in Kubernetes 1.13. For more details on each field in the configuration you can navigate to our -[API reference pages.] (https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm#MasterConfiguration) - -Example of the kubeadm MasterConfiguration version `v1alpha2`: - -```yaml -apiVersion: kubeadm.k8s.io/v1alpha2 -kind: MasterConfiguration -kubernetesVersion: v1.11.0 -api: - advertiseAddress: 192.168.0.102 - bindPort: 6443 - controlPlaneEndpoint: "" -auditPolicy: - logDir: /var/log/kubernetes/audit - logMaxAge: 2 - path: "" -bootstrapTokens: -- groups: - - system:bootstrappers:kubeadm:default-node-token - token: abcdef.0123456789abcdef - ttl: 24h0m0s - usages: - - signing - - authentication -certificatesDir: /etc/kubernetes/pki -clusterName: kubernetes -etcd: - local: - dataDir: /var/lib/etcd - image: "" -imageRepository: k8s.gcr.io -kubeProxy: - config: - bindAddress: 0.0.0.0 - clientConnection: - acceptContentTypes: "" - burst: 10 - contentType: application/vnd.kubernetes.protobuf - kubeconfig: /var/lib/kube-proxy/kubeconfig.conf - qps: 5 - clusterCIDR: "" - configSyncPeriod: 15m0s - conntrack: - max: null - maxPerCore: 32768 - min: 131072 - tcpCloseWaitTimeout: 1h0m0s - tcpEstablishedTimeout: 24h0m0s - enableProfiling: false - healthzBindAddress: 0.0.0.0:10256 - hostnameOverride: "" - iptables: - masqueradeAll: false - masqueradeBit: 14 - minSyncPeriod: 0s - syncPeriod: 30s - ipvs: - ExcludeCIDRs: null - minSyncPeriod: 0s - scheduler: "" - syncPeriod: 30s - metricsBindAddress: 127.0.0.1:10249 - mode: "" - nodePortAddresses: null - oomScoreAdj: -999 - portRange: "" - resourceContainer: /kube-proxy - udpIdleTimeout: 250ms -kubeletConfiguration: - baseConfig: - address: 0.0.0.0 - authentication: - anonymous: - enabled: false - webhook: - cacheTTL: 2m0s - enabled: true - x509: - clientCAFile: /etc/kubernetes/pki/ca.crt - authorization: - mode: Webhook - webhook: - cacheAuthorizedTTL: 5m0s - cacheUnauthorizedTTL: 30s - cgroupDriver: cgroupfs - cgroupsPerQOS: true - clusterDNS: - - 10.96.0.10 - clusterDomain: cluster.local - containerLogMaxFiles: 5 - containerLogMaxSize: 10Mi - contentType: application/vnd.kubernetes.protobuf - cpuCFSQuota: true - cpuManagerPolicy: none - cpuManagerReconcilePeriod: 10s - enableControllerAttachDetach: true - enableDebuggingHandlers: true - enforceNodeAllocatable: - - pods - eventBurst: 10 - eventRecordQPS: 5 - evictionHard: - imagefs.available: 15% - memory.available: 100Mi - nodefs.available: 10% - nodefs.inodesFree: 5% - evictionPressureTransitionPeriod: 5m0s - failSwapOn: true - fileCheckFrequency: 20s - hairpinMode: promiscuous-bridge - healthzBindAddress: 127.0.0.1 - healthzPort: 10248 - httpCheckFrequency: 20s - imageGCHighThresholdPercent: 85 - imageGCLowThresholdPercent: 80 - imageMinimumGCAge: 2m0s - iptablesDropBit: 15 - iptablesMasqueradeBit: 14 - kubeAPIBurst: 10 - kubeAPIQPS: 5 - makeIPTablesUtilChains: true - maxOpenFiles: 1000000 - maxPods: 110 - nodeStatusUpdateFrequency: 10s - oomScoreAdj: -999 - podPidsLimit: -1 - port: 10250 - registryBurst: 10 - registryPullQPS: 5 - resolvConf: /etc/resolv.conf - rotateCertificates: true - runtimeRequestTimeout: 2m0s - serializeImagePulls: true - staticPodPath: /etc/kubernetes/manifests - streamingConnectionIdleTimeout: 4h0m0s - syncFrequency: 1m0s - volumeStatsAggPeriod: 1m0s -networking: - dnsDomain: cluster.local - podSubnet: "" - serviceSubnet: 10.96.0.0/12 -nodeRegistration: - criSocket: /var/run/dockershim.sock - name: your-host-name - taints: - - effect: NoSchedule - key: node-role.kubernetes.io/master -unifiedControlPlaneImage: "" -``` +[API reference pages.] (https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm) ### Adding kube-proxy parameters {#kube-proxy} -For information about kube-proxy parameters in the MasterConfiguration see: +For information about kube-proxy parameters in the kubeadm configuration see: - [kube-proxy](https://godoc.org/k8s.io/kubernetes/pkg/proxy/apis/kubeproxyconfig/v1alpha1#KubeProxyConfiguration) ### Passing custom flags to control plane components {#control-plane-flags} diff --git a/content/en/docs/setup/independent/control-plane-flags.md b/content/en/docs/setup/independent/control-plane-flags.md index b1d1f4ebca8a4..ba01d29b4c39d 100644 --- a/content/en/docs/setup/independent/control-plane-flags.md +++ b/content/en/docs/setup/independent/control-plane-flags.md @@ -20,7 +20,7 @@ These fields consist of `key: value` pairs. To override a flag for a control pla 2. Add the flags to override to the field. For more details on each field in the configuration you can navigate to our -[API reference pages](https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm#MasterConfiguration). +[API reference pages](https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm#ClusterConfiguration). {{% /capture %}} @@ -32,11 +32,11 @@ For details, see the [reference documentation for kube-apiserver](https://kubern Example usage: ```yaml -apiVersion: kubeadm.k8s.io/v1alpha2 -kind: MasterConfiguration -kubernetesVersion: v1.11.0 +apiVersion: kubeadm.k8s.io/v1alpha3 +kind: ClusterConfiguration +kubernetesVersion: v1.12.0 metadata: - name: 1.11-sample + name: 1.12-sample apiServerExtraArgs: advertise-address: 192.168.0.103 anonymous-auth: false @@ -50,11 +50,11 @@ For details, see the [reference documentation for kube-controller-manager](https Example usage: ```yaml -apiVersion: kubeadm.k8s.io/v1alpha2 -kind: MasterConfiguration -kubernetesVersion: v1.11.0 +apiVersion: kubeadm.k8s.io/v1alpha3 +kind: ClusterConfiguration +kubernetesVersion: v1.12.0 metadata: - name: 1.11-sample + name: 1.12-sample controllerManagerExtraArgs: cluster-signing-key-file: /home/johndoe/keys/ca.key bind-address: 0.0.0.0 @@ -67,11 +67,11 @@ For details, see the [reference documentation for kube-scheduler](https://kubern Example usage: ```yaml -apiVersion: kubeadm.k8s.io/v1alpha2 -kind: MasterConfiguration -kubernetesVersion: v1.11.0 +apiVersion: kubeadm.k8s.io/v1alpha3 +kind: ClusterConfiguration +kubernetesVersion: v1.12.0 metadata: - name: 1.11-sample + name: 1.12-sample schedulerExtraArgs: address: 0.0.0.0 config: /home/johndoe/schedconfig.yaml diff --git a/content/en/docs/setup/independent/kubelet-integration.md b/content/en/docs/setup/independent/kubelet-integration.md index 3a7a8e259542b..5c1ee84741650 100644 --- a/content/en/docs/setup/independent/kubelet-integration.md +++ b/content/en/docs/setup/independent/kubelet-integration.md @@ -23,7 +23,7 @@ manager instead, but you need to configure it manually. Some kubelet configuration details need to be the same across all kubelets involved in the cluster, while other configuration aspects need to be set on a per-kubelet basis, to accommodate the different characteristics of a given machine, such as OS, storage, and networking. You can manage the configuration -of your kubelets manually, but [kubeadm now provides a `MasterConfig` API type for managing your +of your kubelets manually, but [kubeadm now provides a `KubeletConfiguration` API type for managing your kubelet configurations centrally](#configure-kubelets-using-kubeadm). {{% /capture %}} @@ -63,10 +63,7 @@ clusterDNS: - 10.96.0.10 ``` -See the -[API reference for the -kubelet ComponentConfig](https://godoc.org/k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig#KubeletConfiguration) -for more information. +For more details on the ComponentConfig have a look at [this section](#configure-kubelets-using-kubeadm). ### Providing instance-specific configuration details @@ -96,14 +93,19 @@ such as systemd. ## Configure kubelets using kubeadm -The kubeadm config API type `MasterConfiguration` embeds the kubelet's ComponentConfig under -the `.kubeletConfiguration.baseConfig` key. Any user writing a `MasterConfiguration` -file can use this configuration key to also set the base-level configuration for all kubelets -in the cluster. +It is possible to configure the kubelet that kubeadm will start if a custom `KubeletConfiguration` +API object is passed with a configuration file like so `kubeadm ... --config some-config-file.yaml`. + +By calling `kubeadm config print-default --api-objects KubeletConfiguration` you can +see all the default values for this structure. + +Also have a look at the [API reference for the +kubelet ComponentConfig](https://godoc.org/k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig#KubeletConfiguration) +for more information on the individual fields. ### Workflow when using `kubeadm init` -When you call `kubeadm init`, the `.kubeletConfiguration.baseConfig` structure is marshalled to disk +When you call `kubeadm init`, the kubelet configuration is marshalled to disk at `/var/lib/kubelet/config.yaml`, and also uploaded to a ConfigMap in the cluster. The ConfigMap is named `kubelet-config-1.X`, where `.X` is the minor version of the Kubernetes version you are initializing. A kubelet configuration file is also written to `/etc/kubernetes/kubelet.conf` with the diff --git a/content/en/docs/setup/independent/setup-ha-etcd-with-kubeadm.md b/content/en/docs/setup/independent/setup-ha-etcd-with-kubeadm.md index 576e497da7589..2063d944767b1 100644 --- a/content/en/docs/setup/independent/setup-ha-etcd-with-kubeadm.md +++ b/content/en/docs/setup/independent/setup-ha-etcd-with-kubeadm.md @@ -83,8 +83,8 @@ this example. HOST=${ETCDHOSTS[$i]} NAME=${NAMES[$i]} cat << EOF > /tmp/${HOST}/kubeadmcfg.yaml - apiVersion: "kubeadm.k8s.io/v1alpha2" - kind: MasterConfiguration + apiVersion: "kubeadm.k8s.io/v1alpha3" + kind: ClusterConfiguration etcd: local: serverCertSANs: diff --git a/content/en/docs/setup/independent/troubleshooting-kubeadm.md b/content/en/docs/setup/independent/troubleshooting-kubeadm.md index 481b429e023f6..6bca12b08f5c3 100644 --- a/content/en/docs/setup/independent/troubleshooting-kubeadm.md +++ b/content/en/docs/setup/independent/troubleshooting-kubeadm.md @@ -190,7 +190,7 @@ Error from server: Get https://10.19.0.41:10250/containerLogs/default/mysql-ddc6 curl http://169.254.169.254/metadata/v1/interfaces/public/0/anchor_ipv4/address ``` - The workaround is to tell `kubelet` which IP to use using `--node-ip`. When using Digital Ocean, it can be the public one (assigned to `eth0`) or the private one (assigned to `eth1`) should you want to use the optional private network. The [KubeletExtraArgs section of the MasterConfiguration file](https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/apis/kubeadm/v1alpha2/types.go#L147) can be used for this. + The workaround is to tell `kubelet` which IP to use using `--node-ip`. When using Digital Ocean, it can be the public one (assigned to `eth0`) or the private one (assigned to `eth1`) should you want to use the optional private network. The [`KubeletExtraArgs` section of the kubeadm `NodeRegistrationOptions` structure](https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/apis/kubeadm/v1alpha3/types.go#L163-L166) can be used for this. Then restart `kubelet`: