kubernetes-dashboard-arm.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.

C
Christoph Held 已提交
15

16
# Configuration to deploy release version of the Dashboard UI compatible with
M
Marcin Maciaszczyk 已提交
17
# Kubernetes 1.8.
18 19 20
#
# Example usage: kubectl create -f <this_file>

21 22
# ------------------- Dashboard Service Account ------------------- #

23
apiVersion: v1
24 25 26
kind: ServiceAccount
metadata:
  labels:
27 28
    k8s-app: kubernetes-dashboard
  name: kubernetes-dashboard
29
  namespace: kube-system
30

31
---
32 33 34
# ------------------- Dashboard Role & Role Binding ------------------- #

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

82
---
83 84
# ------------------- Dashboard Deployment ------------------- #

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

133
---
134 135
# ------------------- Dashboard Service ------------------- #

136 137 138 139
kind: Service
apiVersion: v1
metadata:
  labels:
140 141
    k8s-app: kubernetes-dashboard
  name: kubernetes-dashboard
142 143 144
  namespace: kube-system
spec:
  ports:
145
  - port: 80
146 147
    targetPort: 9090
  selector:
148
    k8s-app: kubernetes-dashboard