@@ -40,9 +40,11 @@ type InitConfiguration struct {
40
40
41
41
// BootstrapTokens is respected at `kubeadm init` time and describes a set of Bootstrap Tokens to create.
42
42
// This information IS NOT uploaded to the kubeadm cluster configmap, partly because of its sensitive nature
43
+ // +optional
43
44
BootstrapTokens []BootstrapToken `json:"bootstrapTokens,omitempty"`
44
45
45
46
// NodeRegistration holds fields that relate to registering the new control-plane node to the cluster
47
+ // +optional
46
48
NodeRegistration NodeRegistrationOptions `json:"nodeRegistration,omitempty"`
47
49
48
50
// LocalAPIEndpoint represents the endpoint of the API server instance that's deployed on this control plane node
@@ -51,6 +53,7 @@ type InitConfiguration struct {
51
53
// configuration object lets you customize what IP/DNS name and port the local API server advertises it's accessible
52
54
// on. By default, kubeadm tries to auto-detect the IP of the default interface and use that, but in case that process
53
55
// fails you may set the desired value here.
56
+ // +optional
54
57
LocalAPIEndpoint APIEndpoint `json:"localAPIEndpoint,omitempty"`
55
58
}
56
59
@@ -61,18 +64,19 @@ type ClusterConfiguration struct {
61
64
metav1.TypeMeta `json:",inline"`
62
65
63
66
// Etcd holds configuration for etcd.
67
+ // NB: This value defaults to a Local (stacked) etcd
64
68
// +optional
65
- Etcd Etcd `json:"etcd"`
69
+ Etcd Etcd `json:"etcd,omitempty "`
66
70
67
71
// Networking holds configuration for the networking topology of the cluster.
68
72
// NB: This value defaults to the Cluster object spec.clusterNetwork.
69
73
// +optional
70
- Networking Networking `json:"networking"`
74
+ Networking Networking `json:"networking,omitempty "`
71
75
72
76
// KubernetesVersion is the target version of the control plane.
73
77
// NB: This value defaults to the Machine object spec.kuberentesVersion
74
78
// +optional
75
- KubernetesVersion string `json:"kubernetesVersion"`
79
+ KubernetesVersion string `json:"kubernetesVersion,omitempty "`
76
80
77
81
// ControlPlaneEndpoint sets a stable IP address or DNS name for the control plane; it
78
82
// can be a valid IP address or a RFC-1123 DNS subdomain, both with optional TCP port.
@@ -87,36 +91,42 @@ type ClusterConfiguration struct {
87
91
// could be used for assigning a stable DNS to the control plane.
88
92
// NB: This value defaults to the first value in the Cluster object status.apiEndpoints array.
89
93
// +optional
90
- ControlPlaneEndpoint string `json:"controlPlaneEndpoint"`
94
+ ControlPlaneEndpoint string `json:"controlPlaneEndpoint,omitempty "`
91
95
92
96
// APIServer contains extra settings for the API server control plane component
97
+ // +optional
93
98
APIServer APIServer `json:"apiServer,omitempty"`
94
99
95
100
// ControllerManager contains extra settings for the controller manager control plane component
101
+ // +optional
96
102
ControllerManager ControlPlaneComponent `json:"controllerManager,omitempty"`
97
103
98
104
// Scheduler contains extra settings for the scheduler control plane component
105
+ // +optional
99
106
Scheduler ControlPlaneComponent `json:"scheduler,omitempty"`
100
107
101
108
// DNS defines the options for the DNS add-on installed in the cluster.
102
109
// +optional
103
- DNS DNS `json:"dns"`
110
+ DNS DNS `json:"dns,omitempty "`
104
111
105
112
// CertificatesDir specifies where to store or look for all required certificates.
113
+ // NB: if not provided, this will default to `/etc/kubernetes/pki`
106
114
// +optional
107
- CertificatesDir string `json:"certificatesDir"`
115
+ CertificatesDir string `json:"certificatesDir,omitempty "`
108
116
109
117
// ImageRepository sets the container registry to pull images from.
110
118
// If empty, `k8s.gcr.io` will be used by default; in case of kubernetes version is a CI build (kubernetes version starts with `ci/` or `ci-cross/`)
111
119
// `gcr.io/kubernetes-ci-images` will be used as a default for control plane components and for kube-proxy, while `k8s.gcr.io`
112
120
// will be used for all the other images.
113
121
// +optional
114
- ImageRepository string `json:"imageRepository"`
122
+ ImageRepository string `json:"imageRepository,omitempty "`
115
123
116
124
// UseHyperKubeImage controls if hyperkube should be used for Kubernetes components instead of their respective separate images
125
+ // +optional
117
126
UseHyperKubeImage bool `json:"useHyperKubeImage,omitempty"`
118
127
119
128
// FeatureGates enabled by the user.
129
+ // +optional
120
130
FeatureGates map [string ]bool `json:"featureGates,omitempty"`
121
131
122
132
// The cluster name
@@ -160,7 +170,8 @@ const (
160
170
// DNS defines the DNS addon that should be used in the cluster
161
171
type DNS struct {
162
172
// Type defines the DNS add-on to be used
163
- Type DNSAddOnType `json:"type"`
173
+ // +optional
174
+ Type DNSAddOnType `json:"type,omitempty"`
164
175
165
176
// ImageMeta allows to customize the image used for the DNS component
166
177
ImageMeta `json:",inline"`
@@ -208,29 +219,38 @@ type NodeRegistrationOptions struct {
208
219
// Name is the `.Metadata.Name` field of the Node API object that will be created in this `kubeadm init` or `kubeadm join` operation.
209
220
// This field is also used in the CommonName field of the kubelet's client certificate to the API server.
210
221
// Defaults to the hostname of the node if not provided.
222
+ // +optional
211
223
Name string `json:"name,omitempty"`
212
224
213
225
// CRISocket is used to retrieve container runtime info. This information will be annotated to the Node API object, for later re-use
226
+ // +optional
214
227
CRISocket string `json:"criSocket,omitempty"`
215
228
216
229
// Taints specifies the taints the Node API object should be registered with. If this field is unset, i.e. nil, in the `kubeadm init` process
217
230
// it will be defaulted to []v1.Taint{'node-role.kubernetes.io/master=""'}. If you don't want to taint your control-plane node, set this field to an
218
231
// empty slice, i.e. `taints: {}` in the YAML file. This field is solely used for Node registration.
232
+ // +optional
219
233
Taints []v1.Taint `json:"taints,omitempty"`
220
234
221
235
// KubeletExtraArgs passes through extra arguments to the kubelet. The arguments here are passed to the kubelet command line via the environment file
222
236
// kubeadm writes at runtime for the kubelet to source. This overrides the generic base-level configuration in the kubelet-config-1.X ConfigMap
223
237
// Flags have higher priority when parsing. These values are local and specific to the node kubeadm is executing on.
238
+ // +optional
224
239
KubeletExtraArgs map [string ]string `json:"kubeletExtraArgs,omitempty"`
225
240
}
226
241
227
242
// Networking contains elements describing cluster's networking configuration
228
243
type Networking struct {
229
- // ServiceSubnet is the subnet used by k8s services. Defaults to "10.96.0.0/12".
244
+ // ServiceSubnet is the subnet used by k8s services.
245
+ // Defaults to the first element of the Cluster object's spec.clusterNetwork.pods.cidrBlocks field, or
246
+ // to "10.96.0.0/12" if that's unset.
230
247
// +optional
231
248
ServiceSubnet string `json:"serviceSubnet,omitempty"`
232
249
// PodSubnet is the subnet used by pods.
233
- PodSubnet string `json:"podSubnet"`
250
+ // If unset, the API server will not allocate CIDR ranges for every node.
251
+ // Defaults to the first element of the Cluster object's spec.clusterNetwork.services.cidrBlocks if that is set
252
+ // +optional
253
+ PodSubnet string `json:"podSubnet,omitempty"`
234
254
// DNSDomain is the dns domain used by k8s services. Defaults to "cluster.local".
235
255
// +optional
236
256
DNSDomain string `json:"dnsDomain,omitempty"`
@@ -277,7 +297,8 @@ type LocalEtcd struct {
277
297
278
298
// DataDir is the directory etcd will place its data.
279
299
// Defaults to "/var/lib/etcd".
280
- DataDir string `json:"dataDir"`
300
+ // +optional
301
+ DataDir string `json:"dataDir,omitempty"`
281
302
282
303
// ExtraArgs are extra arguments provided to the etcd binary
283
304
// when run inside a static pod.
@@ -315,7 +336,8 @@ type JoinConfiguration struct {
315
336
metav1.TypeMeta `json:",inline"`
316
337
317
338
// NodeRegistration holds fields that relate to registering the new control-plane node to the cluster
318
- NodeRegistration NodeRegistrationOptions `json:"nodeRegistration"`
339
+ // +optional
340
+ NodeRegistration NodeRegistrationOptions `json:"nodeRegistration,omitempty"`
319
341
320
342
// CACertPath is the path to the SSL certificate authority used to
321
343
// secure comunications between node and control-plane.
@@ -331,6 +353,7 @@ type JoinConfiguration struct {
331
353
332
354
// ControlPlane defines the additional control plane instance to be deployed on the joining node.
333
355
// If nil, no additional control plane instance will be deployed.
356
+ // +optional
334
357
ControlPlane * JoinControlPlane `json:"controlPlane,omitempty"`
335
358
}
336
359
0 commit comments