Skip to content

Commit e65201a

Browse files
committed
Merge remote-tracking branch 'upstream/main' into dev-1.24
2 parents ca37379 + 80e2e7d commit e65201a

File tree

34 files changed

+1267
-1684
lines changed

34 files changed

+1267
-1684
lines changed

content/en/docs/concepts/cluster-administration/addons.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ This page lists some of the available add-ons and links to their respective inst
2929
* [OVN4NFV-K8S-Plugin](https://github.com/opnfv/ovn4nfv-k8s-plugin) is OVN based CNI controller plugin to provide cloud native based Service function chaining(SFC), Multiple OVN overlay networking, dynamic subnet creation, dynamic creation of virtual networks, VLAN Provider network, Direct provider network and pluggable with other Multi-network plugins, ideal for edge based cloud native workloads in Multi-cluster networking
3030
* [NSX-T](https://docs.vmware.com/en/VMware-NSX-T/2.0/nsxt_20_ncp_kubernetes.pdf) Container Plug-in (NCP) provides integration between VMware NSX-T and container orchestrators such as Kubernetes, as well as integration between NSX-T and container-based CaaS/PaaS platforms such as Pivotal Container Service (PKS) and OpenShift.
3131
* [Nuage](https://github.com/nuagenetworks/nuage-kubernetes/blob/v5.1.1-1/docs/kubernetes-1-installation.rst) is an SDN platform that provides policy-based networking between Kubernetes Pods and non-Kubernetes environments with visibility and security monitoring.
32-
* [Romana](https://romana.io) is a Layer 3 networking solution for pod networks that also supports the [NetworkPolicy API](/docs/concepts/services-networking/network-policies/). Kubeadm add-on installation details available [here](https://github.com/romana/romana/tree/master/containerize).
32+
* **Romana** is a Layer 3 networking solution for pod networks that also supports the [NetworkPolicy API](/docs/concepts/services-networking/network-policies/). Kubeadm add-on installation details available [here](https://github.com/romana/romana/tree/master/containerize).
3333
* [Weave Net](https://www.weave.works/docs/net/latest/kubernetes/kube-addon/) provides networking and network policy, will carry on working on both sides of a network partition, and does not require an external database.
3434

3535
## Service Discovery

content/en/docs/contribute/generate-ref-docs/contribute-upstream.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ API or the `kube-*` components from the upstream code, see the following instruc
2727
- [Golang](https://golang.org/doc/install) version 1.13+
2828
- [Docker](https://docs.docker.com/engine/installation/)
2929
- [etcd](https://github.com/coreos/etcd/)
30+
- [make](https://www.gnu.org/software/make/)
31+
- [gcc compiler/linker](https://gcc.gnu.org/)
3032

3133
- Your `GOPATH` environment variable must be set, and the location of `etcd`
3234
must be in your `PATH` environment variable.
@@ -142,8 +144,9 @@ Run `git status` to see what was generated.
142144
On branch master
143145
...
144146
modified: api/openapi-spec/swagger.json
147+
modified: api/openapi-spec/v3/apis__apps__v1_openapi.json
148+
modified: pkg/generated/openapi/zz_generated.openapi.go
145149
modified: staging/src/k8s.io/api/apps/v1/generated.proto
146-
modified: staging/src/k8s.io/api/apps/v1/types.go
147150
modified: staging/src/k8s.io/api/apps/v1/types_swagger_doc_generated.go
148151
```
149152

content/en/docs/reference/access-authn-authz/admission-controllers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ This admission controller will deny any Pod that attempts to set certain escalat
778778
fields, as shown in the
779779
[Configure a Security Context for a Pod or Container](/docs/tasks/configure-pod-container/security-context/)
780780
task.
781-
If you don't use [Pod Security admission]((/docs/concepts/security/pod-security-admission/),
781+
If you don't use [Pod Security admission](/docs/concepts/security/pod-security-admission/),
782782
[PodSecurityPolicies](/docs/concepts/security/pod-security-policy/), nor any external enforcement mechanism,
783783
then you could use this admission controller to restrict the set of values a security context can take.
784784

content/en/docs/reference/kubernetes-api/service-resources/ingress-v1.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,16 @@ IngressSpec describes the Ingress the user wishes to exist.
109109

110110
- **rules.http.paths.pathType** (string), required
111111

112-
PathType determines the interpretation of the Path matching. PathType can be one of the following values: * Exact: Matches the URL path exactly. * Prefix: Matches based on a URL path prefix split by '/'. Matching is
112+
PathType determines the interpretation of the Path matching. PathType can be one of the following enum values:
113+
- `"Exact"` Matches the URL path exactly.
114+
- `"Prefix"` Matches based on a URL path prefix split by '/'. Matching is
113115
done on a path element by element basis. A path element refers is the
114116
list of labels in the path split by the '/' separator. A request is a
115117
match for path p if every p is an element-wise prefix of p of the
116118
request path. Note that if the last element of the path is a substring
117119
of the last element in request path, it is not a match (e.g. /foo/bar
118120
matches /foo/bar/baz, but does not match /foo/barbaz).
119-
* ImplementationSpecific: Interpretation of the Path matching is up to
121+
- `"ImplementationSpecific"` Interpretation of the Path matching is up to
120122
the IngressClass. Implementations can treat this as a separate PathType
121123
or treat it identically to Prefix or Exact path types.
122124
Implementations are required to support all path types.

content/en/docs/setup/best-practices/certificates.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Kubernetes requires PKI for the following operations:
2323

2424
* Client certificates for the kubelet to authenticate to the API server
2525
* Kubelet [server certificates](/docs/reference/command-line-tools-reference/kubelet-tls-bootstrapping/#client-and-serving-certificates)
26-
for the the API server to talk to the kubelets
26+
for the API server to talk to the kubelets
2727
* Server certificate for the API server endpoint
2828
* Client certificates for administrators of the cluster to authenticate to the API server
2929
* Client certificates for the API server to talk to the kubelets
@@ -91,7 +91,7 @@ Required certificates:
9191
the load balancer stable IP and/or DNS name, `kubernetes`, `kubernetes.default`, `kubernetes.default.svc`,
9292
`kubernetes.default.svc.cluster`, `kubernetes.default.svc.cluster.local`)
9393

94-
where `kind` maps to one or more of the [x509 key usage](https://godoc.org/k8s.io/api/certificates/v1beta1#KeyUsage) types:
94+
where `kind` maps to one or more of the [x509 key usage](https://pkg.go.dev/k8s.io/api/certificates/v1beta1#KeyUsage) types:
9595

9696
| kind | Key usage |
9797
|--------|---------------------------------------------------------------------------------|

content/en/docs/setup/production-environment/tools/kubeadm/control-plane-flags.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ you can skip the default CoreDNS deployment and deploy your own variant.
2424
For more details on that see [Using init phases with kubeadm](/docs/reference/setup-tools/kubeadm/kubeadm-init/#init-phases).
2525
{{< /note >}}
2626

27-
<!-- body -->
27+
{{< note >}}
28+
To reconfigure a cluster that has already been created see
29+
[Reconfiguring a kubeadm cluster](/docs/tasks/administer-cluster/kubeadm/kubeadm-reconfigure).
30+
{{< /note >}}
2831

29-
{{< feature-state for_k8s_version="v1.12" state="stable" >}}
32+
<!-- body -->
3033

3134
## Customizing the control plane with flags in `ClusterConfiguration`
3235

content/en/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ To customize control plane components, including optional IPv6 assignment to liv
161161
for control plane components and etcd server, provide extra arguments to each component as documented in
162162
[custom arguments](/docs/setup/production-environment/tools/kubeadm/control-plane-flags/).
163163

164+
To reconfigure a cluster that has already been created see
165+
[Reconfiguring a kubeadm cluster](/docs/tasks/administer-cluster/kubeadm/kubeadm-reconfigure).
166+
164167
To run `kubeadm init` again, you must first [tear down the cluster](#tear-down).
165168

166169
If you join a node with a different architecture to your cluster, make sure that your deployed DaemonSets

content/en/docs/tasks/administer-cluster/kubeadm/kubeadm-certs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ The built-in signer is part of [`kube-controller-manager`](/docs/reference/comma
173173

174174
To activate the built-in signer, you must pass the `--cluster-signing-cert-file` and `--cluster-signing-key-file` flags.
175175

176-
If you're creating a new cluster, you can use a kubeadm [configuration file](https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta3):
176+
If you're creating a new cluster, you can use a kubeadm [configuration file](https://pkg.go.dev/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta3):
177177

178178
```yaml
179179
apiVersion: kubeadm.k8s.io/v1beta3
Lines changed: 281 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,281 @@
1+
---
2+
reviewers:
3+
- sig-cluster-lifecycle
4+
title: Reconfiguring a kubeadm cluster
5+
content_type: task
6+
weight: 10
7+
---
8+
9+
<!-- overview -->
10+
11+
kubeadm does not support automated ways of reconfiguring components that
12+
were deployed on managed nodes. One way of automating this would be
13+
by using a custom [operator](/docs/concepts/extend-kubernetes/operator/).
14+
15+
To modify the components configuration you must manually edit associated cluster
16+
objects and files on disk.
17+
18+
This guide shows the correct sequence of steps that need to be performed
19+
to achieve kubeadm cluster reconfiguration.
20+
21+
## {{% heading "prerequisites" %}}
22+
23+
- You need a cluster that was deployed using kubeadm
24+
- Have administrator credentials (`/etc/kubernetes/admin.conf`) and network connectivity
25+
to a running kube-apiserver in the cluster from a host that has kubectl installed
26+
- Have a text editor installed on all hosts
27+
28+
<!-- steps -->
29+
30+
## Reconfiguring the cluster
31+
32+
kubeadm writes a set of cluster wide component configuration options in
33+
ConfigMaps and other objects. These objects must be manually edited. The command `kubectl edit`
34+
can be used for that.
35+
36+
The `kubectl edit` command will open a text editor where you can edit and save the object directly.
37+
38+
You can use the environment variables `KUBECONFIG` and `KUBE_EDITOR` to specify the location of
39+
the kubectl consumed kubeconfig file and preferred text editor.
40+
41+
For example:
42+
```
43+
KUBECONFIG=/etc/kubernetes/admin.conf KUBE_EDITOR=nano kubectl edit <parameters>
44+
```
45+
46+
{{< note >}}
47+
Upon saving any changes to these cluster objects, components running on nodes may not be
48+
automatically updated. The steps below instruct you on how to perform that manually.
49+
{{< /note >}}
50+
51+
{{< warning >}}
52+
Component configuration in ConfigMaps is stored as unstructured data (YAML string).
53+
This means that validation will not be performed upon updating the contents of a ConfigMap.
54+
You have to be careful to follow the documented API format for a particular
55+
component configuration and avoid introducing typos and YAML indentation mistakes.
56+
{{< /warning >}}
57+
58+
### Applying cluster configuration changes
59+
60+
#### Updating the `ClusterConfiguration`
61+
62+
During cluster creation and upgrade, kubeadm writes its
63+
[`ClusterConfiguration`](/docs/reference/config-api/kubeadm-config.v1beta3/)
64+
in a ConfigMap called `kubeadm-config` in the `kube-system` namespace.
65+
66+
To change a particular option in the `ClusterConfiguration` you can edit the ConfigMap with this command:
67+
68+
```shell
69+
kubectl edit cm -n kube-system kubeadm-config
70+
```
71+
72+
The configuration is located under the `data.ClusterConfiguration` key.
73+
74+
{{< note >}}
75+
The `ClusterConfiguration` includes a variety of options that affect the configuration of individual
76+
components such as kube-apiserver, kube-scheduler, kube-controller-manager, CoreDNS, etcd and kube-proxy.
77+
Changes to the configuration must be reflected on node components manually.
78+
{{< /note >}}
79+
80+
#### Reflecting `ClusterConfiguration` changes on control plane nodes
81+
82+
kubeadm manages the control plane components as static Pod manifests located in
83+
the directory `/etc/kubernetes/manifests`.
84+
Any changes to the `ClusterConfiguration` under the `apiServer`, `controllerManager`, `scheduler` or `etcd`
85+
keys must be reflected in the associated files in the manifests directory on a control plane node.
86+
87+
Such changes may include:
88+
- `extraArgs` - requires updating the list of flags passed to a component container
89+
- `extraMounts` - requires updated the volume mounts for a component container
90+
- `*SANs` - requires writing new certificates with updated Subject Alternative Names.
91+
92+
Before proceeding with these changes, make sure you have backed up the directory `/etc/kubernetes/`.
93+
94+
To write new certificates you can use:
95+
```shell
96+
kubeadm init phase certs <component-name> --config <config-file>
97+
```
98+
99+
To write new manifest files in `/etc/kubernetes/manifests` you can use:
100+
101+
```shell
102+
kubeadm init phase control-plane <component-name> --config <config-file>
103+
```
104+
105+
The `<config-file>` contents must match the updated `ClusterConfiguration`.
106+
The `<component-name>` value must be the name of the component.
107+
108+
{{< note >}}
109+
Updating a file in `/etc/kubernetes/manifests` will tell the kubelet to restart the static Pod for the corresponding component.
110+
Try doing these changes one node at a time to leave the cluster without downtime.
111+
{{< /note >}}
112+
113+
### Applying kubelet configuration changes
114+
115+
#### Updating the `KubeletConfiguration`
116+
117+
During cluster creation and upgrade, kubeadm writes its
118+
[`KubeletConfiguration`](/docs/reference/config-api/kubelet-config.v1beta1/)
119+
in a ConfigMap called `kubelet-config` in the `kube-system` namespace.
120+
121+
You can edit the ConfigMap with this command:
122+
123+
```shell
124+
kubectl edit cm -n kube-system kubelet-config
125+
```
126+
127+
The configuration is located under the `data.kubelet` key.
128+
129+
#### Reflecting the kubelet changes
130+
131+
To reflect the change on kubeadm nodes you must do the following:
132+
- Log in to a kubeadm node
133+
- Run `kubeadm upgrade node phase kubelet-config` to download the latest `kubelet-config`
134+
ConfigMap contents into the local file `/var/lib/kubelet/config.conf`
135+
- Edit the file `/var/lib/kubelet/kubeadm-flags.env` to apply additional configuration with
136+
flags
137+
- Restart the kubelet service with `systemctl restart kubelet`
138+
139+
{{< note >}}
140+
Do these changes one node at a time to allow workloads to be rescheduled properly.
141+
{{< /note >}}
142+
143+
{{< note >}}
144+
During `kubeadm upgrade`, kubeadm downloads the `KubeletConfiguration` from the
145+
`kubelet-config` ConfigMap and overwrite the contents of `/var/lib/kubelet/config.conf`.
146+
This means that node local configuration must be applied either by flags in
147+
`/var/lib/kubelet/kubeadm-flags.env` or by manually updating the contents of
148+
`/var/lib/kubelet/config.conf` after `kubeadm upgrade`, and then restarting the kubelet.
149+
{{< /note >}}
150+
151+
### Applying kube-proxy configuration changes
152+
153+
#### Updating the `KubeProxyConfiguration`
154+
155+
During cluster creation and upgrade, kubeadm writes its
156+
[`KubeProxyConfiguration`](/docs/reference/config-api/kube-proxy-config.v1alpha1/)
157+
in a ConfigMap in the `kube-system` namespace called `kube-proxy`.
158+
159+
This ConfigMap is used by the `kube-proxy` DaemonSet in the `kube-system` namespace.
160+
161+
To change a particular option in the `KubeProxyConfiguration`, you can edit the ConfigMap with this command:
162+
163+
```shell
164+
kubectl edit cm -n kube-system kube-proxy
165+
```
166+
167+
The configuration is located under the `data.config.conf` key.
168+
169+
#### Reflecting the kube-proxy changes
170+
171+
Once the `kube-proxy` ConfigMap is updated, you can restart all kube-proxy Pods:
172+
173+
Obtain the Pod names:
174+
175+
```shell
176+
kubectl get po -n kube-system | grep kube-proxy
177+
```
178+
179+
Delete a Pod with:
180+
181+
```shell
182+
kubectl delete po -n kube-system <pod-name>
183+
```
184+
185+
New Pods that use the updated ConfigMap will be created.
186+
187+
{{< note >}}
188+
Because kubeadm deploys kube-proxy as a DaemonSet, node specific configuration is unsupported.
189+
{{< /note >}}
190+
191+
### Applying CoreDNS configuration changes
192+
193+
#### Updating the CoreDNS Deployment and Service
194+
195+
kubeadm deploys CoreDNS as a Deployment called `coredns` and with a Service `kube-dns`,
196+
both in the `kube-system` namespace.
197+
198+
To update any of the CoreDNS settings, you can edit the Deployment and
199+
Service objects:
200+
201+
```shell
202+
kubectl edit deployment -n kube-system coredns
203+
kubectl edit service -n kube-system kube-dns
204+
```
205+
206+
#### Reflecting the CoreDNS changes
207+
208+
Once the CoreDNS changes are applied you can delete the CoreDNS Pods:
209+
210+
Obtain the Pod names:
211+
212+
```shell
213+
kubectl get po -n kube-system | grep coredns
214+
```
215+
216+
Delete a Pod with:
217+
218+
```shell
219+
kubectl delete po -n kube-system <pod-name>
220+
```
221+
222+
New Pods with the updated CoreDNS configuration will be created.
223+
224+
{{< note >}}
225+
kubeadm does not allow CoreDNS configuration during cluster creation and upgrade.
226+
This means that if you execute `kubeadm upgrade apply`, your changes to the CoreDNS
227+
objects will be lost and must be reapplied.
228+
{{< /note >}}
229+
230+
## Persisting the reconfiguration
231+
232+
During the execution of `kubeadm upgrade` on a managed node, kubeadm might overwrite configuration
233+
that was applied after the cluster was created (reconfiguration).
234+
235+
### Persisting Node object reconfiguration
236+
237+
kubeadm writes Labels, Taints, CRI socket and other information on the Node object for a particular
238+
Kubernetes node. To change any of the contents of this Node object you can use:
239+
240+
```shell
241+
kubectl edit no <node-name>
242+
```
243+
244+
During `kubeadm upgrade` the contents of such a Node might get overwritten.
245+
If you would like to persist your modifications to the Node object after upgrade,
246+
you can prepare a [kubectl patch](/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/)
247+
and apply it to the Node object:
248+
249+
```shell
250+
kubectl patch no <node-name> --patch-file <patch-file>
251+
```
252+
253+
#### Persisting control plane component reconfiguration
254+
255+
The main source of control plane configuration is the `ClusterConfiguration`
256+
object stored in the cluster. To extend the static Pod manifests configuration,
257+
[patches](/docs/setup/production-environment/tools/kubeadm/control-plane-flags/#patches) can be used.
258+
259+
These patch files must remain as files on the control plane nodes to ensure that
260+
they can be used by the `kubeadm upgrade ... --patches <directory>`.
261+
262+
If reconfiguration is done to the `ClusterConfiguration` and static Pod manifests on disk,
263+
the set of node specific patches must be updated accordingly.
264+
265+
#### Persisting kubelet reconfiguration
266+
267+
Any changes to the `KubeletConfiguration` stored in `/var/lib/kubelet/config.conf` will be overwritten on
268+
`kubeadm upgrade` by downloading the contents of the cluster wide `kubelet-config` ConfigMap.
269+
To persist kubelet node specific configuration either the file `/var/lib/kubelet/config.conf`
270+
has to be updated manually post-upgrade or the file `/var/lib/kubelet/kubeadm-flags.env` can include flags.
271+
The kubelet flags override the associated `KubeletConfiguration` options, but note that
272+
some of the flags are deprecated.
273+
274+
A kubelet restart will be required after changing `/var/lib/kubelet/config.conf` or
275+
`/var/lib/kubelet/kubeadm-flags.env`.
276+
277+
{{% heading "whatsnext" %}}
278+
279+
- [Upgrading kubeadm clusters](/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade)
280+
- [Customizing components with the kubeadm API](/docs/setup/production-environment/tools/kubeadm/control-plane-flags)
281+
- [Certificate management with kubeadm](/docs/tasks/administer-cluster/kubeadm/kubeadm-certs)

0 commit comments

Comments
 (0)