Page cover image

Register K3S

Steps to register K3S Cluster in gopaddle

K3S cluster can be registered in gopaddle either using its public IP address or a fully qualified domain name (FQDN) or securely via a Bastion Host or a Jump server.

1. Prepare Kubernetes Environment

Port Configuration

Make sure port the cluster API server port (default 6443) is open to public.

Configure Subject Alternative Names (SAN)

Add Subject Alternative Names (SAN) on the K3S server TLS cert. If SAN does not exist for the API endpoint, add the below in the cluster configuration.

a) Login to the K3S master node.

b) Create/edit the file /etc/rancher/k3s/config.yaml file with the below configuration :

  <public-ip-address> # or <fully-qualified-domain-name> 
  # <private_ip_addres> in case of bastion host configuration

c) Restart the k3s server service

sudo systemctl stop k3s
sudo systemctl start k3s

d) Check the status of the k3s service and make sure it is in running state.

systemctl status k3s

2. Copy Kubernetes Config file

Copy /etc/rancher/k3s/k3s.yaml in to your local desktop as kube.config

3. Validate Connection from Local Desktop Environment

  1. Edit the server section in kube.config to point to the Cluster API server public IP address or its FQDN.

apiVersion: v1
- cluster:
    certificate-authority-data: <cert-auth-data>
    server: https://<public-ip_or_fqdn>::<cluster_port>
  name: default
- context:
    cluster: default
    user: default
  name: default
current-context: default
kind: Config
preferences: {}
- name: default
    client-certificate-data: <client-cert-data>
    client-key-data: <client-key-data>
  1. Verify if kube configuration works.

export KUBECONFIG=$(pwd)/kube.config
kubectl get ns
  1. Use this kube.config file to register the cluster in gopaddle.

4. Register the Cluster in gopaddle

  1. In the gopaddle UI, navigate to the Clusters section

  2. Click on Add a Cluster and select Register an existing Cluster

  3. In the Cluster registration wizard, select the Cluster Access Method as Kube Config

  4. Choose the Cluster Provider type as Other

  5. In the Authentication Step, upload the Kubernetes config file gathered under section "Validate Connection from Local Desktop Environment"

  1. If you have configured a bastion host, provide the Bastion Host IP, SSH Pem file, SSH port

If you are using a Bastion Host setup, make sure the Bastion Host IP and Port are accessible publicly. If you are looking for a private only setup, get in touch with us to explore gopaddle Enterprises.

  1. Click on Finish to register the On-premises Cluster.

  2. If you see the error - Network Error ! ServerError: Response not successful: Received status code 503, while view the cluster resources, then check this troubleshooting section for more information.

Last updated