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