标签:pat aml ash cto live run das its 默认
kubernetes dashboard是k8s的web管理界面
k8s的版本为1.5
[root@master dashboard]# cat dashboard-controller.yaml apiVersion: extensions/v1beta1 kind: Deployment metadata: # Keep the name in sync with image version and # gce/coreos/kube-manifests/addons/dashboard counterparts name: kubernetes-dashboard-latest namespace: kube-system spec: replicas: 1 template: metadata: labels: k8s-app: kubernetes-dashboard version: latest kubernetes.io/cluster-service: "true" spec: containers: - name: kubernetes-dashboard image: bestwu/kubernetes-dashboard-amd64:v1.6.3 resources: # keep request = limit to keep this container in guaranteed class limits: cpu: 100m memory: 50Mi requests: cpu: 100m memory: 50Mi ports: - containerPort: 9090 args: - --apiserver-host=http://192.168.2.17:8080 livenessProbe: httpGet: path: / port: 9090 initialDelaySeconds: 30 timeoutSeconds: 30
ps:
上文中的--apiserver-host,这是master的地址
应用该配置文件:
#kubectl apply -f dashboard-controller.yaml
[root@master dashboard]# cat dashboard-service.yaml kind: Service metadata: name: kubernetes-dashboard namespace: kube-system labels: k8s-app: kubernetes-dashboard kubernetes.io/cluster-service: "true" spec: selector: k8s-app: kubernetes-dashboard ports: - port: 80 targetPort: 9090
应用该配置文件:
#kubectl apply -f dashboard-service.yaml
[root@master dashboard]# kubectl get pods -n=kube-system NAME READY STATUS RESTARTS AGE kubernetes-dashboard-3708984300-cx0cz 1/1 Running 0 5h [root@master dashboard]# kubectl get svc -n=kube-system NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE kubernetes-dashboard 10.254.46.214 <none> 80/TCP 25m
[root@master ingress]# cat kubernetes-dashboard-ingress.yaml apiVersion: extensions/v1beta1 kind: Ingress metadata: name: dashboard-ui-ingress namespace: kube-system spec: rules: - host: ui.k8.ingress http: paths: - path: / backend: serviceName: kubernetes-dashboard servicePort: 80
ps
注意namespace,并不是默认值
应用配置文件
#kubectl apply -f kubernetes-dashboard-ingress.yaml
[root@master dashboard]# kubectl get ingress -n=kube-system NAME HOSTS ADDRESS PORTS AGE dashboard-ui-ingress ui.k8.ingress 192.168.2.26 80 19m
192.168.2.26 ui.k8.ingress
标签:pat aml ash cto live run das its 默认
原文地址:https://www.cnblogs.com/itfenqing/p/10127226.html