Skip to content

Commit a65f9ac

Browse files
authored
Merge pull request #26915 from PI-Victor/merged-master-dev-1.21
Merge master into dev-1.21
2 parents a81e470 + 70096af commit a65f9ac

File tree

214 files changed

+3983
-5128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

214 files changed

+3983
-5128
lines changed

content/en/blog/_posts/2020-12-02-dockershim-faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ will have strictly better performance and less overhead. However, we encourage y
114114
to explore all the options from the [CNCF landscape] in case another would be an
115115
even better fit for your environment.
116116

117-
[CNCF landscape]: https://landscape.cncf.io/category=container-runtime&format=card-mode&grouping=category
117+
[CNCF landscape]: https://landscape.cncf.io/card-mode?category=container-runtime&grouping=category
118118

119119

120120
### What should I look out for when changing CRI implementations?

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Before choosing a guide, here are some considerations:
4545

4646
## Securing a cluster
4747

48-
* [Certificates](/docs/concepts/cluster-administration/certificates/) describes the steps to generate certificates using different tool chains.
48+
* [Generate Certificates](/docs/tasks/administer-cluster/certificates/) describes the steps to generate certificates using different tool chains.
4949

5050
* [Kubernetes Container Environment](/docs/concepts/containers/container-environment/) describes the environment for Kubelet managed containers on a Kubernetes node.
5151

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

Lines changed: 1 addition & 244 deletions
Original file line numberDiff line numberDiff line change
@@ -4,249 +4,6 @@ content_type: concept
44
weight: 20
55
---
66

7-
87
<!-- overview -->
98

10-
When using client certificate authentication, you can generate certificates
11-
manually through `easyrsa`, `openssl` or `cfssl`.
12-
13-
14-
15-
16-
<!-- body -->
17-
18-
### easyrsa
19-
20-
**easyrsa** can manually generate certificates for your cluster.
21-
22-
1. Download, unpack, and initialize the patched version of easyrsa3.
23-
24-
curl -LO https://storage.googleapis.com/kubernetes-release/easy-rsa/easy-rsa.tar.gz
25-
tar xzf easy-rsa.tar.gz
26-
cd easy-rsa-master/easyrsa3
27-
./easyrsa init-pki
28-
1. Generate a new certificate authority (CA). `--batch` sets automatic mode;
29-
`--req-cn` specifies the Common Name (CN) for the CA's new root certificate.
30-
31-
./easyrsa --batch "--req-cn=${MASTER_IP}@`date +%s`" build-ca nopass
32-
1. Generate server certificate and key.
33-
The argument `--subject-alt-name` sets the possible IPs and DNS names the API server will
34-
be accessed with. The `MASTER_CLUSTER_IP` is usually the first IP from the service CIDR
35-
that is specified as the `--service-cluster-ip-range` argument for both the API server and
36-
the controller manager component. The argument `--days` is used to set the number of days
37-
after which the certificate expires.
38-
The sample below also assumes that you are using `cluster.local` as the default
39-
DNS domain name.
40-
41-
./easyrsa --subject-alt-name="IP:${MASTER_IP},"\
42-
"IP:${MASTER_CLUSTER_IP},"\
43-
"DNS:kubernetes,"\
44-
"DNS:kubernetes.default,"\
45-
"DNS:kubernetes.default.svc,"\
46-
"DNS:kubernetes.default.svc.cluster,"\
47-
"DNS:kubernetes.default.svc.cluster.local" \
48-
--days=10000 \
49-
build-server-full server nopass
50-
1. Copy `pki/ca.crt`, `pki/issued/server.crt`, and `pki/private/server.key` to your directory.
51-
1. Fill in and add the following parameters into the API server start parameters:
52-
53-
--client-ca-file=/yourdirectory/ca.crt
54-
--tls-cert-file=/yourdirectory/server.crt
55-
--tls-private-key-file=/yourdirectory/server.key
56-
57-
### openssl
58-
59-
**openssl** can manually generate certificates for your cluster.
60-
61-
1. Generate a ca.key with 2048bit:
62-
63-
openssl genrsa -out ca.key 2048
64-
1. According to the ca.key generate a ca.crt (use -days to set the certificate effective time):
65-
66-
openssl req -x509 -new -nodes -key ca.key -subj "/CN=${MASTER_IP}" -days 10000 -out ca.crt
67-
1. Generate a server.key with 2048bit:
68-
69-
openssl genrsa -out server.key 2048
70-
1. Create a config file for generating a Certificate Signing Request (CSR).
71-
Be sure to substitute the values marked with angle brackets (e.g. `<MASTER_IP>`)
72-
with real values before saving this to a file (e.g. `csr.conf`).
73-
Note that the value for `MASTER_CLUSTER_IP` is the service cluster IP for the
74-
API server as described in previous subsection.
75-
The sample below also assumes that you are using `cluster.local` as the default
76-
DNS domain name.
77-
78-
[ req ]
79-
default_bits = 2048
80-
prompt = no
81-
default_md = sha256
82-
req_extensions = req_ext
83-
distinguished_name = dn
84-
85-
[ dn ]
86-
C = <country>
87-
ST = <state>
88-
L = <city>
89-
O = <organization>
90-
OU = <organization unit>
91-
CN = <MASTER_IP>
92-
93-
[ req_ext ]
94-
subjectAltName = @alt_names
95-
96-
[ alt_names ]
97-
DNS.1 = kubernetes
98-
DNS.2 = kubernetes.default
99-
DNS.3 = kubernetes.default.svc
100-
DNS.4 = kubernetes.default.svc.cluster
101-
DNS.5 = kubernetes.default.svc.cluster.local
102-
IP.1 = <MASTER_IP>
103-
IP.2 = <MASTER_CLUSTER_IP>
104-
105-
[ v3_ext ]
106-
authorityKeyIdentifier=keyid,issuer:always
107-
basicConstraints=CA:FALSE
108-
keyUsage=keyEncipherment,dataEncipherment
109-
extendedKeyUsage=serverAuth,clientAuth
110-
subjectAltName=@alt_names
111-
1. Generate the certificate signing request based on the config file:
112-
113-
openssl req -new -key server.key -out server.csr -config csr.conf
114-
1. Generate the server certificate using the ca.key, ca.crt and server.csr:
115-
116-
openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key \
117-
-CAcreateserial -out server.crt -days 10000 \
118-
-extensions v3_ext -extfile csr.conf
119-
1. View the certificate:
120-
121-
openssl x509 -noout -text -in ./server.crt
122-
123-
Finally, add the same parameters into the API server start parameters.
124-
125-
### cfssl
126-
127-
**cfssl** is another tool for certificate generation.
128-
129-
1. Download, unpack and prepare the command line tools as shown below.
130-
Note that you may need to adapt the sample commands based on the hardware
131-
architecture and cfssl version you are using.
132-
133-
curl -L https://github.com/cloudflare/cfssl/releases/download/v1.5.0/cfssl_1.5.0_linux_amd64 -o cfssl
134-
chmod +x cfssl
135-
curl -L https://github.com/cloudflare/cfssl/releases/download/v1.5.0/cfssljson_1.5.0_linux_amd64 -o cfssljson
136-
chmod +x cfssljson
137-
curl -L https://github.com/cloudflare/cfssl/releases/download/v1.5.0/cfssl-certinfo_1.5.0_linux_amd64 -o cfssl-certinfo
138-
chmod +x cfssl-certinfo
139-
1. Create a directory to hold the artifacts and initialize cfssl:
140-
141-
mkdir cert
142-
cd cert
143-
../cfssl print-defaults config > config.json
144-
../cfssl print-defaults csr > csr.json
145-
1. Create a JSON config file for generating the CA file, for example, `ca-config.json`:
146-
147-
{
148-
"signing": {
149-
"default": {
150-
"expiry": "8760h"
151-
},
152-
"profiles": {
153-
"kubernetes": {
154-
"usages": [
155-
"signing",
156-
"key encipherment",
157-
"server auth",
158-
"client auth"
159-
],
160-
"expiry": "8760h"
161-
}
162-
}
163-
}
164-
}
165-
1. Create a JSON config file for CA certificate signing request (CSR), for example,
166-
`ca-csr.json`. Be sure to replace the values marked with angle brackets with
167-
real values you want to use.
168-
169-
{
170-
"CN": "kubernetes",
171-
"key": {
172-
"algo": "rsa",
173-
"size": 2048
174-
},
175-
"names":[{
176-
"C": "<country>",
177-
"ST": "<state>",
178-
"L": "<city>",
179-
"O": "<organization>",
180-
"OU": "<organization unit>"
181-
}]
182-
}
183-
1. Generate CA key (`ca-key.pem`) and certificate (`ca.pem`):
184-
185-
../cfssl gencert -initca ca-csr.json | ../cfssljson -bare ca
186-
1. Create a JSON config file for generating keys and certificates for the API
187-
server, for example, `server-csr.json`. Be sure to replace the values in angle brackets with
188-
real values you want to use. The `MASTER_CLUSTER_IP` is the service cluster
189-
IP for the API server as described in previous subsection.
190-
The sample below also assumes that you are using `cluster.local` as the default
191-
DNS domain name.
192-
193-
{
194-
"CN": "kubernetes",
195-
"hosts": [
196-
"127.0.0.1",
197-
"<MASTER_IP>",
198-
"<MASTER_CLUSTER_IP>",
199-
"kubernetes",
200-
"kubernetes.default",
201-
"kubernetes.default.svc",
202-
"kubernetes.default.svc.cluster",
203-
"kubernetes.default.svc.cluster.local"
204-
],
205-
"key": {
206-
"algo": "rsa",
207-
"size": 2048
208-
},
209-
"names": [{
210-
"C": "<country>",
211-
"ST": "<state>",
212-
"L": "<city>",
213-
"O": "<organization>",
214-
"OU": "<organization unit>"
215-
}]
216-
}
217-
1. Generate the key and certificate for the API server, which are by default
218-
saved into file `server-key.pem` and `server.pem` respectively:
219-
220-
../cfssl gencert -ca=ca.pem -ca-key=ca-key.pem \
221-
--config=ca-config.json -profile=kubernetes \
222-
server-csr.json | ../cfssljson -bare server
223-
224-
225-
## Distributing Self-Signed CA Certificate
226-
227-
A client node may refuse to recognize a self-signed CA certificate as valid.
228-
For a non-production deployment, or for a deployment that runs behind a company
229-
firewall, you can distribute a self-signed CA certificate to all clients and
230-
refresh the local list for valid certificates.
231-
232-
On each client, perform the following operations:
233-
234-
```bash
235-
sudo cp ca.crt /usr/local/share/ca-certificates/kubernetes.crt
236-
sudo update-ca-certificates
237-
```
238-
239-
```
240-
Updating certificates in /etc/ssl/certs...
241-
1 added, 0 removed; done.
242-
Running hooks in /etc/ca-certificates/update.d....
243-
done.
244-
```
245-
246-
## Certificates API
247-
248-
You can use the `certificates.k8s.io` API to provision
249-
x509 certificates to use for authentication as documented
250-
[here](/docs/tasks/tls/managing-tls-in-a-cluster).
251-
252-
9+
To learn how to generate certificates for your cluster, see [Certificates](/docs/tasks/administer-cluster/certificates/).

