【Kubernetes】可视化UI界面Dashboard

安装和配置k8s可视化UI界面

  • 一、安装Dashboard
    • 1.1、上传镜像并解压
    • 1.2、安装dashboard组件
    • 1.3、修改service
    • 1.4、访问dashboard
  • 二、通过Token令牌访问Dashboard
    • 2.1、创建clusterrolebinding
    • 2.2、获取token
    • 2.3、使用token登录
  • 三、通过kubeconfig文件访问Dashboard
    • 3.1、创建cluster集群
    • 3.2、创建credentials
    • 3.3、创建context
    • 3.4、切换context
    • 3.5、导入dashboard-admin.conf文件
  • 四、通过kubernetes-dashboard创建容器

一、安装Dashboard

1.1、上传镜像并解压

将课件中的镜像上传到工作节点,我的工作节点是node01和node02。
然后手动解压。

docker load -i dashboard_2_0_0.tar.gz
docker load -i metrics-scrapter-1-0-1.tar.gz

1.2、安装dashboard组件

上传kubernetes-dashboard.yaml文件并执行。
文件内容如下:

# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.apiVersion: v1
kind: Namespace
metadata:name: kubernetes-dashboard---apiVersion: v1
kind: ServiceAccount
metadata:labels:k8s-app: kubernetes-dashboardname: kubernetes-dashboardnamespace: kubernetes-dashboard---kind: Service
apiVersion: v1
metadata:labels:k8s-app: kubernetes-dashboardname: kubernetes-dashboardnamespace: kubernetes-dashboard
spec:ports:- port: 443targetPort: 8443selector:k8s-app: kubernetes-dashboard---apiVersion: v1
kind: Secret
metadata:labels:k8s-app: kubernetes-dashboardname: kubernetes-dashboard-certsnamespace: kubernetes-dashboard
type: Opaque---apiVersion: v1
kind: Secret
metadata:labels:k8s-app: kubernetes-dashboardname: kubernetes-dashboard-csrfnamespace: kubernetes-dashboard
type: Opaque
data:csrf: ""---apiVersion: v1
kind: Secret
metadata:labels:k8s-app: kubernetes-dashboardname: kubernetes-dashboard-key-holdernamespace: kubernetes-dashboard
type: Opaque---kind: ConfigMap
apiVersion: v1
metadata:labels:k8s-app: kubernetes-dashboardname: kubernetes-dashboard-settingsnamespace: kubernetes-dashboard---kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:labels:k8s-app: kubernetes-dashboardname: kubernetes-dashboardnamespace: kubernetes-dashboard
rules:# Allow Dashboard to get, update and delete Dashboard exclusive secrets.- apiGroups: [""]resources: ["secrets"]resourceNames: ["kubernetes-dashboard-key-holder", "kubernetes-dashboard-certs", "kubernetes-dashboard-csrf"]verbs: ["get", "update", "delete"]# Allow Dashboard to get and update 'kubernetes-dashboard-settings' config map.- apiGroups: [""]resources: ["configmaps"]resourceNames: ["kubernetes-dashboard-settings"]verbs: ["get", "update"]# Allow Dashboard to get metrics.- apiGroups: [""]resources: ["services"]resourceNames: ["heapster", "dashboard-metrics-scraper"]verbs: ["proxy"]- apiGroups: [""]resources: ["services/proxy"]resourceNames: ["heapster", "http:heapster:", "https:heapster:", "dashboard-metrics-scraper", "http:dashboard-metrics-scraper"]verbs: ["get"]---kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:labels:k8s-app: kubernetes-dashboardname: kubernetes-dashboard
rules:# Allow Metrics Scraper to get metrics from the Metrics server- apiGroups: ["metrics.k8s.io"]resources: ["pods", "nodes"]verbs: ["get", "list", "watch"]---apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:labels:k8s-app: kubernetes-dashboardname: kubernetes-dashboardnamespace: kubernetes-dashboard
roleRef:apiGroup: rbac.authorization.k8s.iokind: Rolename: kubernetes-dashboard
subjects:- kind: ServiceAccountname: kubernetes-dashboardnamespace: kubernetes-dashboard---apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:name: kubernetes-dashboard
roleRef:apiGroup: rbac.authorization.k8s.iokind: ClusterRolename: kubernetes-dashboard
subjects:- kind: ServiceAccountname: kubernetes-dashboardnamespace: kubernetes-dashboard---kind: Deployment
apiVersion: apps/v1
metadata:labels:k8s-app: kubernetes-dashboardname: kubernetes-dashboardnamespace: kubernetes-dashboard
spec:replicas: 1revisionHistoryLimit: 10selector:matchLabels:k8s-app: kubernetes-dashboardtemplate:metadata:labels:k8s-app: kubernetes-dashboardspec:containers:- name: kubernetes-dashboardimage: kubernetesui/dashboard:v2.0.0-beta8imagePullPolicy: IfNotPresentports:- containerPort: 8443protocol: TCPargs:- --auto-generate-certificates- --namespace=kubernetes-dashboard# Uncomment the following line to manually specify Kubernetes API server Host# If not specified, Dashboard will attempt to auto discover the API server and connect# to it. Uncomment only if the default does not work.# - --apiserver-host=http://my-address:portvolumeMounts:- name: kubernetes-dashboard-certsmountPath: /certs# Create on-disk volume to store exec logs- mountPath: /tmpname: tmp-volumelivenessProbe:httpGet:scheme: HTTPSpath: /port: 8443initialDelaySeconds: 30timeoutSeconds: 30securityContext:allowPrivilegeEscalation: falsereadOnlyRootFilesystem: truerunAsUser: 1001runAsGroup: 2001volumes:- name: kubernetes-dashboard-certssecret:secretName: kubernetes-dashboard-certs- name: tmp-volumeemptyDir: {}serviceAccountName: kubernetes-dashboardnodeSelector:"beta.kubernetes.io/os": linux# Comment the following tolerations if Dashboard must not be deployed on mastertolerations:- key: node-role.kubernetes.io/mastereffect: NoSchedule---kind: Service
apiVersion: v1
metadata:labels:k8s-app: dashboard-metrics-scrapername: dashboard-metrics-scrapernamespace: kubernetes-dashboard
spec:ports:- port: 8000targetPort: 8000selector:k8s-app: dashboard-metrics-scraper---kind: Deployment
apiVersion: apps/v1
metadata:labels:k8s-app: dashboard-metrics-scrapername: dashboard-metrics-scrapernamespace: kubernetes-dashboard
spec:replicas: 1revisionHistoryLimit: 10selector:matchLabels:k8s-app: dashboard-metrics-scrapertemplate:metadata:labels:k8s-app: dashboard-metrics-scraperannotations:seccomp.security.alpha.kubernetes.io/pod: 'runtime/default'spec:containers:- name: dashboard-metrics-scraperimage: kubernetesui/metrics-scraper:v1.0.1imagePullPolicy: IfNotPresentports:- containerPort: 8000protocol: TCPlivenessProbe:httpGet:scheme: HTTPpath: /port: 8000initialDelaySeconds: 30timeoutSeconds: 30volumeMounts:- mountPath: /tmpname: tmp-volumesecurityContext:allowPrivilegeEscalation: falsereadOnlyRootFilesystem: truerunAsUser: 1001runAsGroup: 2001serviceAccountName: kubernetes-dashboardnodeSelector:"beta.kubernetes.io/os": linux# Comment the following tolerations if Dashboard must not be deployed on mastertolerations:- key: node-role.kubernetes.io/mastereffect: NoSchedulevolumes:- name: tmp-volumeemptyDir: {}

