-
Notifications
You must be signed in to change notification settings - Fork 54
/
deployment.yaml
107 lines (99 loc) · 3.9 KB
/
deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# Copyright 2019 Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file.
#
# 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.
---
imports: (( &temporary ))
landscape: (( &temporary ))
plugins:
- git: dashboard_git
- helm: dashboard
- kubectl: rbac
- -echo: "==================================================================="
- -echo: (( "Dashboard URL -> " settings.dashboard_url ))
- -echo: "==================================================================="
dashboard_git:
<<: (( .landscape.versions.dashboard ))
files:
- "charts"
dashboard:
kubeconfig: (( landscape.clusters.[0].kubeconfig ))
source: "dashboard_git/repo/charts/gardener-dashboard"
name: "dashboard"
namespace: (( .landscape.namespace ))
values:
apiServerUrl: (( imports.kube_apiserver.export.apiserver_url ))
sessionSecret: (( rand("[:alnum:]", 30) ))
hosts:
- (( imports.identity.export.dashboard_dns ))
image:
repository: (( .dashboard_git.image_repo || ~~ ))
tag: (( .dashboard_git.image_tag || ~~ ))
pullPolicy: (( defined( tag ) -and tag != "latest" ? "IfNotPresent" :"Always" ))
oidc:
issuerUrl: (( imports.identity.export.issuer_url ))
ca: (( imports.cert-controller.export.ca.crt || ~~ ))
redirectUri: (( settings.dashboard_url "/auth/callback" ))
clientSecret: (( imports.identity.export.dashboardClientSecret ))
tlsSecretName: (( imports.cert.export.certificate.secret_name ))
tls: ~
kubeconfig: (( asyaml(imports.kube_apiserver.export.kubeconfig) ))
gitHub: (( .landscape.dashboard.gitHub || ~~ ))
frontendConfig:
<<: (( .landscape.dashboard.frontendConfig || ~ ))
seedCandidateDeterminationStrategy: (( .imports.gardener_virtual.export.gardener.seedCandidateDeterminationStrategy ))
util:
<<: (( &temporary ))
userbindings: ((|users|->map[users|user|->*spec.subject] ))
settings:
dashboard_url: (( "https://" imports.identity.export.dashboard_dns ))
spec:
<<: (( &temporary ))
subject:
<<: (( &template ))
apiGroup: rbac.authorization.k8s.io
kind: User
name: (( user ))
users: (( map[.landscape.identity.users|v|->v.email]))
rbac:
kubeconfig: (( imports.kube_apiserver.export.kubeconfig ))
manifests:
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
garden.sapcloud.io/role: admins
name: garden-administrators
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: garden.sapcloud.io:system:project-member
subjects: (( util.userbindings(spec.users) ))
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: garden.sapcloud.io:system:project-creation
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: garden.sapcloud.io:system:project-creation
subjects: (( util.userbindings(spec.users) ))
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
annotations:
name: garden.sapcloud.io:system:administrators
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: garden.sapcloud.io:system:administrators
subjects: (( util.userbindings(["system:kube-aggregator"] spec.users) ))