@sap/cds-dk 7.2.0 → 7.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/activate.js +2 -2
- package/bin/add.js +1 -1
- package/bin/build.js +6 -3
- package/bin/compile/index.js +9 -5
- package/bin/env.js +0 -3
- package/bin/extend.js +29 -3
- package/bin/import.js +7 -3
- package/bin/init.js +31 -37
- package/bin/push.js +10 -6
- package/bin/repl.js +23 -43
- package/bin/watch.js +5 -9
- package/lib/bind/bindingResolver.js +2 -1
- package/lib/bind/index.js +1 -1
- package/lib/build/{buildTaskHandler.js → buildPlugin.js} +40 -27
- package/lib/build/buildTaskEngine.js +75 -74
- package/lib/build/buildTaskFactory.js +39 -32
- package/lib/build/buildTaskProvider.js +24 -19
- package/lib/build/buildTaskProviderFactory.js +125 -58
- package/lib/build/constants.js +6 -4
- package/lib/build/index.js +7 -3
- package/lib/build/plugins.js +35 -0
- package/lib/build/provider/{buildTaskHandlerEdmx.js → edmxBuildPlugin.js} +11 -7
- package/lib/build/provider/{buildTaskHandlerFeatureToggles.js → featureToggleBuildPlugin.js} +5 -5
- package/lib/build/provider/fiori/index.js +5 -6
- package/lib/build/provider/hana/index.js +54 -30
- package/lib/build/provider/{buildTaskHandlerInternal.js → internalBuildPlugin.js} +14 -10
- package/lib/build/provider/{buildTaskProviderInternal.js → internalBuildTaskProvider.js} +27 -28
- package/lib/build/provider/java/index.js +30 -24
- package/lib/build/provider/mtx/index.js +4 -4
- package/lib/build/provider/mtx/resourcesTarBuilder.js +8 -8
- package/lib/build/provider/mtx-extension/index.js +17 -9
- package/lib/build/provider/mtx-sidecar/index.js +17 -11
- package/lib/build/provider/nodejs/index.js +14 -13
- package/lib/build/util.js +5 -0
- package/lib/client/auth_manager.js +6 -12
- package/lib/client/base_command.js +1 -1
- package/lib/client/download_legacy.js +43 -0
- package/lib/client/params.js +6 -0
- package/lib/client/push.js +41 -1
- package/lib/client/settings_manager.js +28 -17
- package/lib/compile/openapi/csdl2openapi.js +1 -1
- package/lib/env/schema.js +36 -0
- package/lib/env/schemas/cds-rc.json +101 -0
- package/lib/import/common.js +23 -10
- package/lib/import/importapi.js +2 -2
- package/lib/import/message.js +3 -1
- package/lib/import/odata/v4parser.js +23 -7
- package/lib/index.js +11 -0
- package/lib/init/constants.js +5 -2
- package/lib/init/index.js +2 -3
- package/lib/init/template/_merging/registry-mta.js +33 -0
- package/lib/init/template/approuter/files/mta.yaml.hbs +1 -1
- package/lib/init/template/approuter/index.js +9 -9
- package/lib/init/template/connectivity/index.js +5 -4
- package/lib/init/template/destination/index.js +2 -5
- package/lib/init/template/helm/subcharts/content-deployment/Chart.yaml +4 -4
- package/lib/init/template/helm/subcharts/content-deployment/templates/_helpers.tpl +4 -2
- package/lib/init/template/helm/subcharts/content-deployment/templates/job.yaml +4 -3
- package/lib/init/template/helm/subcharts/content-deployment/values.schema.json +9 -83
- package/lib/init/template/helm/subcharts/content-deployment/values.yaml +54 -15
- package/lib/init/template/helm/subcharts/service-instance/Chart.yaml +4 -4
- package/lib/init/template/helm/subcharts/service-instance/templates/serviceinstance.yaml +1 -1
- package/lib/init/template/helm/subcharts/service-instance/values.schema.json +0 -17
- package/lib/init/template/helm/subcharts/service-instance/values.yaml +28 -0
- package/lib/init/template/helm/subcharts/web-application/Chart.yaml +5 -5
- package/lib/init/template/helm/subcharts/web-application/templates/_api.tpl +60 -0
- package/lib/init/template/helm/subcharts/web-application/templates/_helpers.tpl +34 -73
- package/lib/init/template/helm/subcharts/web-application/templates/api-rule.yaml +4 -4
- package/lib/init/template/helm/subcharts/web-application/templates/deployment.yaml +96 -17
- package/lib/init/template/helm/subcharts/web-application/templates/network-policy.yaml +19 -3
- package/lib/init/template/helm/subcharts/web-application/templates/pod-disruption-budget.yaml +3 -3
- package/lib/init/template/helm/subcharts/web-application/templates/rbac.yaml +26 -0
- package/lib/init/template/helm/subcharts/web-application/templates/secret.yaml +1 -1
- package/lib/init/template/helm/subcharts/web-application/templates/service-account.yaml +1 -1
- package/lib/init/template/helm/subcharts/web-application/templates/service-binding.yaml +1 -1
- package/lib/init/template/helm/subcharts/web-application/templates/service.yaml +21 -3
- package/lib/init/template/helm/subcharts/web-application/templates/virtual-service.yaml +36 -0
- package/lib/init/template/helm/subcharts/web-application/values.schema.json +535 -142
- package/lib/init/template/helm/subcharts/web-application/values.yaml +168 -44
- package/lib/init/template/html5-repo/index.js +27 -3
- package/lib/init/template/mta/index.js +9 -3
- package/lib/init/template/nodejs/files/.vscode/launch.json +0 -3
- package/lib/init/template/notifications/files/mta.yaml.hbs +17 -0
- package/lib/init/template/notifications/files/notificationtypes.json.hbs +16 -0
- package/lib/init/template/notifications/files/package.json.hbs +14 -0
- package/lib/init/template/notifications/index.js +52 -0
- package/lib/init/template/postgres/files/mta.yaml.hbs +27 -0
- package/lib/init/template/postgres/files/package.json.hbs +5 -0
- package/lib/init/template/postgres/index.js +52 -0
- package/lib/init/util/projectReader.js +0 -1
- package/lib/util/pruneAxiosErrors.js +25 -8
- package/lib/util/term.js +1 -2
- package/lib/watch/livereload-server.js +38 -2
- package/lib/watch/node-watch.js +3 -2
- package/npm-shrinkwrap.json +334 -335
- package/package.json +2 -2
- package/lib/init/template/helm/subcharts/content-deployment/templating.md +0 -37
- package/lib/init/template/helm/subcharts/content-deployment/values-lint.yaml +0 -5
- package/lib/init/template/helm/subcharts/content-deployment/values.md +0 -1011
- package/lib/init/template/helm/subcharts/service-instance/templating.md +0 -18
- package/lib/init/template/helm/subcharts/service-instance/values-lint.yaml +0 -2
- package/lib/init/template/helm/subcharts/service-instance/values.md +0 -186
- package/lib/init/template/helm/subcharts/web-application/templating.md +0 -51
- package/lib/init/template/helm/subcharts/web-application/values-lint.yaml +0 -8
- package/lib/init/template/helm/subcharts/web-application/values.md +0 -1363
|
@@ -1,15 +1,43 @@
|
|
|
1
|
+
# Will be used instead of the `.Chart.Name`, e.g. when generating the Deployment name.
|
|
2
|
+
# nameOverride: foo
|
|
3
|
+
|
|
4
|
+
# Will be used as an override for the `.fullname` helper function (i.e. `.Release.Name-.Chart.Name`).
|
|
5
|
+
# fullnameOverride: foo
|
|
6
|
+
|
|
7
|
+
# The name of the SAP BTP service offering.
|
|
1
8
|
# serviceOfferingName: feature-flags
|
|
9
|
+
|
|
10
|
+
# The plan to use for the service instance.
|
|
2
11
|
# servicePlanName: plan-name
|
|
12
|
+
|
|
13
|
+
# The name for the service instance in SAP BTP.
|
|
3
14
|
# externalName: feature-flags-test
|
|
15
|
+
|
|
16
|
+
# List of custom tags describing the ServiceInstance, will be copied to `ServiceBinding` secret in the key called `tags`.
|
|
4
17
|
# customTags:
|
|
5
18
|
# - foo
|
|
6
19
|
# - bar
|
|
20
|
+
|
|
21
|
+
# Some services support the provisioning of additional configuration parameters. For the list of supported parameters, check the documentation of the particular service offering.
|
|
7
22
|
# parameters:
|
|
8
23
|
# key: val
|
|
24
|
+
|
|
25
|
+
# Some services support the provisioning of additional configuration parameters. For the list of supported parameters, check the documentation of the particular service offering.
|
|
26
|
+
# jsonParameters: {}
|
|
27
|
+
|
|
28
|
+
# Kubernetes Secret as a parameters source.
|
|
9
29
|
# parametersFrom:
|
|
30
|
+
# https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/#define-container-environment-variables-using-secret-data
|
|
10
31
|
# - secretKeyRef:
|
|
11
32
|
# name: my-secret
|
|
12
33
|
# key: secret-parameter
|
|
34
|
+
# https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#define-container-environment-variables-using-configmap-data
|
|
13
35
|
# - configMapKeyRef:
|
|
14
36
|
# name: my-cm
|
|
15
37
|
# key: cm-parameter
|
|
38
|
+
global:
|
|
39
|
+
sap:
|
|
40
|
+
_internal:
|
|
41
|
+
service-instance:
|
|
42
|
+
versions:
|
|
43
|
+
1.1.1: true
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
apiVersion: v2
|
|
2
|
-
name: web-application
|
|
3
2
|
description: A Helm chart for web app
|
|
4
|
-
kubeVersion:
|
|
5
|
-
|
|
6
|
-
version: 0.1.0
|
|
3
|
+
kubeVersion: '>= 1.21'
|
|
4
|
+
name: web-application
|
|
7
5
|
sources:
|
|
8
|
-
-
|
|
6
|
+
- https://github.tools.sap/unified-runtime/web-application
|
|
7
|
+
type: application
|
|
8
|
+
version: 1.8.0
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{{/*
|
|
2
|
+
Expand the name of the chart.
|
|
3
|
+
*/}}
|
|
4
|
+
{{- define "web-application.name" -}}
|
|
5
|
+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
|
6
|
+
{{- end }}
|
|
7
|
+
|
|
8
|
+
{{/*
|
|
9
|
+
Create a default fully qualified app name.
|
|
10
|
+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
|
11
|
+
If release name contains chart name it will be used as a full name.
|
|
12
|
+
*/}}
|
|
13
|
+
{{- define "web-application.fullname" -}}
|
|
14
|
+
{{- if .Values.fullnameOverride }}
|
|
15
|
+
{{- if gt (len .Values.fullnameOverride) 63 }}
|
|
16
|
+
{{- fail (printf "name exceeds 63 characters: '%s'" .Values.fullnameOverride) }}
|
|
17
|
+
{{- end }}
|
|
18
|
+
{{- .Values.fullnameOverride }}
|
|
19
|
+
{{- else }}
|
|
20
|
+
{{- $name := default .Chart.Name .Values.nameOverride }}
|
|
21
|
+
{{- if not (eq .Release.Name $name)}}
|
|
22
|
+
{{- $name = printf "%s-%s" .Release.Name $name }}
|
|
23
|
+
{{- end }}
|
|
24
|
+
{{- if gt (len $name) 63 }}
|
|
25
|
+
{{- fail (printf "name exceeds 63 characters: '%s'" $name) }}
|
|
26
|
+
{{- end }}
|
|
27
|
+
{{- $name }}
|
|
28
|
+
{{- end }}
|
|
29
|
+
{{- end }}
|
|
30
|
+
|
|
31
|
+
{{/*
|
|
32
|
+
Common labels
|
|
33
|
+
*/}}
|
|
34
|
+
{{- define "web-application.labels" -}}
|
|
35
|
+
helm.sh/revision: {{ .Release.Revision | quote }}
|
|
36
|
+
helm.sh/chart: {{ include "web-application.internal.chart" . }}
|
|
37
|
+
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
38
|
+
{{ include "web-application.selectorLabels" . }}
|
|
39
|
+
{{- if .Chart.AppVersion }}
|
|
40
|
+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
|
41
|
+
{{- end }}
|
|
42
|
+
{{- end }}
|
|
43
|
+
|
|
44
|
+
{{/*
|
|
45
|
+
Selector labels
|
|
46
|
+
*/}}
|
|
47
|
+
{{- define "web-application.selectorLabels" -}}
|
|
48
|
+
app.kubernetes.io/name: {{ include "web-application.name" . }}
|
|
49
|
+
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
50
|
+
{{- if .Values.global}}
|
|
51
|
+
{{- if .Values.global.component }}
|
|
52
|
+
app.kubernetes.io/component:{{ .Values.global.component }}
|
|
53
|
+
{{- end }}
|
|
54
|
+
{{- if .Values.global.partOf }}
|
|
55
|
+
app.kubernetes.io/partOf: {{ .Values.global.partOf }}
|
|
56
|
+
{{- end }}
|
|
57
|
+
{{- end }}
|
|
58
|
+
{{- end }}
|
|
59
|
+
|
|
60
|
+
|
|
@@ -1,37 +1,9 @@
|
|
|
1
|
-
{{/*
|
|
2
|
-
Expand the name of the chart.
|
|
3
|
-
*/}}
|
|
4
|
-
{{- define "web-application.internal.name" -}}
|
|
5
|
-
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
|
6
|
-
{{- end }}
|
|
7
1
|
|
|
8
|
-
{{/*
|
|
9
|
-
Create a default fully qualified app name.
|
|
10
|
-
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
|
11
|
-
If release name contains chart name it will be used as a full name.
|
|
12
|
-
*/}}
|
|
13
|
-
{{- define "web-application.internal.fullname" -}}
|
|
14
|
-
{{- if .Values.fullnameOverride }}
|
|
15
|
-
{{- if gt (len .Values.fullnameOverride) 63 }}
|
|
16
|
-
{{- fail (printf "name exceeds 63 characters: '%s'" .Values.fullnameOverride) }}
|
|
17
|
-
{{- end }}
|
|
18
|
-
{{- .Values.fullnameOverride }}
|
|
19
|
-
{{- else }}
|
|
20
|
-
{{- $name := default .Chart.Name .Values.nameOverride }}
|
|
21
|
-
{{- if not (eq .Release.Name $name)}}
|
|
22
|
-
{{- $name = printf "%s-%s" .Release.Name $name }}
|
|
23
|
-
{{- end }}
|
|
24
|
-
{{- if gt (len $name) 63 }}
|
|
25
|
-
{{- fail (printf "name exceeds 63 characters: '%s'" $name) }}
|
|
26
|
-
{{- end }}
|
|
27
|
-
{{- $name }}
|
|
28
|
-
{{- end }}
|
|
29
|
-
{{- end }}
|
|
30
2
|
|
|
31
3
|
{{/*
|
|
32
4
|
*/}}
|
|
33
5
|
{{- define "web-application.internal.bindingName" -}}
|
|
34
|
-
{{- printf "%s-%s" (include "web-application.
|
|
6
|
+
{{- printf "%s-%s" (include "web-application.fullname" .root ) .name }}
|
|
35
7
|
{{- end }}
|
|
36
8
|
|
|
37
9
|
{{/*
|
|
@@ -41,35 +13,6 @@ Create chart name and version as used by the chart label.
|
|
|
41
13
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
|
42
14
|
{{- end }}
|
|
43
15
|
|
|
44
|
-
{{/*
|
|
45
|
-
Common labels
|
|
46
|
-
*/}}
|
|
47
|
-
{{- define "web-application.internal.labels" -}}
|
|
48
|
-
helm.sh/revision: {{ .Release.Revision | quote }}
|
|
49
|
-
helm.sh/chart: {{ include "web-application.internal.chart" . }}
|
|
50
|
-
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
51
|
-
{{ include "web-application.internal.selectorLabels" . }}
|
|
52
|
-
{{- if .Chart.AppVersion }}
|
|
53
|
-
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
|
54
|
-
{{- end }}
|
|
55
|
-
{{- end }}
|
|
56
|
-
|
|
57
|
-
{{/*
|
|
58
|
-
Selector labels
|
|
59
|
-
*/}}
|
|
60
|
-
{{- define "web-application.internal.selectorLabels" -}}
|
|
61
|
-
app.kubernetes.io/name: {{ include "web-application.internal.name" . }}
|
|
62
|
-
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
63
|
-
{{- if .Values.global}}
|
|
64
|
-
{{- if .Values.global.component }}
|
|
65
|
-
app.kubernetes.io/component:{{ .Values.global.component }}
|
|
66
|
-
{{- end }}
|
|
67
|
-
{{- if .Values.global.partOf }}
|
|
68
|
-
app.kubernetes.io/partOf: {{ .Values.global.partOf }}
|
|
69
|
-
{{- end }}
|
|
70
|
-
{{- end }}
|
|
71
|
-
{{- end }}
|
|
72
|
-
|
|
73
16
|
{{/*
|
|
74
17
|
Define Host for the APIRule
|
|
75
18
|
*/}}
|
|
@@ -77,7 +20,7 @@ Define Host for the APIRule
|
|
|
77
20
|
{{- if .Values.expose.host }}
|
|
78
21
|
{{- tpl .Values.expose.host . }}
|
|
79
22
|
{{- else }}
|
|
80
|
-
{{- $name := (include "web-application.
|
|
23
|
+
{{- $name := (include "web-application.fullname" .) }}
|
|
81
24
|
{{- if hasPrefix $name .Release.Namespace }}
|
|
82
25
|
{{- .Release.Namespace }}
|
|
83
26
|
{{- else }}
|
|
@@ -87,10 +30,29 @@ Define Host for the APIRule
|
|
|
87
30
|
{{- end }}
|
|
88
31
|
|
|
89
32
|
{{/*
|
|
90
|
-
|
|
33
|
+
Returns the TENANT_HOST_PATTERN if defined
|
|
34
|
+
*/}}
|
|
35
|
+
{{- define "web-application.internal.TENANT_HOST_PATTERN" -}}
|
|
36
|
+
{{- if .Values.env }}
|
|
37
|
+
{{- if (kindIs "map" .Values.env) }}
|
|
38
|
+
{{- if (hasKey .Values.env "TENANT_HOST_PATTERN") }}
|
|
39
|
+
{{- .Values.env.TENANT_HOST_PATTERN }}
|
|
40
|
+
{{- end }}
|
|
41
|
+
{{- else }}
|
|
42
|
+
{{- range $i, $item := .Values.env }}
|
|
43
|
+
{{- if eq $item.name "TENANT_HOST_PATTERN"}}
|
|
44
|
+
{{- $item.value }}
|
|
45
|
+
{{- end }}
|
|
46
|
+
{{- end }}
|
|
47
|
+
{{- end }}
|
|
48
|
+
{{- end }}
|
|
49
|
+
{{- end }}
|
|
50
|
+
|
|
51
|
+
{{/*
|
|
52
|
+
Define the application uri to be used for the VCAP_APPLICATION env variable
|
|
91
53
|
*/}}
|
|
92
54
|
{{- define "web-application.internal.applicationUri" -}}
|
|
93
|
-
{{- include "web-application.
|
|
55
|
+
{{- include "web-application.fullname" . }}
|
|
94
56
|
{{- end }}
|
|
95
57
|
|
|
96
58
|
{{/*
|
|
@@ -133,7 +95,9 @@ Name of the imagePullSecret
|
|
|
133
95
|
{{- else if $ips.global.name }}
|
|
134
96
|
{{- $ips.global.name }}
|
|
135
97
|
{{- else if or $ips.local.dockerconfigjson $ips.global.dockerconfigjson }}
|
|
136
|
-
{{- include "web-application.
|
|
98
|
+
{{- include "web-application.fullname" . }}
|
|
99
|
+
{{- else }}
|
|
100
|
+
{{- "image-pull-secret" }}
|
|
137
101
|
{{- end }}
|
|
138
102
|
{{- end }}
|
|
139
103
|
|
|
@@ -141,12 +105,12 @@ Name of the imagePullSecret
|
|
|
141
105
|
Calculate the final image name
|
|
142
106
|
*/}}
|
|
143
107
|
{{- define "web-application.internal.imageName" -}}
|
|
144
|
-
{{- $tag := .
|
|
145
|
-
{{- $registry := .
|
|
108
|
+
{{- $tag := .image.tag | default .context.Values.global.image.tag | default "latest" }}
|
|
109
|
+
{{- $registry := .image.registry | default .context.Values.global.image.registry }}
|
|
146
110
|
{{- if $registry }}
|
|
147
|
-
{{- $registry | trimSuffix "/" }}/{{ .
|
|
111
|
+
{{- $registry | trimSuffix "/" | trimPrefix "https://" }}/{{ .image.repository | trimSuffix "/" }}:{{ $tag }}
|
|
148
112
|
{{- else }}
|
|
149
|
-
{{- .
|
|
113
|
+
{{- .image.repository | trimSuffix "/" | trimPrefix "https://" }}:{{ $tag }}
|
|
150
114
|
{{- end }}
|
|
151
115
|
{{- end }}
|
|
152
116
|
|
|
@@ -177,18 +141,15 @@ If release name contains chart name it will be used as service instance name.
|
|
|
177
141
|
{{- define "web-application.internal.processEnv" -}}
|
|
178
142
|
{{- $result := dict }}
|
|
179
143
|
{{- $variables := list }}
|
|
180
|
-
{{- range $k, $v := .
|
|
144
|
+
{{- range $k, $v := .env }}
|
|
181
145
|
{{- $variable := dict }}
|
|
182
146
|
{{/*
|
|
183
147
|
We support two versions to provide environment variables: as an array and as a map
|
|
184
|
-
|
|
185
148
|
env:
|
|
186
149
|
- name: TEST
|
|
187
150
|
value: X
|
|
188
|
-
|
|
189
151
|
env:
|
|
190
152
|
TEST: X
|
|
191
|
-
|
|
192
153
|
Transform the map case into the array case:
|
|
193
154
|
*/}}
|
|
194
155
|
{{- if (not (kindIs "map" $v)) }}
|
|
@@ -216,15 +177,15 @@ If release name contains chart name it will be used as service instance name.
|
|
|
216
177
|
{{- $variables = append $variables $variable}}
|
|
217
178
|
{{- end }}
|
|
218
179
|
{{- $_ := set $result "vars" $variables }}
|
|
219
|
-
{{- (fromYaml (tpl (toYaml $result)
|
|
180
|
+
{{- (fromYaml (tpl (toYaml $result) .context)) | mustToJson }}
|
|
220
181
|
{{- end }}
|
|
221
182
|
|
|
222
183
|
{{- define "web-application.internal.processEnvFrom" -}}
|
|
223
184
|
{{- $result := dict }}
|
|
224
185
|
{{- $variables := list }}
|
|
225
|
-
{{- range $envFrom := .
|
|
186
|
+
{{- range $envFrom := .envFrom }}
|
|
226
187
|
{{- $variables = append $variables $envFrom }}
|
|
227
188
|
{{- end }}
|
|
228
189
|
{{- $_ := set $result "vars" $variables }}
|
|
229
|
-
{{- (fromYaml (tpl (toYaml $result)
|
|
190
|
+
{{- (fromYaml (tpl (toYaml $result) .context)) | mustToJson }}
|
|
230
191
|
{{- end }}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
apiVersion: gateway.kyma-project.io/v1beta1
|
|
3
3
|
kind: APIRule
|
|
4
4
|
metadata:
|
|
5
|
-
name: {{ include "web-application.
|
|
6
|
-
labels: {{- include "web-application.
|
|
5
|
+
name: {{ include "web-application.fullname" . }}
|
|
6
|
+
labels: {{- include "web-application.labels" . | nindent 4 }}
|
|
7
7
|
spec:
|
|
8
|
-
gateway: {{ .Values.expose.gateway }}
|
|
8
|
+
gateway: {{tpl .Values.expose.gateway $ }}
|
|
9
9
|
host: {{ include "web-application.internal.exposeHost" . }}
|
|
10
10
|
service:
|
|
11
|
-
name: {{ include "web-application.
|
|
11
|
+
name: {{ include "web-application.fullname" . }}
|
|
12
12
|
port: {{ .Values.port }}
|
|
13
13
|
rules:
|
|
14
14
|
{{- toYaml .Values.expose.rules | nindent 6 }}
|
|
@@ -1,33 +1,46 @@
|
|
|
1
1
|
apiVersion: apps/v1
|
|
2
2
|
kind: Deployment
|
|
3
3
|
metadata:
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
name: {{ include "web-application.fullname" . }}
|
|
5
|
+
labels: {{- include "web-application.labels" . | nindent 4 }}
|
|
6
|
+
{{- if or .Values.annotations.deployment }}
|
|
7
|
+
annotations:
|
|
8
|
+
{{- tpl (toYaml .Values.annotations.deployment) $ | nindent 4 }}
|
|
9
|
+
{{- end }}
|
|
6
10
|
spec:
|
|
7
11
|
replicas: {{ .Values.replicaCount }}
|
|
8
12
|
selector:
|
|
9
|
-
matchLabels: {{- include "web-application.
|
|
13
|
+
matchLabels: {{- include "web-application.selectorLabels" . | nindent 6 }}
|
|
10
14
|
template:
|
|
11
15
|
metadata:
|
|
12
|
-
labels: {{- include "web-application.
|
|
16
|
+
labels: {{- include "web-application.selectorLabels" . | nindent 8 }}
|
|
17
|
+
{{- if .Values.istio }}
|
|
18
|
+
sidecar.istio.io/inject: {{ .Values.istio.enabled | quote }}
|
|
19
|
+
{{ end }}
|
|
13
20
|
annotations:
|
|
14
|
-
container.apparmor.security.beta.kubernetes.io/{{ include "web-application.
|
|
21
|
+
container.apparmor.security.beta.kubernetes.io/{{ include "web-application.name" . }}: runtime/default
|
|
22
|
+
{{- if or .Values.annotations.deployment }}
|
|
23
|
+
{{- tpl (toYaml .Values.annotations.deployment) $ | nindent 8 }}
|
|
24
|
+
{{- end }}
|
|
15
25
|
spec:
|
|
16
26
|
{{- if (include "web-application.internal.imagePullSecretName" .) }}
|
|
17
27
|
imagePullSecrets:
|
|
18
28
|
- name: {{ include "web-application.internal.imagePullSecretName" . }}
|
|
19
29
|
{{- end }}
|
|
20
|
-
automountServiceAccountToken: false
|
|
21
|
-
serviceAccountName: {{ tpl (.Values.serviceAccountName | default (include "web-application.
|
|
30
|
+
automountServiceAccountToken: {{ ternary false true (empty (or .Values.rbac.rules .Values.rbac.role .Values.rbac.clusterRole)) }}
|
|
31
|
+
serviceAccountName: {{ tpl (.Values.serviceAccountName | default (include "web-application.fullname" .)) $ }}
|
|
22
32
|
containers:
|
|
23
|
-
- image: {{ include "web-application.internal.imageName" . }}
|
|
24
|
-
|
|
33
|
+
- image: {{ include "web-application.internal.imageName" (dict "image" .Values.image "context" $) }}
|
|
34
|
+
{{- if ( or .Values.global.imagePullPolicy .Values.imagePullPolicy ) }}
|
|
35
|
+
imagePullPolicy: {{ .Values.imagePullPolicy | default .Values.global.imagePullPolicy }}
|
|
36
|
+
{{- end }}
|
|
37
|
+
name: {{ include "web-application.name" . }}
|
|
25
38
|
ports:
|
|
26
39
|
- name: http
|
|
27
40
|
containerPort: {{ .Values.port }}
|
|
28
41
|
protocol: TCP
|
|
29
42
|
envFrom:
|
|
30
|
-
{{- $envFromVars := (include "web-application.internal.processEnvFrom" . | fromJson) }}
|
|
43
|
+
{{- $envFromVars := (include "web-application.internal.processEnvFrom" (dict "envFrom" .Values.envFrom "context" $) | fromJson) }}
|
|
31
44
|
{{- if not (eq (len $envFromVars.vars) 0) }}
|
|
32
45
|
{{- $envFromVars.vars | toYaml | nindent 8}}
|
|
33
46
|
{{- end }}
|
|
@@ -38,18 +51,26 @@ spec:
|
|
|
38
51
|
value: {{ .Values.port | quote }}
|
|
39
52
|
- name: TMPDIR
|
|
40
53
|
value: /tmp
|
|
41
|
-
{{-
|
|
42
|
-
|
|
43
|
-
|
|
54
|
+
{{- if .Values.otlp.traces.enabled }}
|
|
55
|
+
- name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
|
|
56
|
+
value: {{ .Values.otlp.traces.endpoint }}
|
|
57
|
+
{{- end }}
|
|
58
|
+
{{- if .Values.otlp.metrics.enabled }}
|
|
59
|
+
- name: OTEL_EXPORTER_OTLP_METRICS_ENDPOINT
|
|
60
|
+
value: {{ .Values.otlp.metrics.endpoint }}
|
|
44
61
|
{{- end }}
|
|
62
|
+
{{- $envVars := (include "web-application.internal.processEnv" (dict "env" .Values.env "context" $) | fromJson) }}
|
|
45
63
|
{{- if not $envVars.appName}}
|
|
46
64
|
- name: APPLICATION_NAME
|
|
47
|
-
value: {{ include "web-application.
|
|
65
|
+
value: {{ include "web-application.fullname" . }}
|
|
48
66
|
{{- end }}
|
|
49
67
|
{{- if not $envVars.appURI}}
|
|
50
68
|
- name: APPLICATION_URI
|
|
51
69
|
value: {{ include "web-application.internal.applicationUri" . }}
|
|
52
70
|
{{- end }}
|
|
71
|
+
{{- if not (eq (len $envVars.vars) 0) }}
|
|
72
|
+
{{- $envVars.vars | toYaml | nindent 8}}
|
|
73
|
+
{{- end }}
|
|
53
74
|
livenessProbe:
|
|
54
75
|
{{- if .Values.health.liveness.path }}
|
|
55
76
|
httpGet:
|
|
@@ -97,17 +118,75 @@ spec:
|
|
|
97
118
|
drop:
|
|
98
119
|
- ALL
|
|
99
120
|
privileged: false
|
|
121
|
+
runAsNonRoot: true
|
|
122
|
+
{{- if .Values.runAsUser }}
|
|
123
|
+
runAsUser: {{ .Values.runAsUser }}
|
|
124
|
+
{{- end }}
|
|
100
125
|
readOnlyRootFilesystem: {{ .Values.readOnlyRootFilesystem | default false }}
|
|
101
126
|
seccompProfile:
|
|
102
127
|
type: RuntimeDefault
|
|
128
|
+
{{- range $key, $sidecar := .Values.sidecars }}
|
|
129
|
+
- image: {{ include "web-application.internal.imageName" (dict "image" $sidecar.image "context" $) }}
|
|
130
|
+
{{- if ( or $.Values.global.imagePullPolicy $sidecar.imagePullPolicy ) }}
|
|
131
|
+
imagePullPolicy: {{ $sidecar.imagePullPolicy | default $.Values.global.imagePullPolicy }}
|
|
132
|
+
{{- end }}
|
|
133
|
+
name: {{ $key }}
|
|
134
|
+
envFrom:
|
|
135
|
+
{{- $envFromVars := (include "web-application.internal.processEnvFrom" (dict "envFrom" $sidecar.envFrom "context" $) | fromJson) }}
|
|
136
|
+
{{- if not (eq (len $envFromVars.vars) 0) }}
|
|
137
|
+
{{- $envFromVars.vars | toYaml | nindent 8}}
|
|
138
|
+
{{- end }}
|
|
139
|
+
env:
|
|
140
|
+
- name: SERVICE_BINDING_ROOT
|
|
141
|
+
value: /bindings
|
|
142
|
+
- name: TMPDIR
|
|
143
|
+
value: /tmp
|
|
144
|
+
{{- if $.Values.otlp.traces.enabled }}
|
|
145
|
+
- name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
|
|
146
|
+
value: {{ $.Values.otlp.traces.endpoint }}
|
|
147
|
+
{{- end }}
|
|
148
|
+
{{- if $.Values.otlp.metrics.enabled }}
|
|
149
|
+
- name: OTEL_EXPORTER_OTLP_METRICS_ENDPOINT
|
|
150
|
+
value: {{ $.Values.otlp.metrics.endpoint }}
|
|
151
|
+
{{- end }}
|
|
152
|
+
{{- $envVars := (include "web-application.internal.processEnv" (dict "env" $sidecar.env "context" $) | fromJson) }}
|
|
153
|
+
{{- if not (eq (len $envVars.vars) 0) }}
|
|
154
|
+
{{- $envVars.vars | toYaml | nindent 8}}
|
|
155
|
+
{{- end }}
|
|
156
|
+
volumeMounts:
|
|
157
|
+
- name: tmp
|
|
158
|
+
mountPath: /tmp
|
|
159
|
+
- name: bindings-root
|
|
160
|
+
mountPath: /bindings
|
|
161
|
+
{{- range $volume := $.Values.additionalVolumes }}
|
|
162
|
+
- name: {{ $volume.name | quote }}
|
|
163
|
+
{{- toYaml $volume.volumeMount | nindent 10 }}
|
|
164
|
+
{{- end }}
|
|
165
|
+
{{- include "web-application.internal.serviceMounts" $ | nindent 8 }}
|
|
166
|
+
{{- if $sidecar.resources }}
|
|
167
|
+
resources:
|
|
168
|
+
{{- toYaml $sidecar.resources | nindent 10 }}
|
|
169
|
+
{{- end }}
|
|
170
|
+
securityContext:
|
|
171
|
+
allowPrivilegeEscalation: false
|
|
172
|
+
capabilities:
|
|
173
|
+
drop:
|
|
174
|
+
- ALL
|
|
175
|
+
privileged: false
|
|
176
|
+
runAsNonRoot: true
|
|
177
|
+
{{- if $sidecar.runAsUser }}
|
|
178
|
+
runAsUser: {{ $sidecar.runAsUser }}
|
|
179
|
+
{{- end }}
|
|
180
|
+
readOnlyRootFilesystem: {{ $.Values.readOnlyRootFilesystem | default false }}
|
|
181
|
+
seccompProfile:
|
|
182
|
+
type: RuntimeDefault
|
|
183
|
+
{{- end }}
|
|
103
184
|
restartPolicy: Always
|
|
104
185
|
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
|
|
105
|
-
securityContext:
|
|
106
|
-
runAsNonRoot: true
|
|
107
186
|
topologySpreadConstraints:
|
|
108
187
|
{{- range $constraint := .Values.availability.topologySpreadConstraints }}
|
|
109
188
|
- labelSelector:
|
|
110
|
-
matchLabels: {{- include "web-application.
|
|
189
|
+
matchLabels: {{- include "web-application.selectorLabels" $ | nindent 12 }}
|
|
111
190
|
maxSkew: {{ $constraint.maxSkew }}
|
|
112
191
|
topologyKey: {{ $constraint.topologyKey }}
|
|
113
192
|
whenUnsatisfiable: {{ $constraint.whenUnsatisfiable }}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
kind: NetworkPolicy
|
|
3
3
|
apiVersion: networking.k8s.io/v1
|
|
4
4
|
metadata:
|
|
5
|
-
name: {{ include "web-application.
|
|
6
|
-
labels: {{- include "web-application.
|
|
5
|
+
name: {{ include "web-application.fullname" . }}
|
|
6
|
+
labels: {{- include "web-application.labels" . | nindent 4 }}
|
|
7
7
|
spec:
|
|
8
8
|
ingress:
|
|
9
9
|
{{- if .Values.expose.enabled }}
|
|
@@ -22,6 +22,22 @@ spec:
|
|
|
22
22
|
port: {{ $port }}
|
|
23
23
|
{{- end }}
|
|
24
24
|
{{- end }}
|
|
25
|
+
{{- if .Values.prometheus.enabled }}
|
|
26
|
+
- from:
|
|
27
|
+
- namespaceSelector:
|
|
28
|
+
matchLabels:
|
|
29
|
+
kubernetes.io/metadata.name: kyma-system
|
|
30
|
+
ports:
|
|
31
|
+
- protocol: TCP
|
|
32
|
+
port: {{ .Values.prometheus.port | default .Values.port }}
|
|
33
|
+
- from:
|
|
34
|
+
- namespaceSelector:
|
|
35
|
+
matchLabels:
|
|
36
|
+
kubernetes.io/metadata.name: kyma-system
|
|
37
|
+
ports:
|
|
38
|
+
- protocol: TCP
|
|
39
|
+
port: 15090
|
|
40
|
+
{{- end }}
|
|
25
41
|
{{- if .Values.networkSecurity.allowNamespaceInternal }}
|
|
26
42
|
- from:
|
|
27
43
|
- podSelector: {}
|
|
@@ -58,5 +74,5 @@ spec:
|
|
|
58
74
|
policyTypes:
|
|
59
75
|
- Ingress
|
|
60
76
|
podSelector:
|
|
61
|
-
matchLabels: {{- include "web-application.
|
|
77
|
+
matchLabels: {{- include "web-application.selectorLabels" . | nindent 6 }}
|
|
62
78
|
{{- end }}
|
package/lib/init/template/helm/subcharts/web-application/templates/pod-disruption-budget.yaml
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
apiVersion: policy/v1
|
|
2
2
|
kind: PodDisruptionBudget
|
|
3
3
|
metadata:
|
|
4
|
-
name: {{ include "web-application.
|
|
5
|
-
labels: {{- include "web-application.
|
|
4
|
+
name: {{ include "web-application.fullname" . }}
|
|
5
|
+
labels: {{- include "web-application.labels" . | nindent 4 }}
|
|
6
6
|
spec:
|
|
7
7
|
maxUnavailable: {{ .Values.availability.podDisruptionBudget.maxUnavailable }}
|
|
8
8
|
selector:
|
|
9
|
-
matchLabels: {{- include "web-application.
|
|
9
|
+
matchLabels: {{- include "web-application.selectorLabels" . | nindent 6 }}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
{{- if .Values.rbac.rules }}
|
|
3
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
|
4
|
+
kind: Role
|
|
5
|
+
metadata:
|
|
6
|
+
labels: {{- include "web-application.labels" . | nindent 4 }}
|
|
7
|
+
name: {{ include "web-application.fullname" . }}
|
|
8
|
+
rules:
|
|
9
|
+
{{- .Values.rbac.rules | toYaml | nindent 2}}
|
|
10
|
+
---
|
|
11
|
+
{{- end }}
|
|
12
|
+
{{- if or .Values.rbac.rules .Values.rbac.role .Values.rbac.clusterRole }}
|
|
13
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
|
14
|
+
kind: RoleBinding
|
|
15
|
+
metadata:
|
|
16
|
+
labels: {{- include "web-application.labels" . | nindent 4 }}
|
|
17
|
+
name: {{ include "web-application.fullname" . }}
|
|
18
|
+
subjects:
|
|
19
|
+
- kind: ServiceAccount
|
|
20
|
+
name: {{ tpl (default (include "web-application.fullname" .) .Values.serviceAccountName) . }}
|
|
21
|
+
namespace: {{ .Release.Namespace }}
|
|
22
|
+
roleRef:
|
|
23
|
+
kind: {{ ternary "Role" "ClusterRole" (empty .Values.rbac.clusterRole) }}
|
|
24
|
+
name: {{ tpl (default (include "web-application.fullname" .) (default .Values.rbac.role .Values.rbac.clusterRole)) . }}
|
|
25
|
+
apiGroup: rbac.authorization.k8s.io
|
|
26
|
+
{{- end }}
|
|
@@ -4,7 +4,7 @@ kind: Secret
|
|
|
4
4
|
type: kubernetes.io/dockerconfigjson
|
|
5
5
|
metadata:
|
|
6
6
|
name: {{ include "web-application.internal.imagePullSecretName" . }}
|
|
7
|
-
labels: {{- include "web-application.
|
|
7
|
+
labels: {{- include "web-application.labels" . | nindent 4 }}
|
|
8
8
|
data:
|
|
9
9
|
.dockerconfigjson: {{ default .Values.global.imagePullSecret.dockerconfigjson .Values.imagePullSecret.dockerconfigjson }}
|
|
10
10
|
{{- end }}
|
|
@@ -8,7 +8,7 @@ apiVersion: services.cloud.sap.com/v1
|
|
|
8
8
|
kind: ServiceBinding
|
|
9
9
|
metadata:
|
|
10
10
|
name: {{ include "web-application.internal.bindingName" (dict "root" $ "name" $name) }}
|
|
11
|
-
labels: {{- include "web-application.
|
|
11
|
+
labels: {{- include "web-application.labels" $ | nindent 4 }}
|
|
12
12
|
spec:
|
|
13
13
|
serviceInstanceName: {{include "web-application.internal.serviceInstanceName" (dict "binding" $mergedParams "root" $) }}
|
|
14
14
|
secretKey: credentials
|
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
apiVersion: v1
|
|
2
2
|
kind: Service
|
|
3
3
|
metadata:
|
|
4
|
-
name: {{ include "web-application.
|
|
5
|
-
labels: {{- include "web-application.
|
|
4
|
+
name: {{ include "web-application.fullname" . }}
|
|
5
|
+
labels: {{- include "web-application.labels" . | nindent 4 }}
|
|
6
6
|
spec:
|
|
7
7
|
ports:
|
|
8
8
|
- port: {{ .Values.port }}
|
|
9
9
|
targetPort: {{ .Values.port }}
|
|
10
10
|
protocol: TCP
|
|
11
|
-
selector: {{- include "web-application.
|
|
11
|
+
selector: {{- include "web-application.selectorLabels" . | nindent 4 }}
|
|
12
|
+
{{- if .Values.prometheus.enabled }}
|
|
13
|
+
---
|
|
14
|
+
apiVersion: v1
|
|
15
|
+
kind: Service
|
|
16
|
+
metadata:
|
|
17
|
+
name: {{ include "web-application.fullname" . }}-metrics
|
|
18
|
+
labels: {{- include "web-application.labels" . | nindent 4 }}
|
|
19
|
+
annotations:
|
|
20
|
+
prometheus.io/scrape: "true"
|
|
21
|
+
prometheus.io/path: {{ .Values.prometheus.path }}
|
|
22
|
+
prometheus.io/port: {{ .Values.prometheus.port | default .Values.port | quote }}
|
|
23
|
+
spec:
|
|
24
|
+
ports:
|
|
25
|
+
- port: {{ .Values.prometheus.port | default .Values.port }}
|
|
26
|
+
targetPort: {{ .Values.prometheus.port | default .Values.port }}
|
|
27
|
+
protocol: TCP
|
|
28
|
+
selector: {{- include "web-application.selectorLabels" . | nindent 4 }}
|
|
29
|
+
{{- end }}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{{- if include "web-application.internal.TENANT_HOST_PATTERN" . -}}
|
|
2
|
+
apiVersion: networking.istio.io/v1beta1
|
|
3
|
+
kind: VirtualService
|
|
4
|
+
metadata:
|
|
5
|
+
name: {{ include "web-application.fullname" . }}-multitenancy
|
|
6
|
+
labels: {{- include "web-application.labels" . | nindent 4 }}
|
|
7
|
+
spec:
|
|
8
|
+
gateways:
|
|
9
|
+
- {{ tpl (default .Values.expose.gateway .Values.expose.tenantGateway) $ }}
|
|
10
|
+
hosts:
|
|
11
|
+
- "*"
|
|
12
|
+
http:
|
|
13
|
+
- corsPolicy:
|
|
14
|
+
allowHeaders:
|
|
15
|
+
- Authorization
|
|
16
|
+
- Content-Type
|
|
17
|
+
- "*"
|
|
18
|
+
allowMethods:
|
|
19
|
+
- GET
|
|
20
|
+
- POST
|
|
21
|
+
- PUT
|
|
22
|
+
- DELETE
|
|
23
|
+
- PATCH
|
|
24
|
+
allowOrigins:
|
|
25
|
+
- regex: .*
|
|
26
|
+
match:
|
|
27
|
+
- uri:
|
|
28
|
+
regex: /.*
|
|
29
|
+
headers:
|
|
30
|
+
Host:
|
|
31
|
+
regex: {{ tpl (include "web-application.internal.TENANT_HOST_PATTERN" .) . }}
|
|
32
|
+
route:
|
|
33
|
+
- weight: 100
|
|
34
|
+
destination:
|
|
35
|
+
host: "{{ include "web-application.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local"
|
|
36
|
+
{{- end }}
|