kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.4.0/aio/deploy/recommended.yaml
# ...중략...
kind: Service
apiVersion: v1
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kubernetes-dashboard
spec:
type: LoadBalancer
ports:
- port: 443
targetPort: 8443
nodePort: 30011
selector:
k8s-app: kubernetes-dashboard
#...중략...
kubectl get all --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
...중략...
kube-system pod/metrics-server-fb8d4747b-pz5nt 1/1 Running 0 64m
kubernetes-dashboard pod/dashboard-metrics-scraper-7bf7f8bcb8-4jnkz 1/1 Running 0 3d
kubernetes-dashboard pod/kubernetes-dashboard-d89995856-sjwmr 1/1 Running 0 3d
rook-ceph pod/csi-cephfsplugin-h482c 3/3 Running 0 16h
...중략...
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE <notextile>
default service/kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 7d14h
kube-system service/kube-dns ClusterIP 10.96.0.10 <none> 53/UDP,53/TCP,9153/TCP 7d14h
kube-system service/metrics-server ClusterIP 10.102.148.117 <none> 443/TCP 64m
kubernetes-dashboard service/dashboard-metrics-scraper ClusterIP 10.108.25.221 <none> 8000/TCP 3d
kubernetes-dashboard service/kubernetes-dashboard NodePort 10.102.141.70 <none> 443:30443/TCP 17h
rook-ceph service/csi-cephfsplugin-metrics ClusterIP 10.106.110.230 <none> 8080/TCP,8081/TCP 16h
...중략...
NAMESPACE NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
kube-system daemonset.apps/kube-flannel-ds 4 4 4 4 4 <none> 7d14h
kube-system daemonset.apps/kube-proxy 4 4 4 4 4 kubernetes.io/os=linux 7d14h
rook-ceph daemonset.apps/csi-cephfsplugin 3 3 3 3 3 <none> 16h
rook-ceph daemonset.apps/csi-rbdplugin 3 3 3 3 3 <none> 16h </notextile>
NAMESPACE NAME READY UP-TO-DATE AVAILABLE AGE
kube-system deployment.apps/coredns 2/2 2 2 7d14h
kube-system deployment.apps/metrics-server 1/1 1 1 64m
kubernetes-dashboard deployment.apps/dashboard-metrics-scraper 1/1 1 1 3d
kubernetes-dashboard deployment.apps/kubernetes-dashboard 1/1 1 1 3d
rook-ceph deployment.apps/csi-cephfsplugin-provisioner 2/2 2 2 16h
...중략...
NAMESPACE NAME DESIRED CURRENT READY AGE
kube-system replicaset.apps/coredns-78fcd69978 2 2 2 7d14h
kube-system replicaset.apps/metrics-server-fb8d4747b 1 1 1 64m
kubernetes-dashboard replicaset.apps/dashboard-metrics-scraper-7bf7f8bcb8 1 1 1 3d
kubernetes-dashboard replicaset.apps/kubernetes-dashboard-d89995856 1 1 1 3d
...중략...
NAMESPACE NAME COMPLETIONS DURATION AGE
rook-ceph job.batch/rook-ceph-osd-prepare-nodet01 1/1 3s 16h
... 생략...
sudo netstat -nltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
...중략...
tcp 0 0 0.0.0.0:30443 0.0.0.0:* LISTEN 93968/kube-proxy
...생략
로그인을 위해 토큰 생성이 필요하다.
cat <<EOF | kubectl create -f -
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kube-system
EOF
serviceaccount/admin-user created
cat <<EOF | kubectl create -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: kube-system
EOF
clusterrolebinding.rbac.authorization.k8s.io/admin-user created
kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}')
Name: admin-user-token-p9ldd
Namespace: kube-system
Labels: <none>
Annotations: kubernetes.io/service-account.name=admin-user
kubernetes.io/service-account.uid=011cb1ec-11a-49b6-8900-6dc90fc111111
Type: kubernetes.io/service-account-token
Data
====
ca.crt: 1025 bytes
namespace: 11 bytes
token: eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUeyJhbGciOiJSUMC02ZGM5MGZjMDA5bGRkIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQubmFtZSI6ImFkbWluLXVzZXIiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiIwNDFjYjdlYy05NDZhLTQ6jTmjBnduR_bFNP1BqWGl3T1si-FC08a_aNqKbmjUKJ_4SWsSe_DjgUZTawr04C5dtNcBd0o0clQG_nkQFk7Gko2tiFhF0PwdtgSOh29JjlhA-DpbmGwEF5QJ3yS9lADpqRCLJRnsr-t0xLOGPY4u3gNGXq8F4C4vL__PpfY-u5xmFTv-H3Oe6jTmjBnduR_bFNP1BqWGl3T1si-FC08a_aNqKbmjUKJ_4SWsSe_DjgUZTawr04C5dtNcBd0o0clQG_nkQFk7Gko2tiFhF0PwdtgSOh29JjlhAj_vzpd-vUNxMUJ0Y1ulPEfSCAA0pmIjBYpl_oBVMOd8Xkszz3FYC9ij9WevttnFMjxsEL5x6hGQw62OYQkx_YsE-P7db3cG0ieHECScHFp_Z0rg_lXBnDYFtj6hyPlpS7EvcVSRRUBhasPr3GlqHoIycg