Hot-Patch an Arbitrary Image in Your Deployment¶
This section will guide you through setting custom container images for the components of Rok and Rok Registry.
Contact Arrikto
This is an advanced guide that you should not follow, unless Arrikto has
instructed you to do so. Arrikto should first provide you with a custom
container image and its <TAG>
, for each component that you are going to
hot-patch.
See also
Overview
What You’ll Need¶
- A configured management environment.
- Your clone of the Arrikto GitOps repository.
- An existing Rok deployment.
- A custom container image provided by Arrikto, for each component that you are going to hot-patch.
Air Gapped
- A mirror of those images in your internal registry.
Procedure¶
Note
Repeat the procedure below for every Rok and Rok Registry component that you wish to hot-patch. Choose the corresponding tab at the beginning of each iteration.
Go to your GitOps repository inside your
rok-tools
management environment:root@rok-tools:~# cd ~/ops/deploymentsEdit the corresponding YAML manifests:
Edit the
rok/rok-operator/overlays/deploy/kustomization.yaml
file and append the following snippet. Replace<REGISTRY>
with the new custom container registry and/or<TAG>
with the new image tag. If you only want to set a new custom registry, keep the line starting withnewName:
and remove the line starting withnewTag:
. Similarly, if you only want to set a new image tag, keep the line starting withnewTag:
and remove the line starting withnewName:
:images: - name: gcr.io/arrikto-deploy/rok-operator newName: <REGISTRY>/rok-operator newTag: <TAG>For example, to change only the image
<TAG>
torelease-1.2
, append the following snippet:images: - name: gcr.io/arrikto-deploy/rok-operator newTag: release-1.2As another example, to change both the image
<TAG>
torelease-1.2
and the<REGISTRY>
togcr.io/arrikto-playground
, append the following snippet:images: - name: gcr.io/arrikto-deploy/rok-operator newName: gcr.io/arrikto-playground/rok-operator newTag: release-1.2Edit the
rok/rok-disk-manager/overlays/deploy/kustomization.yaml
file and append the following snippet. Replace<REGISTRY>
with the new custom container registry and/or<TAG>
with the new image tag. If you only want to set a new custom registry, keep the line starting withnewName:
and remove the line starting withnewTag:
. Similarly, if you only want to set a new image tag, keep the line starting withnewTag:
and remove the line starting withnewName:
:images: - name: gcr.io/arrikto-deploy/rok-disk-manager newName: <REGISTRY>/rok-disk-manager newTag: <TAG>For example, to change only the image
<TAG>
torelease-1.2
, append the following snippet:images: - name: gcr.io/arrikto-deploy/rok-disk-manager newTag: release-1.2As another example, to change both the image
<TAG>
torelease-1.2
and the<REGISTRY>
togcr.io/arrikto-playground
, append the following snippet:images: - name: gcr.io/arrikto-deploy/rok-disk-manager newName: gcr.io/arrikto-playground/rok-disk-manager newTag: release-1.2Edit the
rok/rok-kmod/overlays/deploy/kustomization.yaml
file and append the following snippet. Replace<REGISTRY>
with the new custom container registry and/or<TAG>
with the new image tag. If you only want to set a new custom registry, keep the line starting withnewName:
and remove the line starting withnewTag:
. Similarly, if you only want to set a new image tag, keep the line starting withnewTag:
and remove the line starting withnewName:
:images: - name: gcr.io/arrikto-deploy/rok-kmod newName: <REGISTRY>/rok-kmod newTag: <TAG>For example, to change only the image
<TAG>
torelease-1.2
, append the following snippet:images: - name: gcr.io/arrikto-deploy/rok-kmod newTag: release-1.2As another example, to change both the image
<TAG>
torelease-1.2
and the<REGISTRY>
togcr.io/arrikto-playground/
, append the following snippet:images: - name: gcr.io/arrikto-deploy/rok-kmod newName: gcr.io/arrikto-playground/rok-kmod newTag: release-1.2Edit the
rok/rok-cluster/overlays/deploy/kustomization.yaml
file and append the following snippet. Replace<REGISTRY>
with the new custom container registry and/or<TAG>
with the new image tag. If you only want to set a new custom registry, keep the line starting withnewName:
and remove the line starting withnewTag:
. Similarly, if you only want to set a new image tag, keep the line starting withnewTag:
and remove the line starting withnewName:
:images: - name: gcr.io/arrikto-deploy/roke newName: <REGISTRY>/roke newTag: <TAG> - name: gcr.io/arrikto-deploy/rok-csi newName: <REGISTRY>/rok-csi newTag: <TAG>For example, to change only the image
<TAG>
torelease-1.2
, append the following snippet:images: - name: gcr.io/arrikto-deploy/roke newTag: release-1.2 - name: gcr.io/arrikto-deploy/rok-csi newTag: release-1.2As another example, to change both the image
<TAG>
torelease-1.2
and the<REGISTRY>
togcr.io/arrikto-playground/
, append the following snippet:images: - name: gcr.io/arrikto-deploy/roke newName: gcr.io/arrikto-playground/roke newTag: release-1.2 - name: gcr.io/arrikto-deploy/rok-csi newName: gcr.io/arrikto-playground/rok-csi newTag: release-1.2Edit the
rok/rok-operator/overlays/registry/deploy/kustomization.yaml
file and append the following snippet. Replace<REGISTRY>
with the new custom container registry and/or<TAG>
with the new image tag. If you only want to set a new custom registry, keep the line starting withnewName:
and remove the line starting withnewTag:
. Similarly, if you only want to set a new image tag, keep the line starting withnewTag:
and remove the line starting withnewName:
:images: - name: gcr.io/arrikto-deploy/rok-operator newName: <REGISTRY>/rok-operator newTag: <TAG>For example, to change only the image
<TAG>
torelease-1.2
, append the following snippet:images: - name: gcr.io/arrikto-deploy/rok-operator newTag: release-1.2As another example, to change both the image
<TAG>
torelease-1.2
and the<REGISTRY>
togcr.io/arrikto-playground
, append the following snippet:images: - name: gcr.io/arrikto-deploy/rok-operator newName: gcr.io/arrikto-playground/rok-operator newTag: release-1.2Edit the
rok/rok-registry-cluster/overlays/deploy/kustomization.yaml
file and append the following snippet. Replace<REGISTRY>
with the new custom container registry and/or<TAG>
with the new image tag. If you only want to set a new custom registry, keep the line starting withnewName:
and remove the line starting withnewTag:
. Similarly, if you only want to set a new image tag, keep the line starting withnewTag:
and remove the line starting withnewName:
:images: - name: gcr.io/arrikto-deploy/rok-registry newName: <REGISTRY>/rok-registry newTag: <TAG>For example, to change only the image
<TAG>
torelease-1.2
, append the following snippet:images: - name: gcr.io/arrikto-deploy/rok-registry newTag: release-1.2As another example, to change both the image
<TAG>
torelease-1.2
and the<REGISTRY>
togcr.io/arrikto-playground
, append the following snippet:images: - name: gcr.io/arrikto-deploy/rok-registry newName: gcr.io/arrikto-playground/rok-registry newTag: release-1.2Note
If the lines in the snippet already exist in the
kustomization.yaml
change them to match the snippet instead of appending new ones.Commit changes:
root@rok-tools:~/ops/deployments# git commit -am "Update Rok Operator container image"root@rok-tools:~/ops/deployments# git commit -am "Update Rok Disk Manager container image"root@rok-tools:~/ops/deployments# git commit -am "Update Rok kmod container image"root@rok-tools:~/ops/deployments# git commit -am "Update Rok container image"root@rok-tools:~/ops/deployments# git commit -am "Update Rok Operator for Rok Registry container image"root@rok-tools:~/ops/deployments# git commit -am "Update Rok Registry container image"Note
Optionally, you can push your local changes to a remote of your choice.
Apply the kustomization:
root@rok-tools:~/ops/deployments# rok-deploy --apply rok/rok-operator/overlays/deployroot@rok-tools:~/ops/deployments# rok-deploy --apply rok/rok-disk-manager/overlays/deployroot@rok-tools:~/ops/deployments# rok-deploy --apply rok/rok-kmod/overlays/deployroot@rok-tools:~/ops/deployments# rok-deploy --apply rok/rok-cluster/overlays/deployroot@rok-tools:~/ops/deployments# rok-deploy --apply rok/rok-operator/overlays/registry/deployroot@rok-tools:~/ops/deployments# rok-deploy --apply rok/rok-registry-cluster/overlays/deploy
Verify¶
Note
Repeat the procedure below for every Rok and Rok Registry component whose image you wish to verify. Choose the corresponding tab at the beginning of each iteration.
Extract the container image used in the corresponding Kubernetes resource:
root@rok-tools:~/ops/deployments# kubectl -n rok-system get sts rok-operator \ > -o=custom-columns=':spec.template.spec.containers[*].image' --no-headers gcr.io/arrikto-playground/rok-operator:release-1.2root@rok-tools:~/ops/deployments# kubectl -n rok-system get ds rok-disk-manager \ > -o=custom-columns=':spec.template.spec.containers[*].image' --no-headers gcr.io/arrikto-playground/rok-disk-manager:release-1.2root@rok-tools:~/ops/deployments# kubectl -n rok-system get ds rok-kmod \ > -o=custom-columns=':spec.template.spec.containers[*].image' --no-headers gcr.io/arrikto-playground/rok-kmod:release-1.2root@rok-tools:~/ops/deployments# kubectl -n rok get rokcluster rok \ > -o=custom-columns=':spec.images.rok' --no-headers gcr.io/arrikto-playground/roke:release-1.2root@rok-tools:~/ops/deployments# kubectl -n rok get rokcluster rok \ > -o=custom-columns=':spec.images.rokCSI' --no-headers gcr.io/arrikto-playground/rok-csi:release-1.2root@rok-tools:~/ops/deployments# kubectl -n rok-registry-system get sts rok-registry-operator \ > -o=custom-columns=':spec.template.spec.containers[*].image' --no-headers gcr.io/arrikto-playground/rok-operator:release-1.2root@rok-tools:~/ops/deployments# kubectl -n rok-registry get rokregistrycluster rok-registry \ > -o=custom-columns=':spec.images.rokRegistry' --no-headers gcr.io/arrikto-playground/rok-registry:release-1.2Verify that the container image is the correct one:
Ensure that the image is the same as
<REGISTRY>
/rok-operator:<TAG>
.Ensure that the image is the same as
<REGISTRY>
/rok-disk-manager:<TAG>
.Ensure that the image is the same as
<REGISTRY>
/rok-kmod:<TAG>
.Ensure that the images are the same as
<REGISTRY>
/roke:<TAG>
and<REGISTRY>
/rok-csi:<TAG>
.Ensure that the image is the same as
<REGISTRY>
/rok-operator:<TAG>
.Ensure that the image is the same as
<REGISTRY>
/rok-registry:<TAG>
.
Summary¶
You have successfully set custom images for Rok and Rok Registry components.
What’s Next¶
Check out the rest of the maintenance operations that you can perform on your cluster.