kubernetes-dashboard-arm.yaml 4.5 KB
Newer Older
C
Christoph Held 已提交
1
# Copyright 2017 The Kubernetes Authors.
B
bryk 已提交
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 17 18 19 20 21 22 23 24 25 26
# ------------------- Dashboard Secret ------------------- #

apiVersion: v1
kind: Secret
metadata:
  labels:
    k8s-app: kubernetes-dashboard
  name: kubernetes-dashboard-certs
  namespace: kube-system
type: Opaque

---
27 28
# ------------------- Dashboard Service Account ------------------- #

B
bryk 已提交
29
apiVersion: v1
30 31 32
kind: ServiceAccount
metadata:
  labels:
33 34
    k8s-app: kubernetes-dashboard
  name: kubernetes-dashboard
35
  namespace: kube-system
36

37
---
38 39 40
# ------------------- Dashboard Role & Role Binding ------------------- #

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

88
---
89 90
# ------------------- Dashboard Deployment ------------------- #

91
kind: Deployment
S
Sebastian Florek 已提交
92
apiVersion: apps/v1
93 94
metadata:
  labels:
95 96
    k8s-app: kubernetes-dashboard
  name: kubernetes-dashboard
97 98 99 100 101 102
  namespace: kube-system
spec:
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
103
      k8s-app: kubernetes-dashboard
104 105 106
  template:
    metadata:
      labels:
107
        k8s-app: kubernetes-dashboard
108 109
    spec:
      containers:
110
      - name: kubernetes-dashboard
S
Sebastian Florek 已提交
111
        image: k8s.gcr.io/kubernetes-dashboard-arm:v1.10.1
112
        ports:
113
        - containerPort: 8443
114 115
          protocol: TCP
        args:
M
Marcin Maciaszczyk 已提交
116
          - --auto-generate-certificates
117 118 119 120
          # 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
121 122 123
        volumeMounts:
        - name: kubernetes-dashboard-certs
          mountPath: /certs
124 125 126
          # Create on-disk volume to store exec logs
        - mountPath: /tmp
          name: tmp-volume
127 128
        livenessProbe:
          httpGet:
129
            scheme: HTTPS
130
            path: /
131
            port: 8443
132 133
          initialDelaySeconds: 30
          timeoutSeconds: 30
134 135 136 137
      volumes:
      - name: kubernetes-dashboard-certs
        secret:
          secretName: kubernetes-dashboard-certs
138 139
      - name: tmp-volume
        emptyDir: {}
140
      serviceAccountName: kubernetes-dashboard
141 142 143 144
      # Comment the following tolerations if Dashboard must not be deployed on master
      tolerations:
      - key: node-role.kubernetes.io/master
        effect: NoSchedule
145

146
---
147 148
# ------------------- Dashboard Service ------------------- #

149 150 151 152
kind: Service
apiVersion: v1
metadata:
  labels:
153 154
    k8s-app: kubernetes-dashboard
  name: kubernetes-dashboard
155 156 157
  namespace: kube-system
spec:
  ports:
158 159
    - port: 443
      targetPort: 8443
160
  selector:
161
    k8s-app: kubernetes-dashboard