Kubernetes
To deploy dashboard, execute following command:
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.3.1/aio/deploy/recommended.yaml
To access dashboard, execute following command:
nohup kubectl proxy &
To create a service account, execute following command:
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard
EOF
To create a cluster role binding, execute following command:
cat <<EOF | kubectl apply -f -
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
To get a token, execute following command:
kubectl -n kubernetes-dashboard get secret $(kubectl -n kubernetes-dashboard get sa/admin-user -o jsonpath="{.secrets[0].name}") -o go-template="{{.data.token | base64decode}}"
Now access dashboard at:
You can add a skip button in the login page by following these steps:
- Switch namespace to kubernetes-dashboard.
- Edit the deployments named kubernetes-dashboard.
- Add
- '--enable-skip-login'
in.spec.template.spec.containers.args
.
To install the metrics server, execute following command:
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
To disable certificate validation by following these steps:
- Switch namespace to kube-system.
- Edit the deployments named metrics-server.
- Add
- '--kubelet-insecure-tls'
in.spec.template.spec.containers.args
.