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