1414apiVersion : v1
1515kind : ConfigMap
1616metadata :
17- name : " {{ .app.harness.service.name }}-gk"
17+ name : " {{ .subdomain }}-gk"
1818 labels :
19- app : " {{ .app.harness.service.name }}-gk"
19+ app : " {{ .subdomain }}-gk"
2020data :
2121 proxy.yml : |-
2222 verbose: {{ .root.Values.debug }}
3737 http-only-cookie: false
3838 tls-cert:
3939 tls-private-key:
40- redirection-url: {{ ternary "https" "http" $tls }}://{{ .app.harness. subdomain }}.{{ .root.Values.domain }}
40+ redirection-url: {{ ternary "https" "http" $tls }}://{{ .subdomain }}.{{ .root.Values.domain }}
4141 encryption-key: AgXa7xRcoClDEU0ZDSH4X0XhL5Qy2Z2j
4242 upstream-url: http://{{ .app.harness.service.name }}.{{ .app.namespace | default .root.Release.Namespace }}:{{ .app.harness.service.port | default 80}}
4343 {{ if .app.harness.secured }}
5050 skip-openid-provider-tls-verify: true
5151 skip-upstream-tls-verify: true
5252 {{- end }}
53+ cors-origins:
54+ - {{ (printf "*.%s" .root.Values.domain) | quote }}
55+ cors-methods:
56+ - GET
57+ - POST
58+ - PUT
59+ - DELETE
60+ - PATCH
61+ cors-headers:
62+ - Authorization
63+ - Content-Type
64+ - Origin
5365 cacert.crt : {{ .files.Get "resources/certs/cacert.crt" | quote }}
5466 access-denied.html.tmpl : |-
5567 <!DOCTYPE html>
@@ -79,47 +91,46 @@ data:
7991 <h2 class="message">403 Permission Denied</h2>
8092 <div class="error-details">
8193 Sorry, you do not have access to this page, please contact your administrator.
82- If you have been assigned new authorizations, try to refresh the page or to <a href="/oauth/logout?redirect=/">login again</a>.
94+ If you are authorized to see this page, please try <a href="/">reload</a> or <a href="/oauth/logout?redirect=/">login again</a>.
8395 </div>
8496 </div>
8597 </div>
8698 </div>
8799 </div>
88-
89100 </body>
90101 </html>
91102 ---
92103apiVersion : v1
93104kind : Service
94105metadata :
95- name : " {{ .app.harness.service.name }}-gk"
106+ name : " {{ .subdomain }}-gk"
96107 labels :
97- app : " {{ .app.harness.service.name }}-gk"
108+ app : " {{ .subdomain }}-gk"
98109spec :
99110 ports :
100111 - name : http
101112 port : 8080
102113 selector :
103- app : " {{ .app.harness.service.name }}-gk"
114+ app : " {{ .subdomain }}-gk"
104115 type : ClusterIP
105116---
106117apiVersion : apps/v1
107118kind : Deployment
108119metadata :
109- name : " {{ .app.harness.service.name }}-gk"
120+ name : " {{ .subdomain }}-gk"
110121 labels :
111- app : " {{ .app.harness.service.name }}-gk"
122+ app : " {{ .subdomain }}-gk"
112123spec :
113124 replicas : 1
114125 selector :
115126 matchLabels :
116- app : " {{ .app.harness.service.name }}-gk"
127+ app : " {{ .subdomain }}-gk"
117128 template :
118129 metadata :
119130 annotations :
120131 checksum/config : {{ .app.harness.uri_role_mapping | toString | sha256sum }}
121132 labels :
122- app : " {{ .app.harness.service.name }}-gk"
133+ app : " {{ .subdomain }}-gk"
123134 spec :
124135{{ include "deploy_utils.etcHosts" .root | indent 6 }}
125136 containers :
@@ -135,13 +146,13 @@ spec:
135146 - name : PROXY_CONFIG_FILE
136147 value : /opt/proxy.yml
137148 volumeMounts :
138- - name : " {{ .app.harness.service.name }}-gk-proxy-config"
149+ - name : " {{ .subdomain }}-gk-proxy-config"
139150 mountPath : /opt/proxy.yml
140151 subPath : proxy.yml
141- - name : " {{ .app.harness.service.name }}-gk-proxy-config"
152+ - name : " {{ .subdomain }}-gk-proxy-config"
142153 mountPath : /etc/pki/ca-trust/source/anchors/cacert.crt
143154 subPath : cacert.crt
144- - name : " {{ .app.harness.service.name }}-gk-proxy-config"
155+ - name : " {{ .subdomain }}-gk-proxy-config"
145156 mountPath : /templates/access-denied.html.tmpl
146157 subPath : access-denied.html.tmpl
147158 ports :
@@ -152,23 +163,28 @@ spec:
152163 resources :
153164 requests :
154165 memory : " 32Mi"
155- cpu : " 50m "
166+ cpu : " 5m "
156167 limits :
157168 memory : " 64Mi"
158169 cpu : " 100m"
159170 volumes :
160- - name : " {{ .app.harness.service.name }}-gk-proxy-config"
171+ - name : " {{ .subdomain }}-gk-proxy-config"
161172 configMap :
162- name : " {{ .app.harness.service.name }}-gk"
173+ name : " {{ .subdomain }}-gk"
163174---
164175{{- end }}
165176{{- if .Values.secured_gatekeepers }}
166177{{ $files := .Files }}
167178{{- range $app := .Values.apps }}
168179 {{- if and (hasKey $app "port") ($app.harness.secured) }}
169180---
170- {{ include "deploy_utils.securedservice" (dict "root" $ "app" $app "files" $files) }}
181+ {{ include "deploy_utils.securedservice" (dict "root" $ "app" $app "files" $files "subdomain" $app.harness.subdomain) }}
182+ {{- end }}
183+ {{- if $app.harness.aliases }}
184+ {{- range $subdomain := $app.harness.aliases }}
185+ {{ include "deploy_utils.securedservice" (dict "root" $ "app" $app "files" $files "subdomain" $subdomain ) }}
171186 {{- end }}
187+ {{- end }}
172188 {{- range $subapp := $app }}
173189 {{- if contains "map" (typeOf $subapp) }}
174190 {{- if and (hasKey $subapp "harness.port") (hasKey $subapp "harness.secured") }}
@@ -180,4 +196,4 @@ spec:
180196 {{- end }}
181197 {{- end }}
182198 {{- end }}
183- {{- end }}
199+ {{- end }}
0 commit comments