content/en/docs/concepts/cluster-administration/manage-deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ kubectl apply -f https://k8s.io/examples/application/nginx/
4747

4848
It is a recommended practice to put resources related to the same microservice or application tier into the same file, and to group all of the files associated with your application in the same directory. If the tiers of your application bind to each other using DNS, you can deploy all of the components of your stack together.
4949

50-
A URL can also be specified as a configuration source, which is handy for deploying directly from configuration files checked into github:
50+
A URL can also be specified as a configuration source, which is handy for deploying directly from configuration files checked into GitHub:
5151

5252
```shell
5353
kubectl apply -f https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/application/nginx/nginx-deployment.yaml

content/en/docs/concepts/configuration/secret.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ spec:
718718
719719
#### Consuming Secret Values from environment variables
720720
721-
Inside a container that consumes a secret in an environment variables, the secret keys appear as
721+
Inside a container that consumes a secret in the environment variables, the secret keys appear as
722722
normal environment variables containing the base64 decoded values of the secret data.
723723
This is the result of commands executed inside the container from the example above:
724724

content/en/docs/concepts/containers/container-environment.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ as are any environment variables specified statically in the Docker image.
4040
### Cluster information
4141

4242
A list of all services that were running when a Container was created is available to that Container as environment variables.
43+
This list is limited to services within the same namespace as the new Container's Pod and Kubernetes control plane services.
4344
Those environment variables match the syntax of Docker links.
4445

4546
For a service named *foo* that maps to a Container named *bar*,

content/en/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ The most common way to implement the APIService is to run an *extension API serv
2828
Extension API servers should have low latency networking to and from the kube-apiserver.
2929
Discovery requests are required to round-trip from the kube-apiserver in five seconds or less.
3030

31-
If your extension API server cannot achieve that latency requirement, consider making changes that let you meet it. You can also set the
32-
`EnableAggregatedDiscoveryTimeout=false` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/) on the kube-apiserver
33-
to disable the timeout restriction. This deprecated feature gate will be removed in a future release.
31+
If your extension API server cannot achieve that latency requirement, consider making changes that let you meet it.
3432

3533
## {{% heading "whatsnext" %}}
3634

content/en/docs/concepts/overview/components.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ the same machine, and do not run user containers on this machine. See
5151

5252
{{< glossary_definition term_id="kube-controller-manager" length="all" >}}
5353

54-
These controllers include:
54+
Some types of these controllers are:
5555

5656
* Node controller: Responsible for noticing and responding when nodes go down.
57-
* Replication controller: Responsible for maintaining the correct number of pods for every replication
58-
controller object in the system.
57+
* Job controller: Watches for Job objects that represent one-off tasks, then creates
58+
Pods to run those tasks to completion.
5959
* Endpoints controller: Populates the Endpoints object (that is, joins Services & Pods).
6060
* Service Account & Token controllers: Create default accounts and API access tokens for new namespaces.
6161

content/en/docs/concepts/services-networking/dns-pod-service.md

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ content_type: concept
77
weight: 20
88
---
99
<!-- overview -->
10-
This page provides an overview of DNS support by Kubernetes.
11-
10+
Kubernetes creates DNS records for services and pods. You can contact
11+
services with consistent DNS names instead of IP addresses.
1212

1313
<!-- body -->
1414

@@ -18,19 +18,47 @@ Kubernetes DNS schedules a DNS Pod and Service on the cluster, and configures
1818
the kubelets to tell individual containers to use the DNS Service's IP to
1919
resolve DNS names.
2020

21-
### What things get DNS names?
22-
2321
Every Service defined in the cluster (including the DNS server itself) is
24-
assigned a DNS name. By default, a client Pod's DNS search list will
25-
include the Pod's own namespace and the cluster's default domain. This is best
26-
illustrated by example:
22+
assigned a DNS name. By default, a client Pod's DNS search list includes the
23+
Pod's own namespace and the cluster's default domain.
24+
25+
### Namespaces of Services
26+
27+
A DNS query may return different results based on the namespace of the pod making
28+
it. DNS queries that don't specify a namespace are limited to the pod's
29+
namespace. Access services in other namespaces by specifying it in the DNS query.
30+
31+
For example, consider a pod in a `test` namespace. A `data` service is in
32+
the `prod` namespace.
33+
34+
A query for `data` returns no results, because it uses the pod's `test` namespace.
35+
36+
A query for `data.prod` returns the intended result, because it specifies the
37+
namespace.
38+
39+
DNS queries may be expanded using the pod's `/etc/resolv.conf`. Kubelet
40+
sets this file for each pod. For example, a query for just `data` may be
41+
expanded to `data.test.cluster.local`. The values of the `search` option
42+
are used to expand queries. To learn more about DNS queries, see
43+
[the `resolv.conf` manual page.](https://www.man7.org/linux/man-pages/man5/resolv.conf.5.html)
44+
45+
```
46+
nameserver 10.32.0.10
47+
search <namespace>.svc.cluster.local svc.cluster.local cluster.local
48+
options ndots:5
49+
```
50+
51+
In summary, a pod in the _test_ namespace can successfully resolve either
52+
`data.prod` or `data.prod.cluster.local`.
53+
54+
### DNS Records
55+
56+
What objects get DNS records?
2757

28-
Assume a Service named `foo` in the Kubernetes namespace `bar`. A Pod running
29-
in namespace `bar` can look up this service by querying a DNS service for
30-
`foo`. A Pod running in namespace `quux` can look up this service by doing a
31-
DNS query for `foo.bar`.
58+
1. Services
59+
2. Pods
3260

33-
The following sections detail the supported record types and layout that is
61+
The following sections detail the supported DNS record types and layout that is
3462
supported. Any other layout or names or queries that happen to work are
3563
considered implementation details and are subject to change without warning.
3664
For more up-to-date specification, see

0 commit comments

Comments
 (0)