Skip to content
Snippets Groups Projects
Commit 7402506c authored by OZGCloud's avatar OZGCloud
Browse files

Merge branch 'kop-env' into if-adapter-ingress

parents 3b479d6c 1aa2c7c7
Branches
Tags
No related merge requests found
...@@ -2,6 +2,6 @@ apiVersion: v1 ...@@ -2,6 +2,6 @@ apiVersion: v1
appVersion: "1.1" appVersion: "1.1"
description: A Helm chart for Intelliform Adapter description: A Helm chart for Intelliform Adapter
name: Intelliform-Adapter name: Intelliform-Adapter
version: 0.8.0-SNAPSHOT version: 0.9.0-SNAPSHOT
icon: https://simpleicons.org/icons/helm.svg icon: https://simpleicons.org/icons/helm.svg
...@@ -19,17 +19,22 @@ questions: ...@@ -19,17 +19,22 @@ questions:
type: string type: string
default: "2" default: "2"
label: "Deployment Replica count" label: "Deployment Replica count"
- variable: env.springProfiles - variable: env.overrideSpringProfiles
group: "Container" group: "Container"
type: string type: string
default: "oc, prod" label: "Override Spring boot profile"
label: "Spring boot profiles"
- variable: scrapeMetricsDisabled - variable: scrapeMetricsDisabled
group: "Other" group: "Other"
type: boolean type: boolean
default: false default: false
label: "Disable Scrape Metrics" label: "Disable Scrape Metrics"
- variable: kop.environment
group: "KOP"
label: "Environment"
type: string
required: true
- variable: ingress.enabled - variable: ingress.enabled
type: boolean type: boolean
label: Enable ingress label: Enable ingress
......
...@@ -48,25 +48,36 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }} ...@@ -48,25 +48,36 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- define "app.ssoLevel" -}}
{{ coalesce (.Values.sso).level ((split "-" (include "app.namespace" .) )._2) "prod" }} {{- define "app.envSpringProfiles" }}
{{- if (.Values.env).overrideSpringProfiles -}}
{{ printf "%s" (.Values.env).overrideSpringProfiles }}
{{- else -}}
{{ printf "oc,%s" (include "app.kopEnvironment" . ) }}
{{- end -}}
{{- end -}} {{- end -}}
{{- define "app.kopEnvironment" -}}
{{- required "Environment muss angegeben sein" (.Values.kop).environment -}}
{{- end -}}
{{- define "app.resources" }} {{- define "app.resources" }}
{{- if eq (include "app.ssoLevel" . ) "prod" }} {{- if eq (include "app.kopEnvironment" . ) "prod" }}
limits: limits:
cpu: "1" cpu: "1"
memory: "1000Mi" memory: "1000Mi"
requests: requests:
cpu: "200m" cpu: "200m"
memory: "500Mi" memory: "250Mi"
{{- else }} {{- else }}
limits: limits:
cpu: "1" cpu: "1"
memory: "1000Mi" memory: "1000Mi"
requests: requests:
cpu: "50m" cpu: "50m"
memory: "500Mi" memory: "250Mi"
{{- end }} {{- end }}
{{- end -}} {{- end -}}
......
...@@ -37,7 +37,7 @@ spec: ...@@ -37,7 +37,7 @@ spec:
value: {{ .value }} value: {{ .value }}
{{- end }} {{- end }}
- name: spring_profiles_active - name: spring_profiles_active
value: {{ (.Values.env).springProfiles | default "oc, prod" }} value: {{ include "app.envSpringProfiles" . }}
- name: kop_adapter_fallbackStrategy - name: kop_adapter_fallbackStrategy
value: {{ (.Values.routing).fallbackStrategy | default "DENY"}} value: {{ (.Values.routing).fallbackStrategy | default "DENY"}}
{{- if (.Values.routing).fundstellePlutoName}} {{- if (.Values.routing).fundstellePlutoName}}
......
kop:
environment: test
\ No newline at end of file
suite: test deployment suite: test deployment
release: release:
name: intelliform-adapter name: intelliform-adapter
namespace: helm-test namespace: sh-helm-test
templates: templates:
- templates/deployment.yaml - templates/deployment.yaml
- templates/service_monitor.yaml - templates/service_monitor.yaml
...@@ -9,6 +9,7 @@ templates: ...@@ -9,6 +9,7 @@ templates:
tests: tests:
- it: check default labels - it: check default labels
set: set:
kop.environment: dev
scrapeMetricsDisabled: false scrapeMetricsDisabled: false
asserts: asserts:
- equal: - equal:
...@@ -22,4 +23,4 @@ tests: ...@@ -22,4 +23,4 @@ tests:
value: kop value: kop
- equal: - equal:
path: metadata.labels.[app.kubernetes.io/namespace] path: metadata.labels.[app.kubernetes.io/namespace]
value: helm-test value: sh-helm-test
...@@ -5,6 +5,7 @@ tests: ...@@ -5,6 +5,7 @@ tests:
- it: check customList - it: check customList
template: deployment.yaml template: deployment.yaml
set: set:
kop.environment: test
env.customList: env.customList:
- name: my_test_environment_name - name: my_test_environment_name
value: "A test value" value: "A test value"
...@@ -15,6 +16,8 @@ tests: ...@@ -15,6 +16,8 @@ tests:
name: my_test_environment_name name: my_test_environment_name
value: "A test value" value: "A test value"
- it: check customList test value is not set by default - it: check customList test value is not set by default
set:
kop.environment: test
template: deployment.yaml template: deployment.yaml
asserts: asserts:
- notContains: - notContains:
......
...@@ -7,6 +7,8 @@ tests: ...@@ -7,6 +7,8 @@ tests:
- it: test resources for prod environment - it: test resources for prod environment
release: release:
namespace: sh-name-prod namespace: sh-name-prod
set:
kop.environment: prod
asserts: asserts:
- equal: - equal:
path: spec.template.spec.containers[0].resources.limits.cpu path: spec.template.spec.containers[0].resources.limits.cpu
...@@ -19,10 +21,12 @@ tests: ...@@ -19,10 +21,12 @@ tests:
value: 200m value: 200m
- equal: - equal:
path: spec.template.spec.containers[0].resources.requests.memory path: spec.template.spec.containers[0].resources.requests.memory
value: 500Mi value: 250Mi
- it: test default resources - it: test default resources
release: release:
namespace: sh-name-dev namespace: sh-name-dev
set:
kop.environment: dev
asserts: asserts:
- equal: - equal:
path: spec.template.spec.containers[0].resources.limits.cpu path: spec.template.spec.containers[0].resources.limits.cpu
...@@ -35,5 +39,5 @@ tests: ...@@ -35,5 +39,5 @@ tests:
value: 50m value: 50m
- equal: - equal:
path: spec.template.spec.containers[0].resources.requests.memory path: spec.template.spec.containers[0].resources.requests.memory
value: 500Mi value: 250Mi
suite: test deployment suite: test deployment
release: release:
name: intelliform-adapter name: intelliform-adapter
namespace: helm-test namespace: sh-helm-test
templates: templates:
- deployment.yaml - deployment.yaml
set: set:
image.tag: latest image.tag: latest
tests: tests:
- it: validate default routing values without questions.yaml - it: validate default routing values without questions.yaml
set:
kop.environment: test
asserts: asserts:
- contains: - contains:
path: spec.template.spec.containers[0].env path: spec.template.spec.containers[0].env
...@@ -21,6 +23,7 @@ tests: ...@@ -21,6 +23,7 @@ tests:
value: DENY value: DENY
- it: validate routing infos - it: validate routing infos
set: set:
kop.environment: test
routing.routingStrategy: MULTI routing.routingStrategy: MULTI
routing.fallbackStrategy: FUNDSTELLE routing.fallbackStrategy: FUNDSTELLE
asserts: asserts:
......
suite: test deployment suite: test deployment
release: release:
name: afm-adapter name: afm-adapter
namespace: helm-test namespace: sh-helm-test
templates: templates:
- templates/deployment.yaml - templates/deployment.yaml
tests: tests:
- it: should set the metrics port by default - it: should set the metrics port by default
set: set:
kop.environment: test
scrapeMetricsDisabled: false scrapeMetricsDisabled: false
asserts: asserts:
- isKind: - isKind:
...@@ -19,6 +20,7 @@ tests: ...@@ -19,6 +20,7 @@ tests:
protocol: TCP protocol: TCP
- it: should deactivate the metrics port at will - it: should deactivate the metrics port at will
set: set:
kop.environment: test
scrapeMetricsDisabled: true scrapeMetricsDisabled: true
asserts: asserts:
- isKind: - isKind:
......
suite: test spring profiles
release:
name: if-adapter
templates:
- templates/deployment.yaml
tests:
- it: should override spring profiles
set:
kop.environment: test
env.overrideSpringProfiles: oc,stage,ea
asserts:
- isKind:
of: Deployment
- contains:
path: spec.template.spec.containers[0].env
content:
name: spring_profiles_active
value: oc,stage,ea
- it: should generate spring profiles
set:
kop.environment: test
asserts:
- isKind:
of: Deployment
- contains:
path: spec.template.spec.containers[0].env
content:
name: spring_profiles_active
value: oc,test
\ No newline at end of file
suite: test deployment suite: test deployment
release: release:
name: intelliform-adapter name: intelliform-adapter
namespace: helm-test namespace: sh-helm-test
templates: templates:
- deployment.yaml - deployment.yaml
tests: tests:
- it: validate image type and container image - it: validate image type and container image
set: set:
kop.environment: test
image.tag: latest image.tag: latest
asserts: asserts:
- isKind: - isKind:
...@@ -16,6 +17,7 @@ tests: ...@@ -16,6 +17,7 @@ tests:
value: docker.ozg-sh.de/intelliform-adapter:latest value: docker.ozg-sh.de/intelliform-adapter:latest
- it: validate image pull secret resource name - it: validate image pull secret resource name
set: set:
kop.environment: test
image.tag: latest image.tag: latest
asserts: asserts:
- equal: - equal:
......
...@@ -5,7 +5,7 @@ image: ...@@ -5,7 +5,7 @@ image:
# tag: latest # [default: latest] # tag: latest # [default: latest]
# env: # env:
#springProfiles: oc, prod # [default: oc, prod] # overrideSpringProfiles: "oc,prod"
# customList: # add name value pair for additional environments # customList: # add name value pair for additional environments
# - name: Dinge # - name: Dinge
# value: true # value: true
...@@ -29,3 +29,6 @@ ingress: ...@@ -29,3 +29,6 @@ ingress:
#routing: #routing:
# fallbackStrategy: DENY # fallbackStrategy: DENY
# routingStrategy: SINGLE # routingStrategy: SINGLE
# kop:
# environment: dev
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment