kind: Ingress
apiVersion: extensions/v1beta1
metadata:name: dashboard
namespace: kube-system
annotations:kubernetes.io/ingress.class: traefik
#ingress.kubernetes.io/ssl-passthrough: "true"spec:rules:-host: dashboard.digitalgd.com
http:paths:-backend:serviceName: kubernetes-dashboard
servicePort:9090 #ingress 指向http端口path: /
---kind: Service
apiVersion: v1
metadata:labels:k8s-app: kubernetes-dashboard
kubernetes.io/cluster-service:"true"name: kubernetes-dashboard
namespace: kube-system
spec:ports:-port:443targetPort:8443name: ssl
#service 增加http配置 -port:9090 name: http
targetPort:9090selector:k8s-app: kubernetes-dashboard
# type: NodePorttype: ClusterIP
---kind: Deployment
apiVersion: apps/v1
metadata:labels:k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kube-system
spec:replicas:1revisionHistoryLimit:10selector:matchLabels:k8s-app: kubernetes-dashboard
template:metadata:labels:k8s-app: kubernetes-dashboard
spec:containers:-name: kubernetes-dashboard
image: kubernetesui/dashboard:v2.0.0-rc3
ports:-containerPort:8443protocol: TCP
#增加http端口 -containerPort:9090protocol: TCP
args:#- --auto-generate-certificates---namespace=kube-system
#增加以下三行配置,使支持http---enable-insecure-login
---insecure-port=9090
---enable-skip-login
# 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-certs
mountPath: /certs
# Create on-disk volume to store exec logs-mountPath: /tmp
name: tmp-volume
livenessProbe:httpGet:scheme: HTTPS
path: /
port:8443#增加http的healthcheck httpGet:scheme: HTTP
port:9090initialDelaySeconds:30timeoutSeconds:30securityContext:allowPrivilegeEscalation:falsereadOnlyRootFilesystem:truerunAsUser:1001runAsGroup:2001volumes:-name: kubernetes-dashboard-certs
secret:secretName: kubernetes-dashboard-certs
-name: tmp-volume
emptyDir:{}serviceAccountName: kubernetes-dashboard
nodeSelector:"beta.kubernetes.io/os": linux
# Comment the following tolerations if Dashboard must not be deployed on mastertolerations:-key: node-role.kubernetes.io/master
effect: NoSchedule