For the complete documentation index, see llms.txt. This page is also available as Markdown.

Kubernetes cluster access

Overview

This guide explains how to connect to an OpenCRVS Kubernetes cluster using kubectl.

Cluster access is provided using a Kubernetes kubeconfig file generated by the cluster administrator.

Quick Start

  1. Copy the Kubernetes configuration file (kubeconfig) from the server:

    scp -P 22 -i ~/.ssh/id_rsa <login>@<server>:~/.kube/config /tmp/kubeconfig
  2. Verify cluster access:

    export KUBECONFIG=/tmp/kubeconfig
    kubectl get namespaces

If the command succeeds, your Kubernetes access is configured correctly.

Prerequisites

Before connecting to the cluster, ensure you have:

  • SSH access to the server

  • kubectl installed locally [2]

  • VPN or network access to the cluster (if required)

  • Network access to Kubernetes API port 6443/TCP

Optional utilities:

  • helm for deploying or upgrading OpenCRVS [3]

  • k9s for terminal-based Kubernetes management [4]

Access cluster from the server (SSH)

The Kubernetes kubeconfig file is stored in the user's home directory on the server (Kubernetes master node):

Users defined in the infrastructure inventory files (environments/<env>/inventory.yaml) already have Kubernetes access configured.

After connecting to the server via SSH, use kubectl or k9s to manage and troubleshoot OpenCRVS workloads. Both tools are installed and configured by default.

Use kubectl from your laptop

Copy kubeconfig from the server

Copy the Kubernetes kubeconfig file from the server to your laptop:

Configure kubeconfig for long-term use

Most users only need one of the following options.

Option 1: Replace your default kubeconfig

Use this option if the cluster should become your default and only Kubernetes context:

Option 2: Merge with an existing kubeconfig

Use this option if you already work with multiple Kubernetes clusters:

Useful commands

List available Kubernetes contexts

Example output:

Switch Kubernetes context

Example output:

Verify cluster connection

Common troubleshooting commands

Check current Kubernetes context:

Check cluster connectivity:

Check Kubernetes API permissions:

[1] https://kubernetes.io/docs/reference/kubectl/quick-reference/

[2] https://kubernetes.io/docs/tasks/tools/

[3] https://helm.sh/

[4] https://k9scli.io/topics/install/

Last updated