kubernetes-dashboard.yaml 2.7 KB
Newer Older
B
bryk 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14
# Copyright 2015 Google Inc. All Rights Reserved.
#
# 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.

15 16
# Configuration to deploy release version of the Dashboard UI compatible with
# Kubernetes 1.6 (RBAC enabled).
B
bryk 已提交
17 18 19
#
# Example usage: kubectl create -f <this_file>

20 21 22 23
apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
24
    k8s-app: kubernetes-dashboard
25 26 27 28 29 30 31 32
  name: kubernetes-dashboard
  namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
  name: kubernetes-dashboard
  labels:
33
    k8s-app: kubernetes-dashboard
34 35 36 37 38 39 40 41 42
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: kubernetes-dashboard
  namespace: kube-system
---
P
Puja 已提交
43 44 45 46
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
  labels:
47
    k8s-app: kubernetes-dashboard
P
Puja 已提交
48 49 50 51
  name: kubernetes-dashboard
  namespace: kube-system
spec:
  replicas: 1
52
  revisionHistoryLimit: 10
P
Puja 已提交
53 54
  selector:
    matchLabels:
55
      k8s-app: kubernetes-dashboard
P
Puja 已提交
56 57 58
  template:
    metadata:
      labels:
59
        k8s-app: kubernetes-dashboard
P
Puja 已提交
60 61 62
    spec:
      containers:
      - name: kubernetes-dashboard
63
        image: gcr.io/google_containers/kubernetes-dashboard-amd64:v1.6.3
P
Puja 已提交
64 65 66 67 68 69 70 71 72 73 74 75 76 77
        ports:
        - containerPort: 9090
          protocol: TCP
        args:
          # 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:port
        livenessProbe:
          httpGet:
            path: /
            port: 9090
          initialDelaySeconds: 30
          timeoutSeconds: 30
78 79 80 81 82
      serviceAccountName: kubernetes-dashboard
      # Comment the following tolerations if Dashboard must not be deployed on master
      tolerations:
      - key: node-role.kubernetes.io/master
        effect: NoSchedule
P
Puja 已提交
83 84 85 86 87
---
kind: Service
apiVersion: v1
metadata:
  labels:
88
    k8s-app: kubernetes-dashboard
P
Puja 已提交
89 90 91 92 93 94 95
  name: kubernetes-dashboard
  namespace: kube-system
spec:
  ports:
  - port: 80
    targetPort: 9090
  selector:
96
    k8s-app: kubernetes-dashboard