首页 > 其他分享 >k8s 部署dashboard 2.7.0

k8s 部署dashboard 2.7.0

时间:2023-07-26 15:58:01浏览次数:48  
标签:kubernetes created admin dashboard io k8s 2.7 user

查看dashboard版本兼容性

Kubernetes version 1.22 1.23 1.24 1.25
Compatibility ? ? ?

准备dashboard yaml文件

# wget https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml

准备image

# docker pull docker.io/kubernetesui/dashboard:v2.7.0
# docker tag docker.io/kubernetesui/dashboard:v2.7.0 192.168.174.120/baseimages/dashboard:v2.7.0
# docker pull docker.io/kubernetesui/metrics-scraper:v1.0.8
# docker tag docker.io/kubernetesui/metrics-scraper:v1.0.8 192.168.174.120/baseimages/metrics-scraper:v1.0.7
# docker push 192.168.174.120/baseimages/metrics-scraper:v1.0.8
# docker push 192.168.174.120/baseimages/dashboard:v2.7.0

修改yaml文件image地址

# sed -i 's@kubernetesui/dashboard:[email protected]/baseimages/dashboard:v2.7.0@g' recommended.yaml 
# sed -i 's@kubernetesui/metrics-scraper:[email protected]/baseimages/metrics-scraper:v1.0.8@g' recommended.yaml 

开放访问端口

kind: Service
apiVersion: v1
metadata:
  labels:
    k8s-app: kubernetes-dashboard
  name: kubernetes-dashboard
  namespace: kubernetes-dashboard
spec:
  type: NodePort
  ports:
    - port: 443
      targetPort: 8443
      nodePort: 30003
  selector:
    k8s-app: kubernetes-dashboard

部署dashboard

# kubectl apply -f recommended.yaml 
namespace/kubernetes-dashboard created
serviceaccount/kubernetes-dashboard created
service/kubernetes-dashboard created
secret/kubernetes-dashboard-certs created
secret/kubernetes-dashboard-csrf created
secret/kubernetes-dashboard-key-holder created
configmap/kubernetes-dashboard-settings created
role.rbac.authorization.k8s.io/kubernetes-dashboard created
clusterrole.rbac.authorization.k8s.io/kubernetes-dashboard created
rolebinding.rbac.authorization.k8s.io/kubernetes-dashboard created
clusterrolebinding.rbac.authorization.k8s.io/kubernetes-dashboard created
deployment.apps/kubernetes-dashboard created
service/dashboard-metrics-scraper created
deployment.apps/dashboard-metrics-scraper created

查看pod信息

# kubectl get pod -n kubernetes-dashboard -o wide
NAMESPACE              NAME                                        READY   STATUS    RESTARTS   AGE    IP                NODE              NOMINATED NODE   READINESS GATES
kubernetes-dashboard   dashboard-metrics-scraper-c5f49cc44-cdbsn   1/1     Running   0          4m7s   10.200.154.199    192.168.174.106   <none>           <none>
kubernetes-dashboard   kubernetes-dashboard-688994654d-mt7nl       1/1     Running   0          4m7s   10.200.44.193     192.168.174.107   <none>           <none>

创建用户

admin-user.yml 

apiVersion: v1
kind: ServiceAccount
metadata:
  name: admin-user
  namespace: kubernetes-dashboard

---
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 admin-user.yml 
serviceaccount/admin-user created
clusterrolebinding.rbac.authorization.k8s.io/admin-user created

用户token

获取用户dashboard secrets 

# kubectl get secrets -n kubernetes-dashboard | grep admin
kubernetes-dashboard   admin-user-token-jstn9                           kubernetes.io/service-account-token   3      100s

获取用户token

# kubectl describe secrets admin-user-token-jstn9 -n kubernetes-dashboard
Name:         admin-user-token-jstn9
Namespace:    kubernetes-dashboard
Labels:       <none>
Annotations:  kubernetes.io/service-account.name: admin-user
              kubernetes.io/service-account.uid: 62e8da32-d998-4617-b6a1-0415fb9be343

Type:  kubernetes.io/service-account-token

Data
====
ca.crt:     1350 bytes
namespace:  20 bytes
token:      eyJhbGciOiJSUzI1NiIsImtpZCI6ImtKeTgyUUk1Z1B0UHYzdjY4b2J4aFZoYmlESTQxZlozeGoteEw2cmphaUEifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJhZG1pbi11c2VyLXRva2VuLWpzdG45Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQubmFtZSI6ImFkbWluLXVzZXIiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiI2MmU4ZGEzMi1kOTk4LTQ2MTctYjZhMS0wNDE1ZmI5YmUzNDMiLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6a3ViZXJuZXRlcy1kYXNoYm9hcmQ6YWRtaW4tdXNlciJ9.IWp15OTfZdXk_GQrXQB6Xlol-HU9sYKL6P5cb9Klrww_jb2JwnLiwIh4fufIQqFABTrtWkeq5L9gOBdhPMAbIYKVjW2UiDeqBXaMf7nyZ08JVXZsVmaoSesrFIYL4iivdu7lU8C-FZ4hk5b-60FDkkFSdT8ZId3ofS2kSo6candAvY2wGkEj47n5kq78xeaEgj96PGHMqYMoe0VklpPuwi1dlW3vAVgNq7Y5UGmduH4XWpF0kW5LcaykOFojCVv7iGkLNulD9o8hn7WZTrebdlkGK7Z8hcHgBmBmB733Z1dgsb4FrnTMCeeOMywVMZKVPr58XvME1VY9YoDwxBLwIA

