Connecting to a Kubernetes Cluster
Before you can connect to a cluster, ensure you have a Kubernetes cluster, such
as one running on
c2d-galaxy1 in place. For detailed
instructions on setting up these clusters, refer to the following resources:
- Setup the Automation Controller ( AWX ) using Ansible
- Setup the Automation Hub ( Galaxy NG) using Ansible
- Setup Kubernetes
To connect to a Kubernetes cluster, you need to create a
~/.kube/config file. Here’s an example of how to do this:
mkdir --parents ~/.kube
vagrant ssh $BOX -c "microk8s config" > ~/.kube/config
Verify the Connection
To ensure that you’ve successfully connected to the cluster, you can use any
kubectl command. For example, run the following command to verify your
kubectl get all --all-namespaces
Visual Studio Code Integration
If you use Visual Studio Code, you can enhance your Kubernetes cluster management experience by installing the Visual Studio Code Kubernetes Tools . With this extension, you can seamlessly connect to and manage your Kubernetes cluster directly from Visual Studio Code.
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.