リソースを一時的に変更する場合にはマニフェストを変更することなく、kubectl setで変更できる。
kubecto apply -f ./sample-pod.yaml
kubectl describe pod sample-pod | grep Image:
Image: nginx:1.16
kubectl setでイメージのバージョンをnginx:1.17とする
kubectl set image pods sample-pod nginx-container=nginx=1.17
確認すると1.17になっていることわかる。
kubectl describe pod sample-pod | grep Image:
Image: nginx=1.17
当然マニフェストとの差異がある。
kubectl diff -f sample-pod.yaml
- - image: nginx=1.17
+ - image: nginx:1.16
imagePullPolicy: IfNotPresent
name: nginx-container
resources: {}