kubectl apply -f kubernetes-dashboard.yaml
kubectl get pods -n kubernetes-dashboard
显示结果如下,代表安装成功:

[root@master dashboard]# kubectl apply -f kubernetes-dashboard.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
[root@master dashboard]# kubectl get pods -n kubernetes-dashboard
NAME                                         READY   STATUS    RESTARTS   AGE
dashboard-metrics-scraper-778b77d469-np56t   1/1     Running   0          5s
kubernetes-dashboard-86899d4bc7-7tll9        1/1     Running   0          5s

1.3、修改service

# 查看dashboard前端的service
[root@master dashboard]# kubectl get svc -n kubernetes-dashboard
NAME                        TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)    AGE
dashboard-metrics-scraper   ClusterIP   10.1.91.83     <none>        8000/TCP   3m27s
kubernetes-dashboard        ClusterIP   10.1.135.105   <none>        443/TCP    3m27s
# 修改service type类型变成NodePort
[root@master dashboard]# kubectl edit svc kubernetes-dashboard -n kubernetes-dashboard
service/kubernetes-dashboard edited
[root@master dashboard]# kubectl get svc -n kubernetes-dashboard
NAME                        TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)         AGE
dashboard-metrics-scraper   ClusterIP   10.1.91.83     <none>        8000/TCP        4m50s
kubernetes-dashboard        NodePort    10.1.135.105   <none>        443:32291/TCP   4m50s

1.4、访问dashboard

上面可看到service类型是NodePort,访问任何一个工作节点ip: 32291端口即可访问kubernetes dashboard,在浏览器(使用火狐浏览器)访问如下地址:
https://10.32.1.147:32291/
在这里插入图片描述

二、通过Token令牌访问Dashboard

2.1、创建clusterrolebinding

创建管理员token,具有查看任何空间的权限,可以管理所有资源对象

# 创建 ClusterRoleBinding,名称为dashboard-cluster-admin
# 将Kubernetes Dashboard 的 ServiceAccount (kubernetes-dashboard名称空间下的kubernetes-dashboard这个sa)分配给集群角色 cluster-admin
# 目的:赋予 Dashboard 访问和管理整个集群的权限
[root@master dashboard]# kubectl create clusterrolebinding dashboard-cluster-admin --clusterrole=cluster-admin --serviceaccount=kubernetes-dashboard:kubernetes-dashboard
clusterrolebinding.rbac.authorization.k8s.io/dashboard-cluster-admin created

2.2、获取token

找到带有token的kubernetes-dashboard-token-dxqqq

[root@master dashboard]# kubectl get secret -n kubernetes-dashboard
NAME                               TYPE                                  DATA   AGE
default-token-96j7l                kubernetes.io/service-account-token   3      14m
kubernetes-dashboard-certs         Opaque                                0      14m
kubernetes-dashboard-csrf          Opaque                                1      14m
kubernetes-dashboard-key-holder    Opaque                                2      14m
kubernetes-dashboard-token-dxqqq   kubernetes.io/service-account-token   3      14m[root@master dashboard]# kubectl  describe  secret kubernetes-dashboard-token-dxqqq -n   kubernetes-dashboard
Name:         kubernetes-dashboard-token-dxqqq
Namespace:    kubernetes-dashboard
Labels:       <none>
Annotations:  kubernetes.io/service-account.name: kubernetes-dashboardkubernetes.io/service-account.uid: 0f371d4a-899d-4f83-9980-cdc1894b0ebcType:  kubernetes.io/service-account-tokenData
====
ca.crt:     1066 bytes
namespace:  20 bytes
token:      eyJhbGciOiJSUzI1NiIsImtpZCI6IjNQeTlIRF96Rk4yV09iSC1FNG4zeGR0X19VQThPSlNlbEpUeTlfcDRpakUifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJrdWJlcm5ldGVzLWRhc2hib2FyZC10b2tlbi1keHFxcSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjBmMzcxZDRhLTg5OWQtNGY4My05OTgwLWNkYzE4OTRiMGViYyIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDprdWJlcm5ldGVzLWRhc2hib2FyZDprdWJlcm5ldGVzLWRhc2hib2FyZCJ9.jjn9uz-DKUWxS9qfB41rnUoyk0SVtODBW5y8NEskhElU0KSMj487kc3yBbPLqNQPUgrmA27JK_M9PvYwrUJfLZfxkLtr7cquXXmrUcqXrt3Vr-BkNaExAiUFPYYLXPlUAB8J3lGnY4f1J_dxkxLR-OcyEiC--5eOtUKia1WhrENEwQH1Me4iKcWJSOvJeq7fisgLDVGIjHbg3Iz7PaRHWC5TZ5W-05BkuxtScZDwFS7MItfFicfkGM_SFEEQ5Mg_mDoNArJwP_16quG79eei17n7Av73e41CO7fmyk4fMpnyn-oFfa447D9qWBNbI86ou4Z4B-8GP3Lf4ZyyLnJm9w

2.3、使用token登录

记住token后面的值,把下面的token值复制到浏览器token登陆处即可登陆
在这里插入图片描述
点击sing in登陆,显示如下,这次就可以看到和操作任何名称空间的资源了
在这里插入图片描述

三、通过kubeconfig文件访问Dashboard

3.1、创建cluster集群

[root@master dashboard]#  cd /etc/kubernetes/pki
[root@master pki]#  kubectl config set-cluster kubernetes --certificate-authority=./ca.crt --server="https://10。32.1.147:6443" --embed-certs=true --kubeconfig=/root/dashboard-admin.conf
Cluster "kubernetes" set.
[root@master pki]#  cat /root/dashboard-admin.conf
apiVersion: v1
clusters:
- cluster:certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM1ekNDQWMrZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJek1ETXdOakE1TVRNMU1sb1hEVE16TURNd016QTVNVE0xTWxvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTmVnCmNFYUZuTkNVd0hrT3ltOHQ2MlRsUmtxb1VvT1pzdFpIbjdWK3g4dnQxVlR2SldaRkV3YXphNGU1M0FxQUNVaHQKeDVyZksvcGN3T01yR085dk95TU9EMFkza1NYWVR1TDBpUVloRlNZMDVaT0tUdkI3UG5Wb3BueURqRXVBMU80Tgp2TFowZ1RVaWhoMTg2WEtQaGV2T2djMjErU2d5TCtXOHgxQjFoYWtFWFFGc3U2a3ZvWGFnMUU4VVQ2TjZUejJECkJ5MHRqQjNBU3ZuV3hzRHNiSmpLVytIbGhkL2c4dlBURFd5S24rQkdWeWMyb1A1Zkk1T0ZYR0NlVkVTWHUvb0IKNDNsOGQ1SHBvdUY4OTJhRmJjRWc3T0gvTVliS0REOXdYdEdQNXN2a1NNd2x4Z3Y1RUh6MjBKRzNXWlNtQjdFQgpxTHljQzJPeEdiVndQWDIwMGZrQ0F3RUFBYU5DTUVBd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0hRWURWUjBPQkJZRUZCNW00N2V0aEErRkhmZ3orZVhtM0pZSkJwNmVNQTBHQ1NxR1NJYjMKRFFFQkN3VUFBNElCQVFCdlgxWDEra3RZMHFaeEJQNjgvZjZoVlRFVENSdFBmdHluZnJnY0JOcWtDdzhod2M4UgoyMzAyNmM4NVFFbFU4TkdvR09uSGVCWHlSOERTZE4rNndTL1g5aEw5UU9VQTYwNk1aNG9qaktJUE1LQThCNVdDCndrM1llWkFRakhPcmxPTGNUVzNkL0pRSEQ5ZWFNejB3RnI5QmV5eDdwajhlT0FaU0tPT1dLanU4VlB5aUxvK2YKdzRtbXo0OGtzWHNhcGVRZzNHMWFtNi9CT3VzWmxUNHVyc1JxVUhFU1lzaGRFT29MUTRmanoyTml3eEc1VVFMVApTWXg2VE9mSGRRdTFFSENHNzBud0NNU0VMZVZzN2gyc2FQd1g2Rk9XTzg0UUxheXF4bW1YSVY0eGFUeitIUUhtClJ5SURXMm9zWnVYZEVieXNNZ0NFcWRSeklyR0Fjam9ZdlBmOAotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==server: https://10.32.1.147:6443name: kubernetes
contexts: null
current-context: ""
kind: Config
preferences: {}
users: null

3.2、创建credentials

创建credentials需要使用上面的kubernetes-dashboard-token-dxqqq对应的token信息

[root@master pki]# DEF_NS_ADMIN_TOKEN=$(kubectl get secret kubernetes-dashboard-token-dxqqq -n kubernetes-dashboard  -o jsonpath={.data.token}|base64 -d)[root@master pki]# kubectl config set-credentials dashboard-admin --token=$DEF_NS_ADMIN_TOKEN --kubeconfig=/root/dashboard-admin.conf
User "dashboard-admin" set.
[root@master pki]# cat /root/dashboard-admin.conf
apiVersion: v1
clusters:
- cluster:certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM1ekNDQWMrZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJek1ETXdOakE1TVRNMU1sb1hEVE16TURNd016QTVNVE0xTWxvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTmVnCmNFYUZuTkNVd0hrT3ltOHQ2MlRsUmtxb1VvT1pzdFpIbjdWK3g4dnQxVlR2SldaRkV3YXphNGU1M0FxQUNVaHQKeDVyZksvcGN3T01yR085dk95TU9EMFkza1NYWVR1TDBpUVloRlNZMDVaT0tUdkI3UG5Wb3BueURqRXVBMU80Tgp2TFowZ1RVaWhoMTg2WEtQaGV2T2djMjErU2d5TCtXOHgxQjFoYWtFWFFGc3U2a3ZvWGFnMUU4VVQ2TjZUejJECkJ5MHRqQjNBU3ZuV3hzRHNiSmpLVytIbGhkL2c4dlBURFd5S24rQkdWeWMyb1A1Zkk1T0ZYR0NlVkVTWHUvb0IKNDNsOGQ1SHBvdUY4OTJhRmJjRWc3T0gvTVliS0REOXdYdEdQNXN2a1NNd2x4Z3Y1RUh6MjBKRzNXWlNtQjdFQgpxTHljQzJPeEdiVndQWDIwMGZrQ0F3RUFBYU5DTUVBd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0hRWURWUjBPQkJZRUZCNW00N2V0aEErRkhmZ3orZVhtM0pZSkJwNmVNQTBHQ1NxR1NJYjMKRFFFQkN3VUFBNElCQVFCdlgxWDEra3RZMHFaeEJQNjgvZjZoVlRFVENSdFBmdHluZnJnY0JOcWtDdzhod2M4UgoyMzAyNmM4NVFFbFU4TkdvR09uSGVCWHlSOERTZE4rNndTL1g5aEw5UU9VQTYwNk1aNG9qaktJUE1LQThCNVdDCndrM1llWkFRakhPcmxPTGNUVzNkL0pRSEQ5ZWFNejB3RnI5QmV5eDdwajhlT0FaU0tPT1dLanU4VlB5aUxvK2YKdzRtbXo0OGtzWHNhcGVRZzNHMWFtNi9CT3VzWmxUNHVyc1JxVUhFU1lzaGRFT29MUTRmanoyTml3eEc1VVFMVApTWXg2VE9mSGRRdTFFSENHNzBud0NNU0VMZVZzN2gyc2FQd1g2Rk9XTzg0UUxheXF4bW1YSVY0eGFUeitIUUhtClJ5SURXMm9zWnVYZEVieXNNZ0NFcWRSeklyR0Fjam9ZdlBmOAotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==server: https://10.32.1.147:6443name: kubernetes
contexts: null
current-context: ""
kind: Config
preferences: {}
users:
- name: dashboard-adminuser:token: eyJhbGciOiJSUzI1NiIsImtpZCI6IjNQeTlIRF96Rk4yV09iSC1FNG4zeGR0X19VQThPSlNlbEpUeTlfcDRpakUifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJrdWJlcm5ldGVzLWRhc2hib2FyZC10b2tlbi1keHFxcSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjBmMzcxZDRhLTg5OWQtNGY4My05OTgwLWNkYzE4OTRiMGViYyIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDprdWJlcm5ldGVzLWRhc2hib2FyZDprdWJlcm5ldGVzLWRhc2hib2FyZCJ9.jjn9uz-DKUWxS9qfB41rnUoyk0SVtODBW5y8NEskhElU0KSMj487kc3yBbPLqNQPUgrmA27JK_M9PvYwrUJfLZfxkLtr7cquXXmrUcqXrt3Vr-BkNaExAiUFPYYLXPlUAB8J3lGnY4f1J_dxkxLR-OcyEiC--5eOtUKia1WhrENEwQH1Me4iKcWJSOvJeq7fisgLDVGIjHbg3Iz7PaRHWC5TZ5W-05BkuxtScZDwFS7MItfFicfkGM_SFEEQ5Mg_mDoNArJwP_16quG79eei17n7Av73e41CO7fmyk4fMpnyn-oFfa447D9qWBNbI86ou4Z4B-8GP3Lf4ZyyLnJm9w

3.3、创建context

[root@master pki]# kubectl config set-context dashboard-admin@kubernetes --cluster=kubernetes --user=dashboard-admin --kubeconfig=/root/dashboard-admin.conf
Context "dashboard-admin@kubernetes" created.
[root@master pki]# cat /root/dashboard-admin.conf
apiVersion: v1
clusters:
- cluster:certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM1ekNDQWMrZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJek1ETXdOakE1TVRNMU1sb1hEVE16TURNd016QTVNVE0xTWxvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTmVnCmNFYUZuTkNVd0hrT3ltOHQ2MlRsUmtxb1VvT1pzdFpIbjdWK3g4dnQxVlR2SldaRkV3YXphNGU1M0FxQUNVaHQKeDVyZksvcGN3T01yR085dk95TU9EMFkza1NYWVR1TDBpUVloRlNZMDVaT0tUdkI3UG5Wb3BueURqRXVBMU80Tgp2TFowZ1RVaWhoMTg2WEtQaGV2T2djMjErU2d5TCtXOHgxQjFoYWtFWFFGc3U2a3ZvWGFnMUU4VVQ2TjZUejJECkJ5MHRqQjNBU3ZuV3hzRHNiSmpLVytIbGhkL2c4dlBURFd5S24rQkdWeWMyb1A1Zkk1T0ZYR0NlVkVTWHUvb0IKNDNsOGQ1SHBvdUY4OTJhRmJjRWc3T0gvTVliS0REOXdYdEdQNXN2a1NNd2x4Z3Y1RUh6MjBKRzNXWlNtQjdFQgpxTHljQzJPeEdiVndQWDIwMGZrQ0F3RUFBYU5DTUVBd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0hRWURWUjBPQkJZRUZCNW00N2V0aEErRkhmZ3orZVhtM0pZSkJwNmVNQTBHQ1NxR1NJYjMKRFFFQkN3VUFBNElCQVFCdlgxWDEra3RZMHFaeEJQNjgvZjZoVlRFVENSdFBmdHluZnJnY0JOcWtDdzhod2M4UgoyMzAyNmM4NVFFbFU4TkdvR09uSGVCWHlSOERTZE4rNndTL1g5aEw5UU9VQTYwNk1aNG9qaktJUE1LQThCNVdDCndrM1llWkFRakhPcmxPTGNUVzNkL0pRSEQ5ZWFNejB3RnI5QmV5eDdwajhlT0FaU0tPT1dLanU4VlB5aUxvK2YKdzRtbXo0OGtzWHNhcGVRZzNHMWFtNi9CT3VzWmxUNHVyc1JxVUhFU1lzaGRFT29MUTRmanoyTml3eEc1VVFMVApTWXg2VE9mSGRRdTFFSENHNzBud0NNU0VMZVZzN2gyc2FQd1g2Rk9XTzg0UUxheXF4bW1YSVY0eGFUeitIUUhtClJ5SURXMm9zWnVYZEVieXNNZ0NFcWRSeklyR0Fjam9ZdlBmOAotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==server: https://10.32.1.147:6443name: kubernetes
contexts: null
current-context: ""
kind: Config
preferences: {}
users:
- name: dashboard-adminuser:token: eyJhbGciOiJSUzI1NiIsImtpZCI6IjNQeTlIRF96Rk4yV09iSC1FNG4zeGR0X19VQThPSlNlbEpUeTlfcDRpakUifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJrdWJlcm5ldGVzLWRhc2hib2FyZC10b2tlbi1keHFxcSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjBmMzcxZDRhLTg5OWQtNGY4My05OTgwLWNkYzE4OTRiMGViYyIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDprdWJlcm5ldGVzLWRhc2hib2FyZDprdWJlcm5ldGVzLWRhc2hib2FyZCJ9.jjn9uz-DKUWxS9qfB41rnUoyk0SVtODBW5y8NEskhElU0KSMj487kc3yBbPLqNQPUgrmA27JK_M9PvYwrUJfLZfxkLtr7cquXXmrUcqXrt3Vr-BkNaExAiUFPYYLXPlUAB8J3lGnY4f1J_dxkxLR-OcyEiC--5eOtUKia1WhrENEwQH1Me4iKcWJSOvJeq7fisgLDVGIjHbg3Iz7PaRHWC5TZ5W-05BkuxtScZDwFS7MItfFicfkGM_SFEEQ5Mg_mDoNArJwP_16quG79eei17n7Av73e41CO7fmyk4fMpnyn-oFfa447D9qWBNbI86ou4Z4B-8GP3Lf4ZyyLnJm9w
[root@master pki]# kubectl config set-context dashboard-admin@kubernetes --cluster=kubernetes --user=dashboard-admin --kubeconfig=/root/dashboard-admin.conf
Context "dashboard-admin@kubernetes" created.
[root@master pki]# cat /root/dashboard-admin.conf
apiVersion: v1
clusters:
- cluster:certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM1ekNDQWMrZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJek1ETXdOakE1TVRNMU1sb1hEVE16TURNd016QTVNVE0xTWxvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTmVnCmNFYUZuTkNVd0hrT3ltOHQ2MlRsUmtxb1VvT1pzdFpIbjdWK3g4dnQxVlR2SldaRkV3YXphNGU1M0FxQUNVaHQKeDVyZksvcGN3T01yR085dk95TU9EMFkza1NYWVR1TDBpUVloRlNZMDVaT0tUdkI3UG5Wb3BueURqRXVBMU80Tgp2TFowZ1RVaWhoMTg2WEtQaGV2T2djMjErU2d5TCtXOHgxQjFoYWtFWFFGc3U2a3ZvWGFnMUU4VVQ2TjZUejJECkJ5MHRqQjNBU3ZuV3hzRHNiSmpLVytIbGhkL2c4dlBURFd5S24rQkdWeWMyb1A1Zkk1T0ZYR0NlVkVTWHUvb0IKNDNsOGQ1SHBvdUY4OTJhRmJjRWc3T0gvTVliS0REOXdYdEdQNXN2a1NNd2x4Z3Y1RUh6MjBKRzNXWlNtQjdFQgpxTHljQzJPeEdiVndQWDIwMGZrQ0F3RUFBYU5DTUVBd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0hRWURWUjBPQkJZRUZCNW00N2V0aEErRkhmZ3orZVhtM0pZSkJwNmVNQTBHQ1NxR1NJYjMKRFFFQkN3VUFBNElCQVFCdlgxWDEra3RZMHFaeEJQNjgvZjZoVlRFVENSdFBmdHluZnJnY0JOcWtDdzhod2M4UgoyMzAyNmM4NVFFbFU4TkdvR09uSGVCWHlSOERTZE4rNndTL1g5aEw5UU9VQTYwNk1aNG9qaktJUE1LQThCNVdDCndrM1llWkFRakhPcmxPTGNUVzNkL0pRSEQ5ZWFNejB3RnI5QmV5eDdwajhlT0FaU0tPT1dLanU4VlB5aUxvK2YKdzRtbXo0OGtzWHNhcGVRZzNHMWFtNi9CT3VzWmxUNHVyc1JxVUhFU1lzaGRFT29MUTRmanoyTml3eEc1VVFMVApTWXg2VE9mSGRRdTFFSENHNzBud0NNU0VMZVZzN2gyc2FQd1g2Rk9XTzg0UUxheXF4bW1YSVY0eGFUeitIUUhtClJ5SURXMm9zWnVYZEVieXNNZ0NFcWRSeklyR0Fjam9ZdlBmOAotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==server: https://10.32.1.147:6443name: kubernetes
contexts:
- context:cluster: kubernetesuser: dashboard-adminname: dashboard-admin@kubernetes
current-context: ""
kind: Config
preferences: {}
users:
- name: dashboard-adminuser:token: eyJhbGciOiJSUzI1NiIsImtpZCI6IjNQeTlIRF96Rk4yV09iSC1FNG4zeGR0X19VQThPSlNlbEpUeTlfcDRpakUifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJrdWJlcm5ldGVzLWRhc2hib2FyZC10b2tlbi1keHFxcSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjBmMzcxZDRhLTg5OWQtNGY4My05OTgwLWNkYzE4OTRiMGViYyIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDprdWJlcm5ldGVzLWRhc2hib2FyZDprdWJlcm5ldGVzLWRhc2hib2FyZCJ9.jjn9uz-DKUWxS9qfB41rnUoyk0SVtODBW5y8NEskhElU0KSMj487kc3yBbPLqNQPUgrmA27JK_M9PvYwrUJfLZfxkLtr7cquXXmrUcqXrt3Vr-BkNaExAiUFPYYLXPlUAB8J3lGnY4f1J_dxkxLR-OcyEiC--5eOtUKia1WhrENEwQH1Me4iKcWJSOvJeq7fisgLDVGIjHbg3Iz7PaRHWC5TZ5W-05BkuxtScZDwFS7MItfFicfkGM_SFEEQ5Mg_mDoNArJwP_16quG79eei17n7Av73e41CO7fmyk4fMpnyn-oFfa447D9qWBNbI86ou4Z4B-8GP3Lf4ZyyLnJm9w

