sigs.k8s.io/cluster-api/bootstrap/kubeadm@v0.0.0-20191016155141-23a891785b60/kubeadm/v1beta2/doc.go (about) 1 /* 2 Copyright 2019 The Kubernetes Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 // +k8s:defaulter-gen=TypeMeta 18 // +groupName=kubeadm.k8s.io 19 // +k8s:deepcopy-gen=package 20 // +k8s:conversion-gen=k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm 21 22 // Package v1beta2 defines the v1beta2 version of the kubeadm configuration file format. 23 // This version improves on the v1beta1 format by fixing some minor issues and adding a few new fields. 24 // 25 // A list of changes since v1beta1: 26 // - "certificateKey" field is added to InitConfiguration and JoinConfiguration. 27 // - "ignorePreflightErrors" field is added to the NodeRegistrationOptions. 28 // - The JSON "omitempty" tag is used in a more places where appropriate. 29 // - The JSON "omitempty" tag of the "taints" field (inside NodeRegistrationOptions) is removed. 30 // See the Kubernetes 1.15 changelog for further details. 31 // 32 // Migration from old kubeadm config versions 33 // 34 // Please convert your v1beta1 configuration files to v1beta2 using the "kubeadm config migrate" command of kubeadm v1.15.x 35 // (conversion from older releases of kubeadm config files requires older release of kubeadm as well e.g. 36 // kubeadm v1.11 should be used to migrate v1alpha2 to v1alpha2; kubeadm v1.12 should be used to translate v1alpha2 to v1alpha3; 37 // kubeadm v1.13 or v1.14 should be used to translate v1alpha3 to v1beta1) 38 // 39 // Nevertheless, kubeadm v1.15.x will support reading from v1beta1 version of the kubeadm config file format. 40 // 41 // Basics 42 // 43 // The preferred way to configure kubeadm is to pass an YAML configuration file with the --config option. Some of the 44 // configuration options defined in the kubeadm config file are also available as command line flags, but only 45 // the most common/simple use case are supported with this approach. 46 // 47 // A kubeadm config file could contain multiple configuration types separated using three dashes (“---”). 48 // 49 // kubeadm supports the following configuration types: 50 // 51 // apiVersion: kubeadm.k8s.io/v1beta2 52 // kind: InitConfiguration 53 // 54 // apiVersion: kubeadm.k8s.io/v1beta2 55 // kind: ClusterConfiguration 56 // 57 // apiVersion: kubelet.config.k8s.io/v1beta1 58 // kind: KubeletConfiguration 59 // 60 // apiVersion: kubeproxy.config.k8s.io/v1alpha2 61 // kind: KubeProxyConfiguration 62 // 63 // apiVersion: kubeadm.k8s.io/v1beta2 64 // kind: JoinConfiguration 65 // 66 // To print the defaults for "init" and "join" actions use the following commands: 67 // kubeadm config print init-defaults 68 // kubeadm config print join-defaults 69 // 70 // The list of configuration types that must be included in a configuration file depends by the action you are 71 // performing (init or join) and by the configuration options you are going to use (defaults or advanced customization). 72 // 73 // If some configuration types are not provided, or provided only partially, kubeadm will use default values; defaults 74 // provided by kubeadm includes also enforcing consistency of values across components when required (e.g. 75 // cluster-cidr flag on controller manager and clusterCIDR on kube-proxy). 76 // 77 // Users are always allowed to override default values, with the only exception of a small subset of setting with 78 // relevance for security (e.g. enforce authorization-mode Node and RBAC on api server) 79 // 80 // If the user provides a configuration types that is not expected for the action you are performing, kubeadm will 81 // ignore those types and print a warning. 82 // 83 // Kubeadm init configuration types 84 // 85 // When executing kubeadm init with the --config option, the following configuration types could be used: 86 // InitConfiguration, ClusterConfiguration, KubeProxyConfiguration, KubeletConfiguration, but only one 87 // between InitConfiguration and ClusterConfiguration is mandatory. 88 // 89 // apiVersion: kubeadm.k8s.io/v1beta2 90 // kind: InitConfiguration 91 // bootstrapTokens: 92 // ... 93 // nodeRegistration: 94 // ... 95 // 96 // The InitConfiguration type should be used to configure runtime settings, that in case of kubeadm init 97 // are the configuration of the bootstrap token and all the setting which are specific to the node where kubeadm 98 // is executed, including: 99 // 100 // - NodeRegistration, that holds fields that relate to registering the new node to the cluster; 101 // use it to customize the node name, the CRI socket to use or any other settings that should apply to this 102 // node only (e.g. the node ip). 103 // 104 // - LocalAPIEndpoint, that represents the endpoint of the instance of the API server to be deployed on this node; 105 // use it e.g. to customize the API server advertise address. 106 // 107 // apiVersion: kubeadm.k8s.io/v1beta2 108 // kind: ClusterConfiguration 109 // networking: 110 // ... 111 // etcd: 112 // ... 113 // apiServer: 114 // extraArgs: 115 // ... 116 // extraVolumes: 117 // ... 118 // ... 119 // 120 // The ClusterConfiguration type should be used to configure cluster-wide settings, 121 // including settings for: 122 // 123 // - Networking, that holds configuration for the networking topology of the cluster; use it e.g. to customize 124 // node subnet or services subnet. 125 // 126 // - Etcd configurations; use it e.g. to customize the local etcd or to configure the API server 127 // for using an external etcd cluster. 128 // 129 // - kube-apiserver, kube-scheduler, kube-controller-manager configurations; use it to customize control-plane 130 // components by adding customized setting or overriding kubeadm default settings. 131 // 132 // apiVersion: kubeproxy.config.k8s.io/v1alpha2 133 // kind: KubeProxyConfiguration 134 // ... 135 // 136 // The KubeProxyConfiguration type should be used to change the configuration passed to kube-proxy instances deployed 137 // in the cluster. If this object is not provided or provided only partially, kubeadm applies defaults. 138 // 139 // See https://kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/ or https://godoc.org/k8s.io/kube-proxy/config/v1alpha1#KubeProxyConfiguration 140 // for kube proxy official documentation. 141 // 142 // apiVersion: kubelet.config.k8s.io/v1beta1 143 // kind: KubeletConfiguration 144 // ... 145 // 146 // The KubeletConfiguration type should be used to change the configurations that will be passed to all kubelet instances 147 // deployed in the cluster. If this object is not provided or provided only partially, kubeadm applies defaults. 148 // 149 // See https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/ or https://godoc.org/k8s.io/kubelet/config/v1beta1#KubeletConfiguration 150 // for kubelet official documentation. 151 // 152 // Here is a fully populated example of a single YAML file containing multiple 153 // configuration types to be used during a `kubeadm init` run. 154 // 155 // apiVersion: kubeadm.k8s.io/v1beta2 156 // kind: InitConfiguration 157 // bootstrapTokens: 158 // - token: "9a08jv.c0izixklcxtmnze7" 159 // description: "kubeadm bootstrap token" 160 // ttl: "24h" 161 // - token: "783bde.3f89s0fje9f38fhf" 162 // description: "another bootstrap token" 163 // usages: 164 // - authentication 165 // - signing 166 // groups: 167 // - system:bootstrappers:kubeadm:default-node-token 168 // nodeRegistration: 169 // name: "ec2-10-100-0-1" 170 // criSocket: "/var/run/dockershim.sock" 171 // taints: 172 // - key: "kubeadmNode" 173 // value: "master" 174 // effect: "NoSchedule" 175 // kubeletExtraArgs: 176 // cgroupDriver: "cgroupfs" 177 // ignorePreflightErrors: 178 // - IsPrivilegedUser 179 // localAPIEndpoint: 180 // advertiseAddress: "10.100.0.1" 181 // bindPort: 6443 182 // certificateKey: "e6a2eb8581237ab72a4f494f30285ec12a9694d750b9785706a83bfcbbbd2204" 183 // --- 184 // apiVersion: kubeadm.k8s.io/v1beta2 185 // kind: ClusterConfiguration 186 // etcd: 187 // # one of local or external 188 // local: 189 // imageRepository: "k8s.gcr.io" 190 // imageTag: "3.2.24" 191 // dataDir: "/var/lib/etcd" 192 // extraArgs: 193 // listen-client-urls: "http://10.100.0.1:2379" 194 // serverCertSANs: 195 // - "ec2-10-100-0-1.compute-1.amazonaws.com" 196 // peerCertSANs: 197 // - "10.100.0.1" 198 // # external: 199 // # endpoints: 200 // # - "10.100.0.1:2379" 201 // # - "10.100.0.2:2379" 202 // # caFile: "/etcd/kubernetes/pki/etcd/etcd-ca.crt" 203 // # certFile: "/etcd/kubernetes/pki/etcd/etcd.crt" 204 // # keyFile: "/etcd/kubernetes/pki/etcd/etcd.key" 205 // networking: 206 // serviceSubnet: "10.96.0.0/12" 207 // podSubnet: "10.100.0.1/24" 208 // dnsDomain: "cluster.local" 209 // kubernetesVersion: "v1.12.0" 210 // controlPlaneEndpoint: "10.100.0.1:6443" 211 // apiServer: 212 // extraArgs: 213 // authorization-mode: "Node,RBAC" 214 // extraVolumes: 215 // - name: "some-volume" 216 // hostPath: "/etc/some-path" 217 // mountPath: "/etc/some-pod-path" 218 // readOnly: false 219 // pathType: File 220 // certSANs: 221 // - "10.100.1.1" 222 // - "ec2-10-100-0-1.compute-1.amazonaws.com" 223 // timeoutForControlPlane: 4m0s 224 // controllerManager: 225 // extraArgs: 226 // "node-cidr-mask-size": "20" 227 // extraVolumes: 228 // - name: "some-volume" 229 // hostPath: "/etc/some-path" 230 // mountPath: "/etc/some-pod-path" 231 // readOnly: false 232 // pathType: File 233 // scheduler: 234 // extraArgs: 235 // address: "10.100.0.1" 236 // extraVolumes: 237 // - name: "some-volume" 238 // hostPath: "/etc/some-path" 239 // mountPath: "/etc/some-pod-path" 240 // readOnly: false 241 // pathType: File 242 // certificatesDir: "/etc/kubernetes/pki" 243 // imageRepository: "k8s.gcr.io" 244 // useHyperKubeImage: false 245 // clusterName: "example-cluster" 246 // --- 247 // apiVersion: kubelet.config.k8s.io/v1beta1 248 // kind: KubeletConfiguration 249 // # kubelet specific options here 250 // --- 251 // apiVersion: kubeproxy.config.k8s.io/v1alpha2 252 // kind: KubeProxyConfiguration 253 // # kube-proxy specific options here 254 // 255 // Kubeadm join configuration types 256 // 257 // When executing kubeadm join with the --config option, the JoinConfiguration type should be provided. 258 // 259 // apiVersion: kubeadm.k8s.io/v1beta2 260 // kind: JoinConfiguration 261 // ... 262 // 263 // The JoinConfiguration type should be used to configure runtime settings, that in case of kubeadm join 264 // are the discovery method used for accessing the cluster info and all the setting which are specific 265 // to the node where kubeadm is executed, including: 266 // 267 // - NodeRegistration, that holds fields that relate to registering the new node to the cluster; 268 // use it to customize the node name, the CRI socket to use or any other settings that should apply to this 269 // node only (e.g. the node ip). 270 // 271 // - APIEndpoint, that represents the endpoint of the instance of the API server to be eventually deployed on this node. 272 // 273 package v1beta2 // import "sigs.k8s.io/cluster-api/bootstrap/kubeadm/kubeadm/v1beta2" 274 275 //TODO: The BootstrapTokenString object should move out to either k8s.io/client-go or k8s.io/api in the future 276 //(probably as part of Bootstrap Tokens going GA). It should not be staged under the kubeadm API as it is now.