kubeconfig

准备kubeconfig文件

# cp /root/.kube/config /tmp/kubeconfig

查看kubeconfig文件

# cat /tmp/kubeconfig
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUR1RENDQXFDZ0F3SUJBZ0lVR0ZpVzMrMzlabGt4Y1dJQzJWRVhUQ3dXVEVJd0RRWUpLb1pJaHZjTkFRRUwKQlFBd1lURUxNQWtHQTFVRUJoTUNRMDR4RVRBUEJnTlZCQWdUQ0VoaGJtZGFhRzkxTVFzd0NRWURWUVFIRXdKWQpVekVNTUFvR0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aSWh2Y05BUUVMQlFBRGdnRUJBTXhuenhDSWtSS1NqNkZFQnRWc0pDR012SlhMCk9Sc05mREFtb1lzbkM1WGJwZFQvV0RVWDFjeTNWNmtqTkZwUlBHcU05enVvNVNQbFJpOHl6ZWM2UkJabUZsZHoKaW0xSG12UEJQYm5WL2lBTkR6dFlEK2NMbytRWkZwcnNMeFZ1KzE3RVRNeSsyODJEWEExdXhITHNxcndsZGVFdQpVOWJwZExEK3FxNHhzQmZ3VmtrL29RUi9ZK2xkTzh3WjAzSDZiczRjZWhBS1NobXBiMUFiblhvQXV1Zm0reXJxCkNPci9xUkVxR1QrWXFIQ3BJNmVOZDN6Tzl5WDNxOGdZTEd3bHMxN2k2SkJSZ1dTNEdHLyszNUE1VnQ2c01ESnYKWjFyK3JXbmZOWWsxbG0yNUpIb3lFeXhYVy9uSGp3aEhEMDBuaVJzbU1HZGNqQjVkNU5iaFF4dlZDaW89Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
    server: https://192.168.174.20:6443
  name: cluster1
contexts:
- context:
    cluster: cluster1
    user: admin
  name: context-cluster1
current-context: context-cluster1
kind: Config
preferences: {}
users:
- name: admin
  user:
    client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUQxekNDQXIrZ0F3SUJBZ0lVY2VnQUpRa0lkWDhwanRlT2NDSzVTZyt2ekFvd0RRWUpLb1pJaHZjTkFRRUwKQlFBd1lURUxNQWtHQTFVRUJoTUNRMDR4RVRBUEJnTlZCQWdUQ0VoaGJtZGFhRzkxTVFzd0NRWURWUVFIRXdKWQpVekVNTUFvR0ExVUVDaE1EYXpoek1ROHdEUVlEVlFRTEV3WlRlWE4wWlcweEV6QVJCZ05WQkFNVENtdDFZbVZ5CmJtVjBaWE13SUJjTk1qRXhNVEV4TURNME1UQXdXaGdQTWpBM01URXdNekF3TXpReE1EQmFNR2N4Q3pBSkJnTlYKQkFZVEFrTk9NUkV3RHdZRFZRUUlFd2hJWV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FxNHhzQmZ3VmtrL29RUi9ZK2xkTzh3WjAzSDZiczRjZWhBS1NobXBiMUFiblhvQXV1Zm0reXJxCkNPci9xUkVxR1QrWXFIQ3BJNmVOZDN6Tzl5WDNxOGdZTEd3bHMxN2k2SkJSZ1dTNEdHLyszNUE1VnQ2c01ESnYKWjFyK3JXbmZOWWsxbG0yNUpIb3lFeXhYVy9uSGp3aEhEMDBuaVJzbU1HZGNqQjVkNU5iaFF4dlZDaW89Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
    server: https://192.168.174.20:6443
  name: cluster1
contexts:
- context:
    cluster: cluster1
    user: admin
  name: context-cluster1
current-context: context-cluster1
kind: Config
preferences: {}
users:
- name: admin
  user:
    client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUQxekNDQXIrZ0F3SUJBZ0lVY2VnQUpRa0lkWDhwanRlT2NDSzVTZyt2ekFvd0RRWUpLb1pJaHZjTkFRRUwKQlFBd1lURUxNQWtHQTFVRUJoTUNRMDR4RVRBUEJnTlZCQWdUQ0VoaGJtZGFhRzkxTVFzd0NRWURWUVFIRXdKWQpVekVNTUFvR0ExVUVDaE1EYXpoek1ROHdEUVlEVlFRTEV3WlRlWE4wWlcweEV6QVJCZ05WQkFNVENtdDFZbVZ5CmJtVjBaWE13SUJjTk1qRXhNVEV4TURNME1UQXdXaGdQTWpBM01URXdNekF3TXpReE1EQmFNR2N4Q3pBSkJnTlYKQkFZVEFrTk9NUkV3RHdZRFZRUUlFd2hJWVc1bldtaHZkVEVMTUFrR0ExVUVCeE1DV0ZNeEZ6QVZCZ05WQkFvVApEbk41YzNSbGJUcHRZWE4wWlhKek1ROHdEUVlEVlFRTEV3WlRlWE4wWlcweERqQU1CZ05WQkFNVEJXRmtiV2x1Ck1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBMXNzNmo0WlpzdWRSOVVSRmJ6RFMKM0p5VXY0ZlFKN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2wGkEj47n5kq78xeaEgj96PGHMqYMoe0VklpPuwi1dlW3vAVgNq7Y5UGmduH4XWpF0kW5LcaykOFojCVv7iGkLNulD9o8hn7WZTrebdlkGK7Z8hcHgBmBmB733Z1dgsb4FrnTMCeeOMywVMZKVPr58XvME1VY9YoDwxBLwIA

访问dashboard

token登录

kubeconfig登录

参考文档

https://github.com/kubernetes/dashboard

https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md

标签:kubernetes,created,admin,dashboard,io,k8s,2.7,user
From: https://www.cnblogs.com/wangguishe/p/17582668.html

相关文章

  • k8s1.20二进制包安装
    集群环境准备主机规划主机IP地址主机名主机角色主机配置软件列表10.58.32.31k8s-master01master,LB2C4Gkube-apiserver、kube-controller-manager、kube-scheduler、etcd、kubelet、kube-proxy、docker,haproxy、keepalived10.58.32.32k8s-master02master,LB......
  • 【容器架构】你知道有 Docker 为什么还要 K8s 吗?
    ......
  • k8s上搭建elasticsearch单节点集群(固定存储)
    因为Elasticsearch需要保持数据在固定的磁盘上,属于有状态的应用服务,因此采用k8s的StatefulSet模式部署。创建PersistentVolumes和Claim#es-persistent-volume.yamlapiVersion:v1kind:PersistentVolumemetadata:name:es-nfs-pvlabels:pv:es-nfs-pvspec:......
  • k8s使用token访问集群apiserver
    exportTOKEN=eyJhbGciOiJSUzI1NiIsImtpZCI6InRjMEs2b2tyVUFjdHZuazNTS1VrM0s3LWFHMlVjek5NTUJnVUVSTTVHQnMifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJzaGlvcmlrbyIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY29......
  • k8s pod,pvc,pv无法删除问题
    一般删除步骤为:先删pod再删pvc最后删pv但是遇到pv始终处于“Terminating”状态,而且delete不掉1、查看pvc被哪个pod使用[root@hadoop03storageclass]#kubectldescribepvcPVC-NAME|grepMountedMountedBy:busybox-deployment-8588b74c4b-vw8jdpvpvc删不掉解决方......
  • 搭建k8s集群
    一、k8smaster部署Master节点上会运行的组件:etcd,kube-apiserver,kube-controller-manager,kuctl,kubeadm.kubelet,kube-proxy,flannel,docker Kubeadm,官方k8s一键部署工具Flannel,网络插件,确保节点间能够互相通信 环境初始化: 1)hosts解析cat>>/etc/hosts <<EOF0.......
  • k8s中删除节点之后再添加节点
    删除节点先标记为不可调度,驱逐节点上的pod#先标记节点$kubectldraincentos7909--delete-emptydir-data--force--ignore-daemonsetsnode/centos7909alreadycordonedWARNING:ignoringDaemonSet-managedPods:kube-flannel/kube-flannel-ds-hnmmg,kube-system/kube......
  • CentOS升级Python到2.7版本
    查看python的版本viewsource1 python-VPython2.4.31.先安装GCCviewsource1 yum-yinstallgcc2.下载Python-2.7.2viewsource1 wgethttp://python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz23.解压Python-2.7.2viewsource1 tar-jxvfPython-2.7.2.tar.bz24.进......
  • kubernets(k8s) 部署1.23.6版本
    kubernets(k8s)部署1.23.6版本环境准备环境介绍操作系统:CentOSLinuxrelease7.6.1810(Core)k8s组件版本:1.23.6docker版本:Dockerversion24.0.4,build3713ee12核CPU、2G内存、20G硬盘节点:(本实验采用虚拟机)k8s-master172.16.100.130    k8s-node1172.16.......
  • k8s遇到的坑
    换源之后出现数字签名错误W:GPG错误:https://mirrors.aliyun.com/kubernetes/aptkubernetes-xenialInRelease:由于没有公钥,无法验证下列签名:NO_PUBKEYB53DC80D13EDEF05E:仓库“https://mirrors.aliyun.com/kubernetes/aptkubernetes-xenialInRelease”没有数字签名。......