Low Orbit Flux Logo 2 F
RKE needs docker
k3s does NOT need docker
RKE2 does NOT need docker

Rancher Server

Run rancher server in docker:

sudo docker run –privileged -d –restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher

NOTE:

Rancher default cluster:

Get config directly from UI ( copy button ) and paste in here for kubectl to work from any host



vi .kube/config

Can exec into rancher container and:

Create a cluster in a hosted Kubernetes provider

Provision new nodes and create a cluster using RKE/RKE2/K3s

Use existing nodes and create a cluster using RKE/RKE2/K3s

K3s



curl -sfL https://get.k3s.io | sh -
systemctl status k3s
sudo kubectl get all -n kube-system
sudo chmod 644 /etc/rancher/k3s/k3s.yaml  # no sudo for kubectl commands, doesn't work for everything
/usr/local/bin/k3s-uninstall.sh           # uninstall

This command exists:



k3s

Config file:



vi /etc/rancher/k3s/k3s.yaml

Get context for kubectl:

Traefik Controller Dashboard

Can’t get this to work and no idea if it is valid:



vi traefik-custom-conf.yaml

apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
  name: traefik
  namespace: kube-system
spec:
  valuesContent: |-
    additionalArguments:
      - "--api"
      - "--api.dashboard=true"
      - "--api.insecure=true"
    ports:
      traefik:
        expose: true
    providers:
      kubernetesCRD:
        allowCrossNamespace: true

kubectl apply -f traefik-custom-conf.yaml
cp traefik-custom-conf.yaml /etc/rancher/k3s/server/manifests/


RKE Install

Install docker with rancher script:



curl https://releases.rancher.com/install-docker/xxxxxversion-number.sh | sh

sysctl setting:



net.bridge.bridge-nf-call-iptables=1

https://github.com/rancher/rke/#latest-release



chmod +x rke
rke --version

Generate config, prompt:



rke config --name cluster.yml

Generate



rke config --empty --name cluster.yml

Bring it up:



rke up

Save these in a secure location: