Last active
March 28, 2023 15:13
-
-
Save kiranchavala/893ec350dd55f9fb4747b602208bb4fc to your computer and use it in GitHub Desktop.
Installing Rancher and RKE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Installing RKE and Rancher | |
Ubuntu 20.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 root | |
11 sysctl net.bridge.bridge-nf-call-iptables=1 | |
12. Copy the public ssh key where rke client is installed to the rancher server | |
kiranchavala@Kirans-MacBook-Pro .ssh % scp id_rsa.pub root@10.206.153.79:/root/ | |
root@master2:~# cat ~/id_rsa.pub >> ~/.ssh/authorized_keys | |
For centos host make sure it's a non root user | |
Install Rke client | |
brew install rke | |
rke config ---> this will generate cluster.yaml | |
rke up | |
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 --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v0.15.0/cert-manager.crds.yaml | |
kubectl create namespace cert-manager | |
helm repo add jetstack https://charts.jetstack.io | |
helm repo update | |
helm install \ | |
cert-manager jetstack/cert-manager \ | |
--namespace cert-manager \ | |
--version v0.15.0 | |
kubectl get pods --namespace cert-manager | |
make sure all cer-pods are running | |
3. Rancher | |
helm install rancher rancher-latest/rancher \ | |
--namespace cattle-system \ | |
--set hostname=rancher.my.org | |
Replace rancher.my.org with the hostname of ubuntu server(master from hostname command) | |
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