gopaddle User Guide
  • 👋Welcome to gopaddle
  • Overview
    • 💡Getting Started
    • Register a Cluster
      • Register Rancher Prime - RKE2
      • Register K3S
      • Register MicroK8s
      • Register Kind
      • Register minikube
      • Register Kubeadm Cluster
      • Register AWS EKS Cluster
        • EKS Cluster with public or public/private access point
        • EKS Cluster with private access endpoint and a bastion host
        • Validate Cluster Connectivity
      • Register Azure AKS Cluster
      • Register Google GKE Cluster
      • Register Huawei Cloud Container Engine
    • Register GitHub Account
    • Register Jira Account
    • Register ChatGPT Assistant
    • 💻Kubernetes IDE
      • Filters
      • Editor
      • Flat vs Tree View
      • Developer Tools
    • 🙋AI Assistant
      • Chat with AI
      • Raise a Jira Ticket from Chat Window
      • Create Runbook from Chat Window
    • 📖Runbook Hub
      • Create Runbook Hub
      • Attach Runbook Hub to Cluster
      • Enhancing contents of Runbooks with AI
      • Detach Runbook Hub from Cluster
      • Syncing Runbook Hub with GitHub
      • Delete Runbook / Runbook Hub
    • ⏱️Installing Community Edition
      • MicroK8s Addon
        • On Ubuntu
        • On MacOS
      • Docker Desktop
      • SUSE Rancher Prime
      • Digital Ocean
      • Akamai Linode
      • Kind Cluster
      • Helm
      • Docker Compose
      • Accessing gopaddle UI
    • 📈Improving performance of resource discovery
    • Provision new Cluster
      • Register Cloud Account
        • AWS
          • Quickstart AWS Setup
          • IAM Access Policies
          • AWS Setup Script
        • Azure
          • Create Azure Application
          • Register Azure Cloud Authenticator
          • Register Azure Account
        • Google
      • Provision Clusters on Cloud
        • AWS EKS
          • AWS EKS Reference Architecture
          • Adding an AWS IAM Role (EKS Master / Node Pool)
          • Public EKS Cluster
          • All Private EKS Cluster (beta)
          • Creating a Node Pool
        • Azure AKS
          • Creating a Node Pool
          • Enable Public IP Node Access for Azure Deployments
          • VMSS Autoscaling Rules
        • Google GKE
          • Creating a Node Pool
  • 🔎Troubleshooting
    • Cluster Resource View Issues
      • Network Error ! ServerError: Response not successful: Received status code 503
      • Network Error ! TypeError: Failed to fetch
      • Network Error ! ServerParseError: Unexpected token 'j', "json: erro"... is not valid JSON
      • Updating Labels and Annotations does not get reflected in resources list
      • Filtered resources are not fully listed
    • Runbook Issues
      • Deleting a runbook from .gp.yaml does not detach annotation in resources
      • Deleting a Code Account from gopaddle UI does not detach annotation in resources
    • Jira Issues
      • Creating, Updating or Appending a Jira issue fails with error INVALID_INPUT
    • EKS Issues
    • Deployment Issues
    • Node Issues
    • Huawei Issues
Powered by GitBook
On this page
  • 1. Port Configuration
  • 2. Set up Nginx Proxy
  • 3. Validate Connection from Local Desktop Environment
  • 4. Register the Cluster in gopaddle
  1. Overview
  2. Register a Cluster

Register minikube

Steps to register minikube Cluster in gopaddle

minikube 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. Port Configuration

In the steps to follow, we will be configuring Nginx server to proxy the requests to the Cluster API server. Make sure port the Nginx server port (default 80) is open to public.

Port Configuration

In the steps to follow, we will be configuring Nginx server to proxy the requests to the Cluster API server. Make sure the Nginx server port (default 80) is open to the Bastion host and the Bastion host / Jump server SSH port (default 22) is open to public.

2. Set up Nginx Proxy

  1. Install Python3 and Pip, if not already installed.

sudo apt install python3 -y
sudo apt install python3-pip -y
python3 --version
  1. Install pyyaml dependency

pip install pyyaml
  1. Make a temporary directory to download the scripts

export TMP_DIR=$HOME/gp_temp/
mkdir -p $TMP_DIR
  1. Download the script to extract and expand the CA Certificate, Client Certificate and Key data in the Kubernetes configuration.

curl -o $TMP_DIR/replace-cert-data.sh https://gpscripts.s3.amazonaws.com/replace-cert-data.sh
chmod +x $TMP_DIR/replace-cert-data.sh
  1. Install kubectl command line tool, if not installed already.

sudo snap install kubectl --classic
  1. Install yq tool to filter Kubernetes YAML file contents.

sudo snap install yq
  1. Run the replace script to extract and expand the CA Certificate, Client Certificate and Key data in the Kubernetes configuration

sh $TMP_DIR/replace-cert-data.sh $TMP_DIR
  1. Download the script to extract the API server URL, CA Authority, Client certificate and key data from the default Kubernetes Configuration file.

curl -o $TMP_DIR/cluster-extract-config.py https://gpscripts.s3.amazonaws.com/cluster-extract-config.py
chmod +x $TMP_DIR/cluster-extract-config.py
  1. Verify if the extraction script works as expected.

python3 $TMP_DIR/cluster-extract-config.py API_SERVER_URL --tmp-dir $TMP_DIR

The output of this execution must result in a similar output like this - Eg output. https://127.0.0.1:40773 Note that the ports might differ based on the cluster configuration.

  1. Install Nginx and set HTTP basic authentication for the user named minikube.

sudo apt-get install apache2-utils -y
sudo mkdir /etc/nginx/
sudo htpasswd -c /etc/nginx/.htpasswd minikube
  1. Download the scripts to prepare the Nginx configuration and SSL certificate files

curl -o $TMP_DIR/cluster-setup-nginx-config.sh https://gpscripts.s3.amazonaws.com/cluster-setup-nginx-config.sh
chmod +x $TMP_DIR/cluster-setup-nginx-config.sh
  1. Prepare the Nginx configuration and SSL certificate files

sudo mkdir /etc/nginx/certs
sudo mkdir /etc/nginx/conf.d
sudo sh $TMP_DIR/cluster-setup-nginx-config.sh  $TMP_DIR
  1. Run Nginx container with the configuration and SSL certificate files.

sudo docker run -d --name nginx  --network host -v /etc/nginx/conf.d/:/etc/nginx/conf.d -v /etc/nginx/.htpasswd:/etc/nginx/.htpasswd -v /etc/nginx/certs/cluster.cert:/etc/nginx/certs/cluster.cert -v /etc/nginx/certs/cluster.key:/etc/nginx/certs/cluster.key nginx
  1. Check if Nginx proxy works (skip this step for bastion host setup)

Open a browser session with the public IP address or the FQDN of the cluster master node. Eg. http://<public_ip>

This must show a popup for authentication. Enter the Username as kind and password set in step 6.

  1. Copy the kube.config file to your local desktop environment

cat $TMP_DIR/kube.config

3. Validate Connection from Local Desktop Environment

  1. Edit the kube.config and replace the server with the Nginx endpoint with basic authentication like this - http://<httpd_user>:<http_password>@<public-ip_or_fqdn>

    Based our Nginx configuration in this example, the protocol must be http and not https

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: <cert-auth-data>
    server: http://minikube:<http_passwd>@<public-ip_or_fqdn>
  name: minikube
contexts:
- context:
    cluster: minikube
    user: minikube
  name: minikube
current-context: minikube
kind: Config
preferences: {}
users:
- name: minikube
  user:
    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.

  1. Set up SSH Tunnel locally to validate bastion host configuration

ssh -v -L <local_port>:<cluster_private_ip>:<cluster_nginxx_port> <bastion_user>@<bastion_public_ip> -i <bastion-ssh-pem-file> -N

Eg:

ssh -v -L 8090:10.0.138.148:80 ubuntu@34.201.100.49 -i bastion.pem -N
  1. Edit the kube.config and replace the server with the Nginx endpoint with basic authentication like this - http://<httpd_user>:<http_password>@<public-ip_or_fqdn>

apiVersion: v1
clusters:
  - cluster:
      server: http://minikube:<http_passwd>:localhost:<bastion_port> # Eg. 8090
      certificate-authority-data: <certificate-authority-data>
    name: minikube
contexts:
  - context:
      cluster: minikube
      namespace: default
      user: minikube
    name: minikube
current-context: minikube
kind: Config
preferences: {}
users:
  - name: minikube
    user:
      client-certificate-data: <client-certificate-data>
      client-key-data: <client-key-data>
  1. Verify if tunnel configuration works.

export KUBECONFIG=$(pwd)/kube.config
kubectl get ns
  1. IMPORTANT: Revert the kube.config file such the server points to the private cluster IP address and the cluster port.

apiVersion: v1
clusters:
  - cluster:
      server: http://minikube:<http_passwd>:<private_ip>:80
      certificate-authority-data: <certificate-authority-data>
    name: minikube
contexts:
  - context:
      cluster: minikube
      namespace: default
      user: minikube
    name: minikube
current-context: minikube
kind: Config
preferences: {}
users:
  - name: minikube
    user:
      client-certificate-data: <client-certificate-data>
      client-key-data: <client-key-data>
  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.

PreviousRegister KindNextRegister Kubeadm Cluster

Last updated 1 year ago

Install docker, if not already installed. Check the steps to install docker.

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

here
troubleshooting
Page cover image
Upload the Kubeconfig file
Provide the Bastion Host Connection Details