3.4、切换context

切换context的current-context是dashboard-admin@kubernetes

[root@master pki]# kubectl config use-context dashboard-admin@kubernetes --kubeconfig=/root/dashboard-admin.conf
Switched to context "dashboard-admin@kubernetes".

将/root/dashboard-admin.conf文件下载下来

[root@master pki]# cat /root/dashboard-admin.conf
apiVersion: v1
clusters:
- cluster:certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM1ekNDQWMrZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJek1ETXdOakE1TVRNMU1sb1hEVE16TURNd016QTVNVE0xTWxvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTmVnCmNFYUZuTkNVd0hrT3ltOHQ2MlRsUmtxb1VvT1pzdFpIbjdWK3g4dnQxVlR2SldaRkV3YXphNGU1M0FxQUNVaHQKeDVyZksvcGN3T01yR085dk95TU9EMFkza1NYWVR1TDBpUVloRlNZMDVaT0tUdkI3UG5Wb3BueURqRXVBMU80Tgp2TFowZ1RVaWhoMTg2WEtQaGV2T2djMjErU2d5TCtXOHgxQjFoYWtFWFFGc3U2a3ZvWGFnMUU4VVQ2TjZUejJECkJ5MHRqQjNBU3ZuV3hzRHNiSmpLVytIbGhkL2c4dlBURFd5S24rQkdWeWMyb1A1Zkk1T0ZYR0NlVkVTWHUvb0IKNDNsOGQ1SHBvdUY4OTJhRmJjRWc3T0gvTVliS0REOXdYdEdQNXN2a1NNd2x4Z3Y1RUh6MjBKRzNXWlNtQjdFQgpxTHljQzJPeEdiVndQWDIwMGZrQ0F3RUFBYU5DTUVBd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0hRWURWUjBPQkJZRUZCNW00N2V0aEErRkhmZ3orZVhtM0pZSkJwNmVNQTBHQ1NxR1NJYjMKRFFFQkN3VUFBNElCQVFCdlgxWDEra3RZMHFaeEJQNjgvZjZoVlRFVENSdFBmdHluZnJnY0JOcWtDdzhod2M4UgoyMzAyNmM4NVFFbFU4TkdvR09uSGVCWHlSOERTZE4rNndTL1g5aEw5UU9VQTYwNk1aNG9qaktJUE1LQThCNVdDCndrM1llWkFRakhPcmxPTGNUVzNkL0pRSEQ5ZWFNejB3RnI5QmV5eDdwajhlT0FaU0tPT1dLanU4VlB5aUxvK2YKdzRtbXo0OGtzWHNhcGVRZzNHMWFtNi9CT3VzWmxUNHVyc1JxVUhFU1lzaGRFT29MUTRmanoyTml3eEc1VVFMVApTWXg2VE9mSGRRdTFFSENHNzBud0NNU0VMZVZzN2gyc2FQd1g2Rk9XTzg0UUxheXF4bW1YSVY0eGFUeitIUUhtClJ5SURXMm9zWnVYZEVieXNNZ0NFcWRSeklyR0Fjam9ZdlBmOAotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==server: https://10.32.1.147:6443name: kubernetes
contexts:
- context:cluster: kubernetesuser: dashboard-adminname: dashboard-admin@kubernetes
current-context: dashboard-admin@kubernetes
kind: Config
preferences: {}
users:
- name: dashboard-adminuser:token: eyJhbGciOiJSUzI1NiIsImtpZCI6IjNQeTlIRF96Rk4yV09iSC1FNG4zeGR0X19VQThPSlNlbEpUeTlfcDRpakUifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJrdWJlcm5ldGVzLWRhc2hib2FyZC10b2tlbi1keHFxcSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjBmMzcxZDRhLTg5OWQtNGY4My05OTgwLWNkYzE4OTRiMGViYyIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDprdWJlcm5ldGVzLWRhc2hib2FyZDprdWJlcm5ldGVzLWRhc2hib2FyZCJ9.jjn9uz-DKUWxS9qfB41rnUoyk0SVtODBW5y8NEskhElU0KSMj487kc3yBbPLqNQPUgrmA27JK_M9PvYwrUJfLZfxkLtr7cquXXmrUcqXrt3Vr-BkNaExAiUFPYYLXPlUAB8J3lGnY4f1J_dxkxLR-OcyEiC--5eOtUKia1WhrENEwQH1Me4iKcWJSOvJeq7fisgLDVGIjHbg3Iz7PaRHWC5TZ5W-05BkuxtScZDwFS7MItfFicfkGM_SFEEQ5Mg_mDoNArJwP_16quG79eei17n7Av73e41CO7fmyk4fMpnyn-oFfa447D9qWBNbI86ou4Z4B-8GP3Lf4ZyyLnJm9w

