Deploy on Kubernetes

Prerequisites

  • Install a tool to run local Kubernetes clusters. Here, Kind is used as the default option for creating a local cluster.
  • Helm to install VMClarity.

Deployment steps

To deploy VMClarity to your Kubernetes cluster, complete the following steps.

  1. Create a Kubernetes cluster.

    kind create cluster --name vmclarity-k8s
    
  2. Ensure the Kubernetes cluster is up and running. If you’re using kind, you can check the status of your clusters with the following command:

    kind get clusters
    
  3. Use Helm to install VMClarity. Run the following command:

    helm install vmclarity oci://ghcr.io/openclarity/charts/vmclarity --version 0.6.0 \ 
        --namespace vmclarity --create-namespace \
        --set orchestrator.provider=kubernetes \
        --set orchestrator.serviceAccount.automountServiceAccountToken=true \
        --set exploitDBServer.containerSecurityContext.enabled=false
    
  4. Verify that all the VMClarity pods have been successfully deployed by executing the following command:

    kubectl get pods -n vmclarity
    
  5. Wait until all pods are in the Running state or have completed their initialization.

  6. Once the pods are ready, start port forwarding to access the VMClarity gateway service. Use the following command to forward traffic from your local machine to the cluster:

    kubectl port-forward -n vmclarity service/vmclarity-gateway 8080:80
    
  7. Access the VMClarity UI by navigating to http://localhost:8080/ in your web browser.

Next steps

Complete the First tasks on the UI.

Clean up steps

  1. Uninstall VMClarity with Helm. Run the following command:

    helm uninstall vmclarity --namespace vmclarity
    
  2. Delete the Kubernetes cluster.

    kind delete clusters vmclarity-k8s