Connecting¶
Managing resources in kubernetes is performed using the
kubectltool.This is installed locally, and connects to remote clusters using information in the
kubeconfigfile
Local Installation using minikube¶
You can only install minikube direct on a host OS. Installing minikube in a guest OS in a VM is not supported.
Follow the instructions at kubernetes.io to install kubectl Kubectl is the kubernetes command-line tool which is used to run commands against a kubernetes cluster.
Follow the instructions at kubernetes.io to install minikube , a single-machine kubernetes installation that runs on a virtual machine on your own computer.
To switch kubectl to the minikube context in your kubeconfig file use:
kubectl config use-context minikube
Kubernetes in the cloud¶
AWS¶
To connect to an existing AWS Kubernetes cluster, you will either need to use the AWS CLI, or install the AWS IAM authenticator.
Ensure you have an IAM user in the AWS subscription, and that you have an API key for that user.
To connect using the AWS CLI.
To connect using the AWS IAM authenticator:
Use the instructions in the section ‘To use the AWS IAM Authenticator’ in this document
Azure¶
To connect to an existing Azure managed kubernetes cluster, you will need to install the azure CLI
Ensure you have a user account in Azure that can connect to your cluster.
Configure kubectl to connect to your cluster:
az aks get-credentials --resource-group myResourceGroup --name myAKSClusterWhen working with multiple clusters, you can switch to your AKS cluster using
kubectl config use-context myAKSCluster