kubernetes-dashboard-arm-head.yaml 4.1 KB
Newer Older
C
Christoph Held 已提交
1
# Copyright 2017 The Kubernetes Authors.
2 3 4 5 6 7 8 9 10 11 12 13 14
#
# 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
# ------------------- Dashboard Service Account ------------------- #

17
apiVersion: v1
18 19 20
kind: ServiceAccount
metadata:
  labels:
21
    k8s-app: kubernetes-dashboard-head
22 23
  name: kubernetes-dashboard-head
  namespace: kube-system
24

25
---
26 27 28
# ------------------- Dashboard Role & Role Binding ------------------- #

kind: Role
M
Marcin Maciaszczyk 已提交
29
apiVersion: rbac.authorization.k8s.io/v1
30
metadata:
31 32 33
  name: kubernetes-dashboard-minimal
  namespace: kube-system
rules:
34
  # Allow Dashboard to create 'kubernetes-dashboard-key-holder' secret.
35 36
- apiGroups: [""]
  resources: ["secrets"]
37
  verbs: ["create"]
38 39 40 41
  # Allow Dashboard to create 'kubernetes-dashboard-settings' config map.
- apiGroups: [""]
  resources: ["configmaps"]
  verbs: ["create"]
42
  # Allow Dashboard to get, update and delete Dashboard exclusive secrets.
43 44 45 46
- apiGroups: [""]
  resources: ["secrets"]
  resourceNames: ["kubernetes-dashboard-key-holder"]
  verbs: ["get", "update", "delete"]
47 48 49 50 51
  # Allow Dashboard to get and update 'kubernetes-dashboard-settings' config map.
- apiGroups: [""]
  resources: ["configmaps"]
  resourceNames: ["kubernetes-dashboard-settings"]
  verbs: ["get", "update"]
52 53 54 55 56
  # Allow Dashboard to get metrics from heapster.
- apiGroups: [""]
  resources: ["services"]
  resourceNames: ["heapster"]
  verbs: ["proxy"]
57 58 59 60
- apiGroups: [""]
  resources: ["services/proxy"]
  resourceNames: ["heapster", "http:heapster:", "https:heapster:"]
  verbs: ["get"]
61
---
M
Marcin Maciaszczyk 已提交
62
apiVersion: rbac.authorization.k8s.io/v1
63 64 65 66
kind: RoleBinding
metadata:
  name: kubernetes-dashboard-minimal
  namespace: kube-system
67 68
roleRef:
  apiGroup: rbac.authorization.k8s.io
69 70
  kind: Role
  name: kubernetes-dashboard-minimal
71 72 73 74
subjects:
- kind: ServiceAccount
  name: kubernetes-dashboard-head
  namespace: kube-system
75

76
---
77 78
# ------------------- Dashboard Deployment ------------------- #

79
kind: Deployment
S
Sebastian Florek 已提交
80
apiVersion: apps/v1
81 82
metadata:
  labels:
83
    k8s-app: kubernetes-dashboard-head
84 85 86 87
  name: kubernetes-dashboard-head
  namespace: kube-system
spec:
  replicas: 1
88
  revisionHistoryLimit: 10
89 90
  selector:
    matchLabels:
91
      k8s-app: kubernetes-dashboard-head
92 93 94
  template:
    metadata:
      labels:
95
        k8s-app: kubernetes-dashboard-head
96 97 98 99
    spec:
      containers:
      - name: kubernetes-dashboard-head
        image: kubernetesdashboarddev/kubernetes-dashboard-arm:head
100
        # Image is tagged and updated with :head, so always pull it.
101 102 103 104 105 106 107 108 109
        imagePullPolicy: Always
        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
110 111 112 113
        volumeMounts:
          # Create on-disk volume to store exec logs
        - mountPath: /tmp
          name: tmp-volume
114 115 116 117 118 119
        livenessProbe:
          httpGet:
            path: /
            port: 9090
          initialDelaySeconds: 30
          timeoutSeconds: 30
120 121 122
      volumes:
      - name: tmp-volume
        emptyDir: {}
123 124 125 126 127
      serviceAccountName: kubernetes-dashboard-head
      # Comment the following tolerations if Dashboard must not be deployed on master
      tolerations:
      - key: node-role.kubernetes.io/master
        effect: NoSchedule
128

129
---
130 131
# ------------------- Dashboard Service ------------------- #

132 133 134 135
kind: Service
apiVersion: v1
metadata:
  labels:
136
    k8s-app: kubernetes-dashboard-head
137 138 139 140
  name: kubernetes-dashboard-head
  namespace: kube-system
spec:
  ports:
141
  - port: 80
142 143
    targetPort: 9090
  selector:
144
    k8s-app: kubernetes-dashboard-head