dashboard是k8s的web页面工具
资源下载并解压
wget https://www.qstack.com.cn/dashboard.zip
unzip dashboard.zip
有两个文件 dashboard-deploy.yaml dashboard-svc.yaml
修改配置文件
vim dashboard-deploy.yaml
第19行,镜像地址改为公网的
第31行,apiserver改为自己的地址
1 apiVersion: extensions/v1beta1
2 kind: Deployment
3 metadata:
4 # Keep the name in sync with image version and
5 # gce/coreos/kube-manifests/addons/dashboard counterparts
6 name: kubernetes-dashboard-latest
7 namespace: kube-system
8 spec:
9 replicas: 1
10 template:
11 metadata:
12 labels:
13 k8s-app: kubernetes-dashboard
14 version: latest
15 kubernetes.io/cluster-service: "true"
16 spec:
17 containers:
18 - name: kubernetes-dashboard
19 image: kubernetes-dashboard-amd64:v1.4.1
20 resources:
21 # keep request = limit to keep this container in guaranteed class
22 limits:
23 cpu: 100m
24 memory: 50Mi
25 requests:
26 cpu: 100m
27 memory: 50Mi
28 ports:
29 - containerPort: 9090
30 args:
31 - --apiserver-host=http://192.168.1.23:8080
32 livenessProbe:
33 httpGet:
34 path: /
35 port: 9090
36 initialDelaySeconds: 30
37 timeoutSeconds: 30
docker pull kubernetes-dashboard-amd64:v1.4.1
下载镜像
创建这两个文件
kubectl create -f dashboard-deploy.yaml
kubectl create -f dashboard-svc.yaml
查看运行情况
kubectl get all --namespace=kube-system
访问192.168.1.23:8080出现以下路径
访问192.168.1.23:8080/ui
此时就部署完成。