Skip to content
Permalink
Browse files

Update nginx to modern versions (#19198)

* update nginx versions

* update

* update examples
  • Loading branch information
inductor
inductor committed Mar 17, 2020
1 parent d5f741b commit 4297f3b29c170b56f316a08e338e576527dc22b3
Showing with 73 additions and 73 deletions.
  1. +1 −1 content/en/blog/_posts/2020-01-21-csi-ephemeral-inline-volumes.md
  2. +3 −3 content/en/docs/concepts/cluster-administration/manage-deployment.md
  3. +1 −1 content/en/docs/concepts/configuration/assign-pod-node.md
  4. +1 −1 content/en/docs/concepts/overview/working-with-objects/annotations.md
  5. +1 −1 content/en/docs/concepts/overview/working-with-objects/labels.md
  6. +1 −1 content/en/docs/concepts/overview/working-with-objects/names.md
  7. +22 −22 content/en/docs/concepts/workloads/controllers/deployment.md
  8. +1 −1 content/en/docs/contribute/style/style-guide.md
  9. +1 −1 content/en/docs/reference/access-authn-authz/authentication.md
  10. +23 −23 content/en/docs/tasks/manage-kubernetes-objects/declarative-config.md
  11. +5 −5 content/en/docs/tasks/run-application/rolling-update-replication-controller.md
  12. +2 −2 content/en/docs/tasks/run-application/run-stateless-application-deployment.md
  13. +1 −1 content/en/examples/application/deployment-scale.yaml
  14. +1 −1 content/en/examples/application/deployment-update.yaml
  15. +1 −1 content/en/examples/application/deployment.yaml
  16. +1 −1 content/en/examples/application/nginx-app.yaml
  17. +1 −1 content/en/examples/application/nginx/nginx-deployment.yaml
  18. +1 −1 content/en/examples/application/simple_deployment.yaml
  19. +1 −1 content/en/examples/application/update_deployment.yaml
  20. +1 −1 content/en/examples/controllers/nginx-deployment.yaml
  21. +1 −1 content/en/examples/controllers/{replication-nginx-1.7.9.yaml → replication-nginx-1.14.2.yaml}
  22. +1 −1 content/en/examples/controllers/{replication-nginx-1.9.2.yaml → replication-nginx-1.16.1.yaml}
  23. +1 −1 content/en/examples/pods/simple-pod.yaml
@@ -186,7 +186,7 @@ metadata:
spec:
containers:
- name: nginx
image: nginx:1.13-alpine
image: nginx:1.16-alpine
ports:
- containerPort: 80
volumeMounts:
@@ -424,16 +424,16 @@ At some point, you'll eventually need to update your deployed application, typic

We'll guide you through how to create and update applications with Deployments.

Let's say you were running version 1.7.9 of nginx:
Let's say you were running version 1.14.2 of nginx:

```shell
kubectl run my-nginx --image=nginx:1.7.9 --replicas=3
kubectl run my-nginx --image=nginx:1.14.2 --replicas=3
```
```shell
deployment.apps/my-nginx created
```

To update to version 1.9.1, simply change `.spec.template.spec.containers[0].image` from `nginx:1.7.9` to `nginx:1.9.1`, with the kubectl commands we learned above.
To update to version 1.16.1, simply change `.spec.template.spec.containers[0].image` from `nginx:1.14.2` to `nginx:1.16.1`, with the kubectl commands we learned above.

```shell
kubectl edit deployment/my-nginx
@@ -319,7 +319,7 @@ spec:
topologyKey: "kubernetes.io/hostname"
containers:
- name: web-app
image: nginx:1.12-alpine
image: nginx:1.16-alpine
```

If we create the above two deployments, our three node cluster should look like below.
@@ -82,7 +82,7 @@ metadata:
spec:
containers:
- name: nginx
image: nginx:1.7.9
image: nginx:1.14.2
ports:
- containerPort: 80
@@ -69,7 +69,7 @@ metadata:
spec:
containers:
- name: nginx
image: nginx:1.7.9
image: nginx:1.14.2
ports:
- containerPort: 80
@@ -64,7 +64,7 @@ metadata:
spec:
containers:
- name: nginx
image: nginx:1.7.9
image: nginx:1.14.2
ports:
- containerPort: 80
```
@@ -64,7 +64,7 @@ In this example:
* The Pods are labeled `app: nginx`using the `labels` field.
* The Pod template's specification, or `.template.spec` field, indicates that
the Pods run one container, `nginx`, which runs the `nginx`
[Docker Hub](https://hub.docker.com/) image at version 1.7.9.
[Docker Hub](https://hub.docker.com/) image at version 1.14.2.
* Create one container and name it `nginx` using the `name` field.

Follow the steps given below to create the above Deployment:
@@ -153,23 +153,23 @@ is changed, for example if the labels or container images of the template are up

Follow the steps given below to update your Deployment:

1. Let's update the nginx Pods to use the `nginx:1.9.1` image instead of the `nginx:1.7.9` image.
1. Let's update the nginx Pods to use the `nginx:1.16.1` image instead of the `nginx:1.14.2` image.

```shell
kubectl --record deployment.apps/nginx-deployment set image deployment.v1.apps/nginx-deployment nginx=nginx:1.9.1
kubectl --record deployment.apps/nginx-deployment set image deployment.v1.apps/nginx-deployment nginx=nginx:1.16.1
```
or simply use the following command:

```shell
kubectl set image deployment/nginx-deployment nginx=nginx:1.9.1 --record
kubectl set image deployment/nginx-deployment nginx=nginx:1.16.1 --record
```

The output is similar to this:
```
deployment.apps/nginx-deployment image updated
```

Alternatively, you can `edit` the Deployment and change `.spec.template.spec.containers[0].image` from `nginx:1.7.9` to `nginx:1.9.1`:
Alternatively, you can `edit` the Deployment and change `.spec.template.spec.containers[0].image` from `nginx:1.14.2` to `nginx:1.16.1`:

```shell
kubectl edit deployment.v1.apps/nginx-deployment
@@ -265,7 +265,7 @@ up to 3 replicas, as well as scaling down the old ReplicaSet to 0 replicas.
Labels: app=nginx
Containers:
nginx:
Image: nginx:1.9.1
Image: nginx:1.16.1
Port: 80/TCP
Environment: <none>
Mounts: <none>
@@ -306,11 +306,11 @@ If you update a Deployment while an existing rollout is in progress, the Deploym
as per the update and start scaling that up, and rolls over the ReplicaSet that it was scaling up previously
-- it will add it to its list of old ReplicaSets and start scaling it down.

For example, suppose you create a Deployment to create 5 replicas of `nginx:1.7.9`,
but then update the Deployment to create 5 replicas of `nginx:1.9.1`, when only 3
replicas of `nginx:1.7.9` had been created. In that case, the Deployment immediately starts
killing the 3 `nginx:1.7.9` Pods that it had created, and starts creating
`nginx:1.9.1` Pods. It does not wait for the 5 replicas of `nginx:1.7.9` to be created
For example, suppose you create a Deployment to create 5 replicas of `nginx:1.14.2`,
but then update the Deployment to create 5 replicas of `nginx:1.16.1`, when only 3
replicas of `nginx:1.14.2` had been created. In that case, the Deployment immediately starts
killing the 3 `nginx:1.14.2` Pods that it had created, and starts creating
`nginx:1.16.1` Pods. It does not wait for the 5 replicas of `nginx:1.14.2` to be created
before changing course.

### Label selector updates
@@ -347,10 +347,10 @@ This means that when you roll back to an earlier revision, only the Deployment's
rolled back.
{{< /note >}}

* Suppose that you made a typo while updating the Deployment, by putting the image name as `nginx:1.91` instead of `nginx:1.9.1`:
* Suppose that you made a typo while updating the Deployment, by putting the image name as `nginx:1.161` instead of `nginx:1.16.1`:

```shell
kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.91 --record=true
kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.161 --record=true
```

The output is similar to this:
@@ -427,7 +427,7 @@ rolled back.
Labels: app=nginx
Containers:
nginx:
Image: nginx:1.91
Image: nginx:1.161
Port: 80/TCP
Host Port: 0/TCP
Environment: <none>
@@ -468,13 +468,13 @@ Follow the steps given below to check the rollout history:
deployments "nginx-deployment"
REVISION CHANGE-CAUSE
1 kubectl apply --filename=https://k8s.io/examples/controllers/nginx-deployment.yaml --record=true
2 kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.9.1 --record=true
3 kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.91 --record=true
2 kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.16.1 --record=true
3 kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.161 --record=true
```

`CHANGE-CAUSE` is copied from the Deployment annotation `kubernetes.io/change-cause` to its revisions upon creation. You can specify the`CHANGE-CAUSE` message by:

* Annotating the Deployment with `kubectl annotate deployment.v1.apps/nginx-deployment kubernetes.io/change-cause="image updated to 1.9.1"`
* Annotating the Deployment with `kubectl annotate deployment.v1.apps/nginx-deployment kubernetes.io/change-cause="image updated to 1.16.1"`
* Append the `--record` flag to save the `kubectl` command that is making changes to the resource.
* Manually editing the manifest of the resource.

@@ -488,10 +488,10 @@ Follow the steps given below to check the rollout history:
deployments "nginx-deployment" revision 2
Labels: app=nginx
pod-template-hash=1159050644
Annotations: kubernetes.io/change-cause=kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.9.1 --record=true
Annotations: kubernetes.io/change-cause=kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.16.1 --record=true
Containers:
nginx:
Image: nginx:1.9.1
Image: nginx:1.16.1
Port: 80/TCP
QoS Tier:
cpu: BestEffort
@@ -549,7 +549,7 @@ Follow the steps given below to rollback the Deployment from the current version
CreationTimestamp: Sun, 02 Sep 2018 18:17:55 -0500
Labels: app=nginx
Annotations: deployment.kubernetes.io/revision=4
kubernetes.io/change-cause=kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.9.1 --record=true
kubernetes.io/change-cause=kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.16.1 --record=true
Selector: app=nginx
Replicas: 3 desired | 3 updated | 3 total | 3 available | 0 unavailable
StrategyType: RollingUpdate
@@ -559,7 +559,7 @@ Follow the steps given below to rollback the Deployment from the current version
Labels: app=nginx
Containers:
nginx:
Image: nginx:1.9.1
Image: nginx:1.16.1
Port: 80/TCP
Host Port: 0/TCP
Environment: <none>
@@ -722,7 +722,7 @@ apply multiple fixes in between pausing and resuming without triggering unnecess

* Then update the image of the Deployment:
```shell
kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.9.1
kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.16.1
```

The output is similar to this:
@@ -183,7 +183,7 @@ For field values of type string or integer, use normal style without quotation m
Do | Don't
:--| :-----
Set the value of `imagePullPolicy` to Always. | Set the value of `imagePullPolicy` to "Always".
Set the value of `image` to nginx:1.8. | Set the value of `image` to `nginx:1.8`.
Set the value of `image` to nginx:1.16. | Set the value of `image` to `nginx:1.16`.
Set the value of the `replicas` field to 2. | Set the value of the `replicas` field to `2`.
{{< /table >}}

@@ -208,7 +208,7 @@ spec:
serviceAccountName: bob-the-bot
containers:
- name: nginx
image: nginx:1.7.9
image: nginx:1.14.2
```

Service account bearer tokens are perfectly valid to use outside the cluster and

0 comments on commit 4297f3b

Please sign in to comment.
You can’t perform that action at this time.