Home K3S installation
Post
Cancel

K3S installation

Install k3s server

  1. Get script and install

    1
    
     curl -sfL https://get.k3s.io | sh -
    
  2. Enable and start k3s service

    1
    2
    
     sudo systemctl enable k3s
     sudo systemctl start k3s
    
  3. Let kubectl connect to k3s server

    1
    
     sudo cat /etc/rancher/k3s/k3s.yaml > ~/.kube/config
    

Deploy Kubernetes Dashboard

Ref: Kubernetes Dashboard

  1. Deploy dashboard

    1
    2
    3
    
     GITHUB_URL=https://github.com/kubernetes/dashboard/releases
     VERSION_KUBE_DASHBOARD=$(curl -w '%{url_effective}' -I -L -s -S ${GITHUB_URL}/latest -o /dev/null | sed -e 's|.*/||')
     kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/${VERSION_KUBE_DASHBOARD}/aio/deploy/recommended.yaml
    
  2. Configure RBAC

    1
    2
    
     cd personal-tools/k8s
     kubectl apply -f dashboard.yaml    
    
  3. Create token to login

    1
    
     kubectl -n kubernetes-dashboard create token admin-user | xclip -selection c
    
  4. Create secure channel

    1
    
     kubectl proxy
    
  5. Open local dashboard and use copied token to login

This post is licensed under CC BY 4.0 by the author.