kubernetes-dashboard-arm.yaml 3.9 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
  # Allow Dashboard to get, update and delete Dashboard exclusive secrets.
45 46 47 48
- apiGroups: [""]
  resources: ["secrets"]
  resourceNames: ["kubernetes-dashboard-key-holder"]
  verbs: ["get", "update", "delete"]
49 50 51 52 53
  # Allow Dashboard to get and update 'kubernetes-dashboard-settings' config map.
- apiGroups: [""]
  resources: ["configmaps"]
  resourceNames: ["kubernetes-dashboard-settings"]
  verbs: ["get", "update"]
54 55 56 57 58 59
  # Allow Dashboard to get metrics from heapster.
- apiGroups: [""]
  resources: ["services"]
  resourceNames: ["heapster"]
  verbs: ["proxy"]
---
M
Marcin Maciaszczyk 已提交
60
apiVersion: rbac.authorization.k8s.io/v1
61 62 63 64
kind: RoleBinding
metadata:
  name: kubernetes-dashboard-minimal
  namespace: kube-system
65 66
roleRef:
  apiGroup: rbac.authorization.k8s.io
67 68
  kind: Role
  name: kubernetes-dashboard-minimal
69 70
subjects:
- kind: ServiceAccount
71
  name: kubernetes-dashboard
72
  namespace: kube-system
73

74
---
75 76
# ------------------- Dashboard Deployment ------------------- #

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

125
---
126 127
# ------------------- Dashboard Service ------------------- #

128 129 130 131
kind: Service
apiVersion: v1
metadata:
  labels:
132 133
    k8s-app: kubernetes-dashboard
  name: kubernetes-dashboard
134 135 136
  namespace: kube-system
spec:
  ports:
137
  - port: 80
138 139
    targetPort: 9090
  selector:
140
    k8s-app: kubernetes-dashboard