3.5、导入dashboard-admin.conf文件

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

四、通过kubernetes-dashboard创建容器

点开右上角红色箭头标注的 “+”,如下图所示:
在这里插入图片描述
选择Create from form

在这里插入图片描述
注:表单中创建pod时没有创建nodeport的选项,会自动创建在30000+以上的端口。

上面箭头标注的地方填写之后点击Deploy即可完成Pod的创建,如下:
在这里插入图片描述
在这里插入图片描述
访问:http://10.32.1.147:32282/
在这里插入图片描述
关于port、targetport、nodeport的说明:

  • nodeport是集群外流量访问集群内服务的端口,比如客户访问nginx,apache,
  • port是集群内的pod互相通信用的端口类型,比如nginx访问mysql,而mysql是不需要让客户访问到的,port是service的的端口
  • targetport目标端口,也就是最终端口,也就是pod的端口。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/200704.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

21、pytest参数化中标记单独的测试用例

官方实例 # content of test_expectation_xfail import pytestpytest.mark.parametrize("test_input, expected",[("35",8),("24",6),pytest.param("6*9",42,markspytest.mark.xfail)], ) def test_eval(test_input, expected):asser…

基于ssm vue技术的品牌银饰售卖平台源码和论文737

摘 要 本论文主要是针对品牌银饰售卖而开发进行概述&#xff0c;主要包括对研究的背景和研究现状&#xff0c;以及研究目的等的阐述&#xff0c;也对该系统的各种功能要求&#xff0c;对系统结构&#xff0c;数据库的设计等进行讨论。随着科技与技术的发展&#xff0c;利用计…

Qt篇——QChartView实现鼠标滚轮缩放、鼠标拖拽平移、鼠标双击重置缩放平移、曲线点击显示坐标

话不多说。 第一步&#xff1a;自定义QChartView&#xff0c;直接搬 FirtCurveChartView.h #ifndef FITCURVECHARTVIEW_H #define FITCURVECHARTVIEW_H #include <QtCharts>class FitCurveChartView : public QChartView {Q_OBJECTpublic:FitCurveChartView(QWidget *…

MySQL 8.x 自签证书通过keytool和openssl转成JKS文件

一、写在前面 数据库MySQL 8.0 通过自签命令在datadir下生成了所有的证书文件。由于Java的JDK不支持直接加载PEM格式的证书&#xff0c;所以需要将PEM格式证书转换成Java能够直接加载的JKS格式证书。我们需要将根证书ca.pem转换成JKS格式的根证书truststore.jks&#xff0c;将…

把 Windows 11 装进移动硬盘:Windows 11 To Go

本篇文章聊聊如何制作一个可以“说带走就带走”的 Windows 操作系统&#xff0c;将 Windows11 做成能够放在 U 盘或者移动硬盘里的 WinToGo “绿色软件”。 写在前面 在《开源的全能维护 U 盘工具&#xff1a;Ventoy》这篇文章的最后&#xff0c;我提到了一个关键词 “WinToG…

Mybatis XML 配置文件

我们刚开始就有说Mybatis 的开发有两种方式: 1.注释 2.XML 注解和 XML 的方式是可以共存的 我们前面说的都是注释的方式,接下来是XML方式 XML的方式分为三步 : 1.配置数据库(配在 application.yml 里面) 这个跟注释的配置是一样的,username应该都是一样的,password记得写…

6.Eclipse里下载Subclipse插件

方法一&#xff1a;从Eclipse Marketplace里面下载 具体操作&#xff1a;打开Eclipse --> Help --> Eclipse Marketplace --> 在Find中输入subclipse搜索 --> 找到subclipse点击install 方法二&#xff1a;从Install New Software里下载 具体操作&#xff1a;打开…

