docs/doc/source/usertasks/kubernetes/kubernetes-user-tutorials-i...

3.4 KiB

Install Kubectl and Helm Clients Directly on a Host

As an alternative to using the container-backed Remote for kubectl and helm, you can install these commands directly on your remote host.

Kubectl and helm installed directly on the remote host provide the best CLI behaviour, especially for CLI commands that reference local files or require a shell.

The following procedure shows you how to configure the kubectl and kubectl clients directly on a remote host, for an admin user with cluster-admin clusterrole. If using a non-admin user with only role privileges within a private namespace, additional configuration is required in order to use helm.

You need from your administrator: a or Local username and password to get the Kubernetes authentication token, the IP and, optionally, the Kubernetes certificate of the target environment.

You must have the oidc-auth-apps Identity Provider (dex) configured on the target environment to get Kubernetes authentication tokens.

  1. On the workstation, install the kubectl client, set up the Kubernetes configuration and get a token. Follow the steps of section Kubernetes Remote Client Access using the Host Directly at Configure Kubernetes Client Access <configure-kubernetes-client-access>, then test the kubectl access with the command below.

    % kubectl get pods -o wide
    NAME            READY STATUS RE-    AGE IP           NODE      NOMINA- READINESS
                                    STARTS                           TED NODE GATES
    nodeinfo-648f.. 1/1  Running   0    62d 172.16.38.83  worker-4 <none> <none>
    nodeinfo-648f.. 1/1  Running   0    62d 172.16.97.207 worker-3 <none> <none>
    nodeinfo-648f.. 1/1  Running   0    62d 172.16.203.14 worker-5 <none> <none>
    tiller-deploy.. 1/1  Running   0    27d 172.16.97.219 worker-3 <none> <none>
  2. On the workstation, install the helm client on an Ubuntu host by performing the following actions on the remote Ubuntu system.

    1. Install helm client.

      % wget https://get.helm.sh/helm-v2.13.1-linux-amd64.tar.gz
      % tar xvf helm-v2.13.1-linux-amd64.tar.gz
      % sudo cp linux-amd64/helm /usr/local/bin

      In order to use helm, additional configuration is required. For more information, see Configuring Remote Helm Client <configuring-remote-helm-client>.

Related information

Configuring Container-backed Remote CLIs and Clients <kubernetes-user-tutorials-configuring-container-backed-remote-clis-and-clients>

Using Container-backed Remote CLIs and Clients <using-container-based-remote-clis-and-clients>

Configuring Remote Helm Client <configuring-remote-helm-client>