This directory contains the presentation and a demo video used in AWS Community Day - Kochi on 16th Dec 2023.
The setup is on VirtualBox and installed Ubuntu 22.04
with minimal option
Primary network set to host-only
Secondary network set to NAT
Default user is set to ansil
IP: 192.168.56.101
Mask: 255.255.255.0
sudo apt-get install ssh curl
systemctl enable ssh
curl https://releases.rancher.com/install-docker/20.10.sh | sh
sudo usermod -aG docker $USER
mkdir rke_setup
cd rke_setup
curl -L https://github.com/rancher/rke/releases/download/v1.4.11/rke_linux-amd64 -o rke
chmod +x rke
ssh-keygen
ssh-copy-id [email protected]
./rke config
vi cluster.yml
network:
plugin: none
./rke up
ls -lrt
curl -LO "https://dl.k8s.io/release/v1.26.9/bin/linux/amd64/kubectl"
chmod +x kubectl
export KUBECONFIG=$HOME/rke_setup/kube_config_cluster.yml
curl -L https://get.helm.sh/helm-v3.13.2-linux-amd64.tar.gz | tar -zxvf - --strip-components=1 linux-amd64/helm
./helm repo add cilium https://helm.cilium.io
./helm repo update
./helm install cilium cilium/cilium --set operator.replicas=1 -n kube-system
curl -L https://github.com/cilium/cilium-cli/releases/download/v0.15.17/cilium-linux-amd64.tar.gz | tar -zxvf -
./cilium status -n kube-system
kubectl get pods --all-namespaces -o custom-columns=NAMESPACE:.metadata.namespace,NAME:.metadata.name,HOSTNETWORK:.spec.hostNetwork --no-headers=true | grep '<none>' | awk '{print "-n "$1" "$2}' | xargs -L 1 -r kubectl delete pod
./kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml
./kubectl create -f - <<EOF
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard
EOF
./kubectl create -f - <<EOF
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-user
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: admin-user
namespace: kubernetes-dashboard
EOF
./kubectl -n kubernetes-dashboard create token admin-user
./kubectl proxy
http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/
Now enter the toke you got from previous step to login to the dashboard!