Skip to content

Instantly share code, notes, and snippets.

@richardcase
Last active April 5, 2024 08:30
Show Gist options
  • Save richardcase/122735f7726a382234abb3a6760677ca to your computer and use it in GitHub Desktop.
Save richardcase/122735f7726a382234abb3a6760677ca to your computer and use it in GitHub Desktop.
Rancher Turtles: Setup Rancher Manager using kind
  1. Create a file called kind-cluster-with-extramounts.yaml with the following contents
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
name: rancher-manager
nodes:
- role: control-plane
  image: kindest/node:v1.26.3
  extraMounts:
    - hostPath: /var/run/docker.sock
      containerPath: /var/run/docker.sock
  1. Create a kind cluster:
kind create cluster --config kind-cluster-with-extramounts.yaml
  1. Install Cert Manager:
helm install cert-manager jetstack/cert-manager \
    --namespace cert-manager \
    --create-namespace \
    --version v1.12.3 \
    --set installCRDs=true \
    --wait
  1. Install Rancher Manager and disable embedded CAPI:
 helm install rancher rancher-latest/rancher \
    --namespace cattle-system \
    --create-namespace \
    --set replicas=1 \
    --set hostname=myhost.com \
    --set global.cattle.psp.enabled=false \
    --version v2.8.0

ensure you replace myhost.com with the hostname of your choice

  1. Start tunnel of choice (i.e. ngrok, inlets)
@richardcase
Copy link
Author

@valaparthvi
Copy link

If using k3s instead of kind; docker will need to be installed separately on the machine, and a kind network will need to be added.

docker network create --driver=bridge --subnet=172.19.0.0/16 --gateway=172.19.0.1  --opt "com.docker.network.bridge.enable_ip_masquerade"="true"  --opt "com.docker.network.driver.mtu"="1500" kind

sudo systemctl restart docker.service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment