Configuring Access to a Kubernetes Cluster

After installing the Kubernetes command line client, kubectl, you can set up the default Kubernetes configuration context that Helm uses to access the Kubernetes cluster and deploy AnzoGraph. The method that you use to set up the configuration context depends on the vendor that hosts the Kubernetes cluster. For information, see the configuration instructions for your vendor. See Configure Access to Multiple Clusters in the Kubernetes documentation for more general information about configuring access to clusters.

This topic provides example instructions that configure a local Linux environment to access a Kubernetes cluster hosted on the Google Cloud Platform.

  1. Run the following command to set the project to the Kubernetes cloud project:
    gcloud config set project <k8s_project_name>

    For example:

    gcloud config set project cloud-kube-1111
    Updated property [core/project]
  2. Run the following command to set the compute zone for the Kubernetes cluster:
    gcloud config set compute/zone <zone_name>

    For example:

    gcloud config set compute/zone us-central1
    Updated property [compute/zone]
  3. To confirm that you can access the cluster, you can run the following command to view cluster details:
    gcloud container clusters list

    The command returns the information such as the name, location, number of nodes, and status of the cluster. For example:

    NAME       LOCATION     MASTER_VERSION   MASTER_IP     MACHINE_TYPE   NODE_VERSION     NUM_NODES  STATUS
    cloud-k8s  us-central1  1.16.13-gke.401  10.100.10.10  n1-standard-1  1.16.13-gke.401  27         RUNNING
  4. Run the following command to fetch the credentials for the cluster:
    gcloud container clusters get-credentials <cluster_name>

    For example:

    gcloud container clusters get-credentials cloud-k8s
    Fetching cluster endpoint and auth data.
    kubeconfig entry generated for cloud-k8s.

Once access to the Kubernetes cluster is configured, see Installing Helm for next steps.

Related Topics