OSPF浅析

一、预习&#xff1a; 1、优点&#xff1a; 是一种典型的链路状态路由协议&#xff0c;协议号89&#xff0c;把大型网络分隔为多个较小、可管理的单元&#xff1a;Area a.减少LSA泛洪范围&#xff0c;有效地把拓朴变化 控制在区域内&#xff0c;达到网络优化的目的…

nodejs微信小程序+python+PHP本科生优秀作业交流网站的设计与实现-计算机毕业设计推荐

通过软件的需求分析已经获得了系统的基本功能需求&#xff0c;根据需求&#xff0c;将本科生优秀作业交流网站功能模块主要分为管理员模块。管理员添加系统首页、个人中心、用户管理、作业分类管理、作业分享管理、论坛交流、投诉举报、系统管理等操作。 随着信息化社会的形成…

【面试HOT200】二叉树的构建二叉搜索树篇

系列综述&#xff1a; &#x1f49e;目的&#xff1a;本系列是个人整理为了秋招面试的&#xff0c;整理期间苛求每个知识点&#xff0c;平衡理解简易度与深入程度。 &#x1f970;来源&#xff1a;材料主要源于【CodeTopHot200】进行的&#xff0c;每个知识点的修正和深入主要参…

Leetcode 77 组合

题意理解&#xff1a; 给定两个整数 n 和 k&#xff0c;返回范围 [1, n] 中所有可能的 k 个数的组合。 如&#xff1a;n3,k2,则有&#xff1a;12 13 23 一般&#xff0c;我们使用回溯法来解决组合问题。 组合问题没有顺序要求&#xff0c;所以 12 21 是同一个组合&#xff08;如…

黑苹果配置清单

手里的MacBookPro已经快沦为电子垃圾了&#xff0c;平时用MacOS比较多&#xff0c;Window用的比较少&#xff0c;而苹果电脑的价格不管是MacBookPro还是MacMini丐版的便宜但是面对现在Window动不动就64g内存的情况就显得微不足道了&#xff0c;高配的价格直接把我劝退&#xff…

PostgreSql HOT 技术

摘自唐成的《PostgreSQL修炼之道&#xff1a;从小工到专家&#xff08;第2版&#xff09;》。 一、概述 因为多版本的原因&#xff0c;当 PostgreSQL 中更新一行时&#xff0c;实际上原数据行并不会被删除&#xff0c;只是插入了一个新行。如果表上有索引&#xff0c;而更新的…

Leetcode题库(数据库合集)_ 难度:中等

目录 难度&#xff1a;中等1.股票的资本损益2. 当选者3. 页面推荐4. 2016年的投资5. 买下所有产品的人6. 电影评分6. 确认率7. 按分类统计薪水8. 餐馆营业额的变化增长8. 即时食物配送 ①9. 至少有5名直系下属的经理10. 游戏玩法分析11. 好友申请&#xff1a;谁有最多的好友12.…

Qlik 成为网络犯罪的焦点

研究人员警告说&#xff0c;Cactus 勒索软件组织正在利用 Qlik Sense 数据可视化、探索和监控解决方案中的关键漏洞来获得对企业网络的初始访问权限。 今年八月下旬&#xff0c;Qlik Sense 开发人员 针对影响 Windows 版本平台的两个关键漏洞发布了补丁 。 其中一个漏洞 CVE-…

图数据库知识点9 | 大数据框架与图数据架构异同

开门见山&#xff0c;直奔主题&#xff0c;接续前面的知识点&#xff1a; 【图数据库知识点1|图数据库与关系型数据库的区别&#xff1f;】 【图数据库知识点2 | 图思维方式】 【图数据库知识点3 | 图数据库解决了什么问题&#xff1f;】 【图数据库知识点4 | 图计算与图数…

基于Echarts的大数据可视化模板:智慧交通管理

目录 引言智慧交通管理的重要性ECharts在智慧交通中的作用智慧交通管理系统架构系统总体架构数据收集与处理Echarts与大数据可视化Echarts库以及其在大数据可视化领域的应用优势开发过程和所选设计方案模板如何满足管理的特定需求模板功能与特性深入解析模板提供的各项功能模板…

2023美图创造力大会开幕,美图发布AI视觉大模型4.0

12月5-6日&#xff0c;主题为“未来AI设计”的美图创造力大会&#xff08;Meitu Creativity Conference&#xff0c;简称MCC&#xff09;在厦门举行。 本届大会由美图公司与站酷联合举办&#xff0c;聚焦于设计师生态和AI设计趋势。大会现场发布《2023年度AI设计实践报告》&am…

JSON 语法详解:轻松掌握数据结构(下)

&#x1f90d; 前端开发工程师&#xff08;主业&#xff09;、技术博主&#xff08;副业&#xff09;、已过CET6 &#x1f368; 阿珊和她的猫_CSDN个人主页 &#x1f560; 牛客高级专题作者、在牛客打造高质量专栏《前端面试必备》 &#x1f35a; 蓝桥云课签约作者、已在蓝桥云…

查询服务器CPU、内存、磁盘、网络IO、队列、数据库占用空间等等信息

文章目录 摘要1. 查询CPU使用率命令&#xff1a;top -bn1 | grep \"Cpu(s)\" | awk {split($0,arr,\" \");print 100-arr[8]}2. 查询内存命令&#xff08;单位&#xff1a;G&#xff09;&#xff1a;top -bn1 | grep \"KiB Mem\" | awk {split($…