kubeadm: update API types documentation for 1.12 (#10283)

v1alpha2 -> v1alpha3
MasterConfiguration -> [new-api-types]
This commit is contained in:
Lubomir I. Ivanov
2018-09-20 00:30:32 +03:00
committed by k8s-ci-robot
parent b3529ee840
commit 5ab6ae0dd6
6 changed files with 37 additions and 182 deletions
@@ -324,8 +324,9 @@ Please note that:
1. To make dynamic kubelet configuration work, flag `--dynamic-config-dir=/var/lib/kubelet/config/dynamic` should be specified 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` 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`. 1. The kubelet configuration can be changed by passing a `KubeletConfiguration` object to `kubeadm init` or `kubeadm join` by using
See [using kubeadm init with a configuration file](/docs/reference/setup-tools/kubeadm/kubeadm-init/#config-file) for more detail a configuration file `--config some-file.yaml`. The `KubeletConfiguration` object can be separated from other objects such
as `InitConfiguration` using the `---` separator. For more details have a look at the `kubeadm config print-default` command.
### Wait for the control plane to come up ### Wait for the control plane to come up
@@ -346,7 +347,7 @@ If kubeadm is invoked with `--feature-gates=DynamicKubeletConfig`:
(that is `system:bootstrappers:kubeadm:default-node-token` and `system:nodes` groups) (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 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 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. named `kubeadm-config` under `kube-system` namespace.
@@ -102,165 +102,17 @@ 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 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. [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, 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 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)
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: ""
```
### Adding kube-proxy parameters {#kube-proxy} ### 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) - [kube-proxy](https://godoc.org/k8s.io/kubernetes/pkg/proxy/apis/config#KubeProxyConfiguration)
### Passing custom flags to control plane components {#control-plane-flags} ### Passing custom flags to control plane components {#control-plane-flags}
@@ -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. 2. Add the flags to override to the field.
For more details on each field in the configuration you can navigate to our 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 %}} {{% /capture %}}
@@ -32,11 +32,11 @@ For details, see the [reference documentation for kube-apiserver](https://kubern
Example usage: Example usage:
```yaml ```yaml
apiVersion: kubeadm.k8s.io/v1alpha2 apiVersion: kubeadm.k8s.io/v1alpha3
kind: MasterConfiguration kind: ClusterConfiguration
kubernetesVersion: v1.11.0 kubernetesVersion: v1.12.0
metadata: metadata:
name: 1.11-sample name: 1.12-sample
apiServerExtraArgs: apiServerExtraArgs:
advertise-address: 192.168.0.103 advertise-address: 192.168.0.103
anonymous-auth: false anonymous-auth: false
@@ -50,11 +50,11 @@ For details, see the [reference documentation for kube-controller-manager](https
Example usage: Example usage:
```yaml ```yaml
apiVersion: kubeadm.k8s.io/v1alpha2 apiVersion: kubeadm.k8s.io/v1alpha3
kind: MasterConfiguration kind: ClusterConfiguration
kubernetesVersion: v1.11.0 kubernetesVersion: v1.12.0
metadata: metadata:
name: 1.11-sample name: 1.12-sample
controllerManagerExtraArgs: controllerManagerExtraArgs:
cluster-signing-key-file: /home/johndoe/keys/ca.key cluster-signing-key-file: /home/johndoe/keys/ca.key
bind-address: 0.0.0.0 bind-address: 0.0.0.0
@@ -67,11 +67,11 @@ For details, see the [reference documentation for kube-scheduler](https://kubern
Example usage: Example usage:
```yaml ```yaml
apiVersion: kubeadm.k8s.io/v1alpha2 apiVersion: kubeadm.k8s.io/v1alpha3
kind: MasterConfiguration kind: ClusterConfiguration
kubernetesVersion: v1.11.0 kubernetesVersion: v1.12.0
metadata: metadata:
name: 1.11-sample name: 1.12-sample
schedulerExtraArgs: schedulerExtraArgs:
address: 0.0.0.0 address: 0.0.0.0
config: /home/johndoe/schedconfig.yaml config: /home/johndoe/schedconfig.yaml
@@ -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 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 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 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). kubelet configurations centrally](#configure-kubelets-using-kubeadm).
{{% /capture %}} {{% /capture %}}
@@ -63,10 +63,7 @@ clusterDNS:
- 10.96.0.10 - 10.96.0.10
``` ```
See the For more details on the ComponentConfig have a look at [this section](#configure-kubelets-using-kubeadm).
[API reference for the
kubelet ComponentConfig](https://godoc.org/k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig#KubeletConfiguration)
for more information.
### Providing instance-specific configuration details ### Providing instance-specific configuration details
@@ -96,14 +93,19 @@ such as systemd.
## Configure kubelets using kubeadm ## Configure kubelets using kubeadm
The kubeadm config API type `MasterConfiguration` embeds the kubelet's ComponentConfig under It is possible to configure the kubelet that kubeadm will start if a custom `KubeletConfiguration`
the `.kubeletConfiguration.baseConfig` key. Any user writing a `MasterConfiguration` API object is passed with a configuration file like so `kubeadm ... --config some-config-file.yaml`.
file can use this configuration key to also set the base-level configuration for all kubelets
in the cluster. 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/config#KubeletConfiguration)
for more information on the individual fields.
### Workflow when using `kubeadm init` ### 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 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 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 initializing. A kubelet configuration file is also written to `/etc/kubernetes/kubelet.conf` with the
@@ -83,8 +83,8 @@ this example.
HOST=${ETCDHOSTS[$i]} HOST=${ETCDHOSTS[$i]}
NAME=${NAMES[$i]} NAME=${NAMES[$i]}
cat << EOF > /tmp/${HOST}/kubeadmcfg.yaml cat << EOF > /tmp/${HOST}/kubeadmcfg.yaml
apiVersion: "kubeadm.k8s.io/v1alpha2" apiVersion: "kubeadm.k8s.io/v1alpha3"
kind: MasterConfiguration kind: ClusterConfiguration
etcd: etcd:
local: local:
serverCertSANs: serverCertSANs:
@@ -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 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/release-1.12/cmd/kubeadm/app/apis/kubeadm/v1alpha3/types.go#L163-L166) can be used for this.
Then restart `kubelet`: Then restart `kubelet`: