Skip to content

Instantly share code, notes, and snippets.

@devbeno
Created July 15, 2022 22:12
Show Gist options
  • Save devbeno/ce5e720a42bbdb5563e07a1c8eb025ee to your computer and use it in GitHub Desktop.
Save devbeno/ce5e720a42bbdb5563e07a1c8eb025ee to your computer and use it in GitHub Desktop.
wget https://github.com/k3s-io/k3s/releases/download/v1.23.5%2Bk3s1/k3s
sudo mv k3s /usr/local/bin/
sudo chmod u+x /usr/local/bin/k3s
k3s --version
# If you get openssl error
sudo zypper install openssl
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
k3s check-config
k3s server
alias kubectl="k3s kubectl"
kubectl cluster-info
export KUBERNETES_MASTER=$( grep server: /etc/rancher/k3s/k3s.yaml | cut -c13-)
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
kubectl create namespace cattle-system
kubectl create namespace cert-manager
helm repo add rancher-latest https://releases.rancher.com/server-charts/latest
helm repo add jetstack https://charts.jetstack.io
helm repo update
# Get latest cert-manager https://github.com/cert-manager/cert-manager/releases
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.3.1/cert-manager.crds.yaml
helm install cert-manager jetstack/cert-manager \
--namespace cert-manager \
--create-namespace \
--version v1.3.1
kubectl get pods --namespace cert-manager
helm install rancher rancher-latest/rancher --namespace cattle-system --set hostname=rancher.local
kubectl -n cattle-system get deploy rancher
echo "127.0.0.1 rancher.local" >> /etc/hosts
ip addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'
Start-Proces notepad.exe 'c:\Windows\System32\Drivers\etc\hosts' -Verb runAs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment