Configure Rok

After deploying Rok on Kubernetes you might want to perform post-installation configurations to fine-tune your cluster and environment.

In order to update Rok and its components you need to edit the corresponding YAML manifests inside your local GitOps deployment repository, commit your changes, and re-apply everything. Optionally, you can then push the committed changes to a remote.

For this, we will demonstrate a standard Edit-Commit-Apply cycle using git and kubectl inside your management environment.

Set Custom Container Images for Rok

Depending on your environment and needs you might have to edit Rok manifests to specify a custom repository, name, or tag for the container images of individual Rok components.

For example, you may need to configure Rok to use a private container registry, e.g., in an air gapped computing environment. The following steps describe how to edit manifests, commit changes, and apply them to Kubernetes.

1. Edit Manifests

First, change your current directory to the local clone of Arrikto’s deployments GitOps repository:

root@rok-tools-0:/# cd ~/ops/deployments

The kustomization snippets provided below modify both the name and the tag of Rok images. Depending on your needs you might need to set one or both of them. For example

  • To change gcr.io/arrikto-deploy/rok-operator:v1 to gcr.io/arrikto-deploy/rok-operator:v2, set only newTag.
  • To change gcr.io/arrikto-deploy/rok-operator:v1 to custom.registry/rok-operator:v1, set only newName.
  • To change gcr.io/arrikto-deploy/rok-operator:v1 to custom.registry/rok-operator:v2, set both newName and newTag.

Edit Rok Operator

  1. If you want to change the Rok Operator image used for deploying Rok clusters, you should edit rok/rok-operator/overlays/deploy/kustomization.yaml. For the Rok Operator image used for deploying Rok Registry clusters, you should edit rok/rok-operator/overlays/registry-deploy/kustomization.yaml. In both cases, you should extend the corresponding manifest with the following snippet:

    images:
    - name: gcr.io/arrikto-deploy/rok-operator
      newName: custom.registry/rok-operator
      newTag: release-1.2-l0-release-1.2-rc2
    
  2. Stage changes for commit:

    root@rok-tools-0:~/ops/deployments# git add rok/rok-operator
    

Edit Rok Disk Manager

  1. Edit rok/rok-disk-manager/overlays/deploy/kustomization.yaml and insert the following snippet:

    images:
    - name: gcr.io/arrikto-deploy/rok-disk-manager
      newName: custom.registry/rok-disk-manager
      newTag: release-1.2-l0-release-1.2-rc2
    
  2. Stage changes for commit:

    root@rok-tools-0:~/ops/deployments# git add rok/rok-disk-manager
    

Edit Rok kmod

  1. Edit rok/rok-kmod/overlays/deploy/kustomization.yaml and insert the following snippet:

    images:
    - name: gcr.io/arrikto-deploy/rok-kmod
      newName: custom.registry/rok-kmod
      newTag: release-1.2-l0-release-1.2-rc2
    
  2. Stage changes for commit:

    root@rok-tools-0:~/ops/deployments# git add rok/rok-kmod
    

Edit RokCluster

  1. Edit rok/rok-cluster/overlays/deploy/kustomization.yaml and insert the following snippet:

    images:
    - name: gcr.io/arrikto-deploy/roke
      newName: custom.registry/roke
      newTag: release-1.2-l0-release-1.2-rc2
    - name: gcr.io/arrikto-deploy/rok-csi
      newName: custom.registry/rok-csi
      newTag: release-1.2-l0-release-1.2-rc2
    
  2. Stage changes for commit:

    root@rok-tools-0:~/ops/deployments# git add rok/rok-cluster
    

Edit RokRegistryCluster

  1. Edit rok/rok-registry-cluster/overlays/deploy/kustomization.yaml and insert the following snippet:

    images:
    - name: gcr.io/arrikto-deploy/rok-registry
      newName: custom.registry/rok-registry
      newTag: release-1.2-l0-release-1.2-rc2
    
  2. Stage changes for commit:

    root@rok-tools-0:~/ops/deployments# git add rok/rok-registry-cluster
    

2. Commit changes

Once you are done modifying Rok’s deployment manifests you can commit changes locally:

root@rok-tools-0:~/ops/deployments# git commit -m "Update Rok container images"

Note

Optionally, you can push your local changes to a remote of your choice.

3. Apply changes

In order to apply the desired state to Kubernetes you need to re-apply Rok’s deployment manifests that you previously edited.

Important

You can always view the YAML manifests that Kustomize generates before applying them to Kubernetes with kubectl kustomize rok/<rok-kustomize-app>/overlays/deploy to ensure you have properly configured everything based on your preferences.

For your changes to take effect you need to re-apply the YAML manifests that correspond to the Rok components you modified previously.

You can re-apply all (or some) Rok manifests automatically with rok-deploy --apply.

Important

To run rok-deploy --apply you need to explicitly specify the paths to the Kustomize packages you wish to apply in the command line. Note that this mode is non-interactive, i.e., does not ask for answers to questions, and simply applies existing manifests with kubectl.

For example:

root@rok-tools-0:~/ops/deployments# rok-deploy --apply rok/{rok-operator,rok-disk-manager,rok-kmod,rok-cluster}/overlays/deploy

Also, if you’ve changed manifests for Rok Registry, you have to re-apply them as well. For example:

root@rok-tools-0:~/ops/deployments# rok-deploy --apply rok/rok-operator/overlays/registry-deploy
root@rok-tools-0:~/ops/deployments# rok-deploy --apply rok/rok-registry-cluster/overlays/deploy

What’s Next

The next step is to deploy Rok Registry.