Skip to main content

Connecting to K0s

This guide provides two methods for connecting to the K0s cluster:

  1. SSH connection
  2. Kubeconfig file

Method 1: SSH Connection

First, retrieve the private SSH key stored in pass:

PASSWORD_STORE_DIR=~/projects/medapsis/pass pass show oracle/ssh-private-key > ~/.ssh/medapsis
chmod 600 ~/.ssh/medapsis

Once you have the key, connect to K0s via SSH:

ssh -i ~/.ssh/medapsis ubuntu@158.179.215.70
sudo su -
kubectl get pods -A

Method 2: Kubeconfig File

Retrieve the kubeconfig file from pass:

PASSWORD_STORE_DIR=~/projects/medapsis/pass pass show oracle/kubeconfig > ~/.kube/config-medapsis

Use the kubeconfig to connect directly to the cluster:

kubectl --kubeconfig ~/.kube/config-medapsis get pods -A