Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kaitoan2000/94fb08dd37282c0ddad21e435cd0504d to your computer and use it in GitHub Desktop.
Save kaitoan2000/94fb08dd37282c0ddad21e435cd0504d to your computer and use it in GitHub Desktop.
Installing Rancher and RKE
Installing RKE and Rancher
Ubuntu 22.04
1 vim /etc/ssh/sshd_config
2 systemctl restart sshd
3 sudo apt-get update
4 sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
5 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
6 sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
7 sudo apt-get update
8 sudo apt-get install docker-ce docker-ce-cli containerd.io
9 systemctl status docker
10 usermod -aG docker userdeploy
11 sysctl net.bridge.bridge-nf-call-iptables=1
12. Copy the public ssh key where rke client is installed to the rancher server
Install Rke client
brew install rke
rke config ---> this will generate cluster.yaml
rke up or (rke up --ssh-agent-auth --ignore-docker-version)
cp kube_config_cluster.yml .kube/config
kubectl get nodes
--------
Installing Rancher
1.Install helm on your client
brew install helm
helm repo add rancher-latest https://releases.rancher.com/server-charts/latest
kubectl create namespace cattle-system
2. Install the cert manager
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.7.1/cert-manager.crds.yaml
customresourcedefinition.apiextensions.k8s.io/certificaterequests.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/certificates.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/challenges.acme.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/clusterissuers.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/issuers.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/orders.acme.cert-manager.io created
helm upgrade -i cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --version v1.7.1
helm repo add jetstack https://charts.jetstack.io
helm repo update
kubectl get pods --namespace cert-manager
make sure all cer-pods are running
3. Rancher
helm install rancher rancher-stable/rancher --namespace cattle-system --set hostname=xxx.yyy.zzz
Replace rancher.my.org with the hostname of ubuntu server(master from hostname command)
kubectl -n cattle-system rollout status deploy/rancher
Waiting for deployment "rancher" rollout to finish: 0 of 3 updated replicas are available...
kubectl -n cattle-system get deploy rancher
https://master/
You can set the password and url you want to access rancher from
Ref
https://docs.docker.com/engine/install/ubuntu/
https://rancher.com/docs/rke/latest/en/os/
https://rancher.com/docs/rancher/v2.x/en/installation/k8s-install/helm-rancher/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment