git clone [email protected]:rancher/k3s.git
cd k3s
K3S_TOKEN=${RANDOM}${RANDOM}${RANDOM} docker-compose up -d
export KUBECONFIG=./kubeconfig.yaml
kubectl get nodes
NAME STATUS ROLES AGE VERSION
65e2440e6916 Ready <none> 11m v1.19.4+k3s1
774f7268c91f Ready master 11m v1.19.4+k3s1
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 create -f https://raw.githubusercontent.com/kubernetes/dashboard/${VERSION_KUBE_DASHBOARD}/aio/deploy/recommended.yaml
echo 'apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard' | kubectl apply -f -
echo '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' | kubectl apply -f -
kubectl -n kubernetes-dashboard describe secret admin-user-token | grep "^token"
kubectl proxy
http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/
refs
Recommended Posts