Modify registry.k8s.io/nginx-slim version from 0.8 to 0.24

This commit is contained in:
shayan 2024-06-04 11:10:02 +03:30
parent fb6bf498ca
commit e9c7b069d5
4 changed files with 14 additions and 14 deletions

View File

@ -101,7 +101,7 @@ spec:
terminationGracePeriodSeconds: 10 terminationGracePeriodSeconds: 10
containers: containers:
- name: nginx - name: nginx
image: registry.k8s.io/nginx-slim:0.8 image: registry.k8s.io/nginx-slim:0.24
ports: ports:
- containerPort: 80 - containerPort: 80
name: web name: web

View File

@ -593,7 +593,7 @@ In one terminal window, patch the `web` StatefulSet to change the container
image again: image again:
```shell ```shell
kubectl patch statefulset web --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value":"registry.k8s.io/nginx-slim:0.8"}]' kubectl patch statefulset web --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value":"registry.k8s.io/nginx-slim:0.24"}]'
``` ```
``` ```
statefulset.apps/web patched statefulset.apps/web patched
@ -661,9 +661,9 @@ Get the Pods to view their container images:
for p in 0 1 2; do kubectl get pod "web-$p" --template '{{range $i, $c := .spec.containers}}{{$c.image}}{{end}}'; echo; done for p in 0 1 2; do kubectl get pod "web-$p" --template '{{range $i, $c := .spec.containers}}{{$c.image}}{{end}}'; echo; done
``` ```
``` ```
registry.k8s.io/nginx-slim:0.8 registry.k8s.io/nginx-slim:0.24
registry.k8s.io/nginx-slim:0.8 registry.k8s.io/nginx-slim:0.24
registry.k8s.io/nginx-slim:0.8 registry.k8s.io/nginx-slim:0.24
``` ```
@ -705,7 +705,7 @@ Patch the StatefulSet again to change the container image that this
StatefulSet uses: StatefulSet uses:
```shell ```shell
kubectl patch statefulset web --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value":"registry.k8s.io/nginx-slim:0.7"}]' kubectl patch statefulset web --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value":"registry.k8s.io/nginx-slim:0.21"}]'
``` ```
``` ```
statefulset.apps/web patched statefulset.apps/web patched
@ -740,7 +740,7 @@ Get the Pod's container image:
kubectl get pod web-2 --template '{{range $i, $c := .spec.containers}}{{$c.image}}{{end}}' kubectl get pod web-2 --template '{{range $i, $c := .spec.containers}}{{$c.image}}{{end}}'
``` ```
``` ```
registry.k8s.io/nginx-slim:0.8 registry.k8s.io/nginx-slim:0.24
``` ```
Notice that, even though the update strategy is `RollingUpdate` the StatefulSet Notice that, even though the update strategy is `RollingUpdate` the StatefulSet
@ -790,7 +790,7 @@ Get the Pod's container:
kubectl get pod web-2 --template '{{range $i, $c := .spec.containers}}{{$c.image}}{{end}}' kubectl get pod web-2 --template '{{range $i, $c := .spec.containers}}{{$c.image}}{{end}}'
``` ```
``` ```
registry.k8s.io/nginx-slim:0.7 registry.k8s.io/nginx-slim:0.21
``` ```
@ -834,7 +834,7 @@ Get the `web-1` Pod's container image:
kubectl get pod web-1 --template '{{range $i, $c := .spec.containers}}{{$c.image}}{{end}}' kubectl get pod web-1 --template '{{range $i, $c := .spec.containers}}{{$c.image}}{{end}}'
``` ```
``` ```
registry.k8s.io/nginx-slim:0.8 registry.k8s.io/nginx-slim:0.24
``` ```
`web-1` was restored to its original configuration because the Pod's ordinal `web-1` was restored to its original configuration because the Pod's ordinal
@ -892,9 +892,9 @@ Get the container image details for the Pods in the StatefulSet:
for p in 0 1 2; do kubectl get pod "web-$p" --template '{{range $i, $c := .spec.containers}}{{$c.image}}{{end}}'; echo; done for p in 0 1 2; do kubectl get pod "web-$p" --template '{{range $i, $c := .spec.containers}}{{$c.image}}{{end}}'; echo; done
``` ```
``` ```
registry.k8s.io/nginx-slim:0.7 registry.k8s.io/nginx-slim:0.21
registry.k8s.io/nginx-slim:0.7 registry.k8s.io/nginx-slim:0.21
registry.k8s.io/nginx-slim:0.7 registry.k8s.io/nginx-slim:0.21
``` ```
By moving the `partition` to `0`, you allowed the StatefulSet to By moving the `partition` to `0`, you allowed the StatefulSet to

View File

@ -30,7 +30,7 @@ spec:
spec: spec:
containers: containers:
- name: nginx - name: nginx
image: registry.k8s.io/nginx-slim:0.8 image: registry.k8s.io/nginx-slim:0.24
ports: ports:
- containerPort: 80 - containerPort: 80
name: web name: web

View File

@ -29,7 +29,7 @@ spec:
spec: spec:
containers: containers:
- name: nginx - name: nginx
image: registry.k8s.io/nginx-slim:0.7 image: registry.k8s.io/nginx-slim:0.21
ports: ports:
- containerPort: 80 - containerPort: 80
name: web name: web