を追加lwolfからの答えに基づいて、私はthe kubernetes-dashboard.yamlを使い、デフォルトの名前空間でスレーブ上で実行するように変更しました。
重要な変更点は、kind: ClusterRole, name: view
の部分です。ビューロールをダッシュボードユーザーに割り当てます。
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
k8s-app: kubernetes-dashboard
name: ro-dashboard
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: ro-dashboard
labels:
k8s-app: kubernetes-dashboard
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: view
subjects:
- kind: ServiceAccount
name: ro-dashboard
apiGroup: ''
namespace: default
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
labels:
k8s-app: kubernetes-dashboard
name: ro-dashboard
spec:
replicas: 1
revisionHistoryLimit: 0
selector:
matchLabels:
k8s-app: kubernetes-dashboard
template:
metadata:
labels:
k8s-app: kubernetes-dashboard
spec:
containers:
- name: kubernetes-dashboard
image: gcr.io/google_containers/kubernetes-dashboard-amd64:v1.6.3
ports:
- containerPort: 9090
protocol: TCP
livenessProbe:
httpGet:
path:/
port: 9090
initialDelaySeconds: 30
timeoutSeconds: 30
serviceAccountName: ro-dashboard
---
kind: Service
apiVersion: v1
metadata:
labels:
k8s-app: kubernetes-dashboard
name: ro-dashboard
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: 9090
selector:
k8s-app: kubernetes-dashboard
ダッシュボードでも秘密を作成する必要があるため、これはもう機能しません – VsMaX