@@ -72,6 +72,8 @@ Any commands under `kubeadm alpha` are, by definition, supported on an alpha lev
72
72
73
73
### Preparing the hosts
74
74
75
+ #### Component installation
76
+
75
77
Install a {{< glossary_tooltip term_id="container-runtime" text="container runtime" >}} and kubeadm on all the hosts.
76
78
For detailed instructions and other prerequisites, see [ Installing kubeadm] ( /docs/setup/production-environment/tools/kubeadm/install-kubeadm/ ) .
77
79
@@ -84,6 +86,61 @@ kubeadm to tell it what to do. This crashloop is expected and normal.
84
86
After you initialize your control-plane, the kubelet runs normally.
85
87
{{< /note >}}
86
88
89
+ #### Network setup
90
+
91
+ kubeadm similarly to other Kubernetes components tries to find a usable IP on
92
+ the network interface associated with the default gateway on a host. Such
93
+ an IP is then used for the advertising and/or listening performed by a component.
94
+
95
+ To find out what this IP is on a Linux host you can use:
96
+
97
+ ``` shell
98
+ ip route show # Look for a line starting with "default via"
99
+ ```
100
+
101
+ Kubernetes components do not accept custom network interface as an option,
102
+ therefore a custom IP address must be passed as a flag to all components instances
103
+ that need such a custom configuration.
104
+
105
+ To configure the API server advertise address for control plane nodes created with both
106
+ ` init ` and ` join ` , the flag ` --apiserver-advertise-address ` can be used.
107
+ Preferably, this option can be set in the [ kubeadm API] ( /docs/reference/config-api/kubeadm-config.v1beta3 )
108
+ as ` InitConfiguration.localAPIEndpoint ` and ` JoinConfiguration.controlPlane.localAPIEndpoint ` .
109
+
110
+ For kubelets on all nodes, the ` --node-ip ` option can be passed in
111
+ ` .nodeRegistration.kubeletExtraArgs ` inside a kubeadm configuration file
112
+ (` InitConfiguration ` or ` JoinConfiguration ` ).
113
+
114
+ For dual-stack see
115
+ [ Dual-stack support with kubeadm] ( /docs/setup/production-environment/tools/kubeadm/dual-stack-support ) .
116
+
117
+ {{< note >}}
118
+ IP addresses become part of certificates SAN fields. Changing these IP addresses would require
119
+ signing new certificates and restarting the affected components, so that the change in
120
+ certificate files is reflected. See
121
+ [ Manual certificate renewal] ( /docs/tasks/administer-cluster/kubeadm/kubeadm-certs/#manual-certificate-renewal )
122
+ for more details on this topic.
123
+ {{</ note >}}
124
+
125
+ {{< warning >}}
126
+ The Kubernetes project recommends against this approach (configuring all component instances
127
+ with custom IP addresses). Instead, the Kubernetes maintainers recommend to setup the host network,
128
+ so that the default gateway IP is the one that Kubernetes components auto-detect and use.
129
+ On Linux nodes, you can use commands such as ` ip route ` to configure networking; your operating
130
+ system might also provide higher level network management tools. If your node's default gateway
131
+ is a public IP address, you should configure packet filtering or other security measures that
132
+ protect the nodes and your cluster.
133
+ {{< /warning >}}
134
+
135
+ {{< note >}}
136
+ If the host does not have a default gateway, it is recommended to setup one. Otherwise,
137
+ without passing a custom IP address to a Kubernetes component, the component
138
+ will exit with an error. If two or more default gateways are present on the host,
139
+ a Kubernetes component will try to use the first one it encounters that has a suitable
140
+ global unicast IP address. While making this choice, the exact ordering of gateways
141
+ might vary between different operating systems and kernel versions.
142
+ {{< /note >}}
143
+
87
144
### Preparing the required container images
88
145
89
146
This step is optional and only applies in case you wish ` kubeadm init ` and ` kubeadm join `
@@ -117,11 +174,6 @@ a provider-specific value. See [Installing a Pod network add-on](#pod-network).
117
174
known endpoints. To use different container runtime or if there are more than one installed
118
175
on the provisioned node, specify the ` --cri-socket ` argument to ` kubeadm ` . See
119
176
[ Installing a runtime] ( /docs/setup/production-environment/tools/kubeadm/install-kubeadm/#installing-runtime ) .
120
- 1 . (Optional) Unless otherwise specified, ` kubeadm ` uses the network interface associated
121
- with the default gateway to set the advertise address for this particular control-plane node's API server.
122
- To use a different network interface, specify the ` --apiserver-advertise-address=<ip-address> ` argument
123
- to ` kubeadm init ` . To deploy an IPv6 Kubernetes cluster using IPv6 addressing, you
124
- must specify an IPv6 address, for example ` --apiserver-advertise-address=2001:db8::101 `
125
177
126
178
To initialize the control-plane node run:
127
179
0 commit comments