Skip to content

Commit

Permalink
feat(helm): consolidate structure in values.yaml (#156)
Browse files Browse the repository at this point in the history
rename policyhub node to service and policyhubmigrations to migrations
  • Loading branch information
evegufy authored Jun 19, 2024
1 parent ab5c9dc commit 79559ef
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 56 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/chart-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
run: ct lint --validate-maintainers=false --check-version-increment=false --target-branch ${{ github.event.repository.default_branch }}

- name: Run chart-testing (install)
run: ct install --charts charts/policy-hub --config charts/chart-testing-config.yaml --helm-extra-set-args "--set policyhub.image.name=kind-registry:5000/policy-hub-service --set policyhub.image.tag=testing --set policyhubmigrations.image.name=kind-registry:5000/policy-hub-migrations --set policyhubmigrations.image.tag=testing"
run: ct install --charts charts/policy-hub --config charts/chart-testing-config.yaml --helm-extra-set-args "--set service.image.name=kind-registry:5000/policy-hub-service --set service.image.tag=testing --set migrations.image.name=kind-registry:5000/policy-hub-migrations --set migrations.image.tag=testing"
if: github.event_name != 'pull_request' || steps.list-changed.outputs.changed == 'true'

# Upgrade the released chart version with the locally available chart
Expand All @@ -114,5 +114,5 @@ jobs:
helm repo add tractusx-dev https://eclipse-tractusx.github.io/charts/dev
helm install policy-hub tractusx-dev/policy-hub --version ${{ github.event.inputs.upgrade_from || '0.1.0' }} --namespace upgrade --create-namespace
helm dependency update charts/policy-hub
helm upgrade policy-hub charts/policy-hub --set policyhub.image.name=kind-registry:5000/policy-hub-service --set policyhub.image.tag=testing --set policyhubmigrations.image.name=kind-registry:5000/policy-hub-migrations --set policyhubmigrations.image.tag=testing --namespace upgrade
helm upgrade policy-hub charts/policy-hub --set service.image.name=kind-registry:5000/policy-hub-service --set service.image.tag=testing --set migrations.image.name=kind-registry:5000/policy-hub-migrations --set migrations.image.tag=testing --namespace upgrade
if: github.event_name != 'pull_request' || steps.list-changed.outputs.changed == 'true'
2 changes: 1 addition & 1 deletion .github/workflows/owasp-zap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
helm dependency build
- name: Install the chart on KinD cluster
run: helm install testing -n apps --create-namespace --wait --set policyhub.image.name=kind-registry:5000/policy-hub-service --set policyhub.image.tag=testing --set policyhubmigrations.image.name=kind-registry:5000/policy-hub-migrations --set policyhubmigrations.image.tag=testing --set policyhub.swaggerEnabled=true charts/policy-hub
run: helm install testing -n apps --create-namespace --wait --set service.image.name=kind-registry:5000/policy-hub-service --set service.image.tag=testing --set migrations.image.name=kind-registry:5000/policy-hub-migrations --set migrations.image.tag=testing --set service.swaggerEnabled=true charts/policy-hub

- name: Configure port forward to app in KinD
run: |
Expand Down
38 changes: 19 additions & 19 deletions charts/policy-hub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,25 @@ dependencies:
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| policyhub.image.name | string | `"docker.io/tractusx/policy-hub-service"` | |
| policyhub.image.tag | string | `""` | |
| policyhub.imagePullPolicy | string | `"IfNotPresent"` | |
| policyhub.resources | object | `{"limits":{"cpu":"45m","memory":"300M"},"requests":{"cpu":"15m","memory":"300M"}}` | We recommend to review the default resource limits as this should a conscious choice. |
| policyhub.logging.businessLogic | string | `"Information"` | |
| policyhub.logging.default | string | `"Information"` | |
| policyhub.healthChecks.startup.path | string | `"/health/startup"` | |
| policyhub.healthChecks.startup.tags[0].name | string | `"HEALTHCHECKS__0__TAGS__1"` | |
| policyhub.healthChecks.startup.tags[0].value | string | `"policyhubdb"` | |
| policyhub.healthChecks.liveness.path | string | `"/healthz"` | |
| policyhub.healthChecks.readyness.path | string | `"/ready"` | |
| policyhub.swaggerEnabled | bool | `false` | |
| policyhubmigrations.image.name | string | `"docker.io/tractusx/policy-hub-migrations"` | |
| policyhubmigrations.image.tag | string | `""` | |
| policyhubmigrations.imagePullPolicy | string | `"IfNotPresent"` | |
| policyhubmigrations.resources | object | `{"limits":{"cpu":"45m","memory":"105M"},"requests":{"cpu":"15m","memory":"105M"}}` | We recommend to review the default resource limits as this should a conscious choice. |
| policyhubmigrations.seeding.testDataEnvironments | string | `""` | |
| policyhubmigrations.seeding.testDataPaths | string | `"Seeder/Data"` | |
| policyhubmigrations.logging.default | string | `"Information"` | |
| service.image.name | string | `"docker.io/tractusx/policy-hub-service"` | |
| service.image.tag | string | `""` | |
| service.imagePullPolicy | string | `"IfNotPresent"` | |
| service.resources | object | `{"limits":{"cpu":"45m","memory":"300M"},"requests":{"cpu":"15m","memory":"300M"}}` | We recommend to review the default resource limits as this should a conscious choice. |
| service.logging.businessLogic | string | `"Information"` | |
| service.logging.default | string | `"Information"` | |
| service.healthChecks.startup.path | string | `"/health/startup"` | |
| service.healthChecks.startup.tags[0].name | string | `"HEALTHCHECKS__0__TAGS__1"` | |
| service.healthChecks.startup.tags[0].value | string | `"policyhubdb"` | |
| service.healthChecks.liveness.path | string | `"/healthz"` | |
| service.healthChecks.readyness.path | string | `"/ready"` | |
| service.swaggerEnabled | bool | `false` | |
| migrations.image.name | string | `"docker.io/tractusx/policy-hub-migrations"` | |
| migrations.image.tag | string | `""` | |
| migrations.imagePullPolicy | string | `"IfNotPresent"` | |
| migrations.resources | object | `{"limits":{"cpu":"45m","memory":"105M"},"requests":{"cpu":"15m","memory":"105M"}}` | We recommend to review the default resource limits as this should a conscious choice. |
| migrations.seeding.testDataEnvironments | string | `""` | |
| migrations.seeding.testDataPaths | string | `"Seeder/Data"` | |
| migrations.logging.default | string | `"Information"` | |
| dotnetEnvironment | string | `"Production"` | |
| dbConnection.schema | string | `"hub"` | |
| dbConnection.sslMode | string | `"Disable"` | |
Expand Down
28 changes: 14 additions & 14 deletions charts/policy-hub/templates/deployment-hub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ spec:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
image: "{{ .Values.policyhub.image.name }}:{{ .Values.policyhub.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: "{{ .Values.policyhub.imagePullPolicy }}"
image: "{{ .Values.service.image.name }}:{{ .Values.service.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: "{{ .Values.service.imagePullPolicy }}"
env:
- name: DOTNET_ENVIRONMENT
value: "{{ .Values.dotnetEnvironment }}"
Expand All @@ -69,14 +69,14 @@ spec:
value: "Server={{ .Values.externalDatabase.host }};Database={{ .Values.externalDatabase.database }};Port={{ .Values.externalDatabase.port }};User Id={{ .Values.externalDatabase.username }};Password=$(POLICY_HUB_PASSWORD);Ssl Mode={{ .Values.dbConnection.sslMode }};"
{{- end }}
- name: "HEALTHCHECKS__0__PATH"
value: "{{ .Values.policyhub.healthChecks.startup.path}}"
{{- if .Values.policyhub.healthChecks.startup.tags }}
{{- toYaml .Values.policyhub.healthChecks.startup.tags | nindent 8 }}
value: "{{ .Values.service.healthChecks.startup.path}}"
{{- if .Values.service.healthChecks.startup.tags }}
{{- toYaml .Values.service.healthChecks.startup.tags | nindent 8 }}
{{- end }}
- name: "HEALTHCHECKS__1__PATH"
value: "{{ .Values.policyhub.healthChecks.readyness.path}}"
value: "{{ .Values.service.healthChecks.readyness.path}}"
- name: "HEALTHCHECKS__2__PATH"
value: "{{ .Values.policyhub.healthChecks.liveness.path}}"
value: "{{ .Values.service.healthChecks.liveness.path}}"
- name: "JWTBEAREROPTIONS__METADATAADDRESS"
value: "{{ .Values.centralidp.address }}{{ .Values.centralidp.jwtBearerOptions.metadataPath }}"
- name: "JWTBEAREROPTIONS__REQUIREHTTPSMETADATA"
Expand All @@ -88,18 +88,18 @@ spec:
- name: "JWTBEAREROPTIONS__REFRESHINTERVAL"
value: "{{ .Values.centralidp.jwtBearerOptions.refreshInterval }}"
- name: "SERILOG__MINIMUMLEVEL__Default"
value: "{{ .Values.policyhub.logging.default }}"
value: "{{ .Values.service.logging.default }}"
- name: "SERILOG__MINIMUMLEVEL__OVERRIDE__Org.Eclipse.TractusX.PolicyHub.Service"
value: "{{ .Values.policyhub.logging.businessLogic }}"
value: "{{ .Values.service.logging.businessLogic }}"
- name: "SWAGGERENABLED"
value: "{{ .Values.policyhub.swaggerEnabled }}"
value: "{{ .Values.service.swaggerEnabled }}"
ports:
- name: http
containerPort: {{ .Values.portContainer }}
protocol: TCP
startupProbe:
httpGet:
path: {{ .Values.policyhub.healthChecks.startup.path }}
path: {{ .Values.service.healthChecks.startup.path }}
port: {{ .Values.portContainer }}
scheme: HTTP
initialDelaySeconds: {{ .Values.startupProbe.initialDelaySeconds }}
Expand All @@ -109,7 +109,7 @@ spec:
failureThreshold: {{ .Values.startupProbe.failureThreshold }}
livenessProbe:
httpGet:
path: {{ .Values.policyhub.healthChecks.liveness.path }}
path: {{ .Values.service.healthChecks.liveness.path }}
port: {{ .Values.portContainer }}
scheme: HTTP
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
Expand All @@ -119,7 +119,7 @@ spec:
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
readinessProbe:
httpGet:
path: {{ .Values.policyhub.healthChecks.readyness.path }}
path: {{ .Values.service.healthChecks.readyness.path }}
port: {{ .Values.portContainer }}
scheme: HTTP
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
Expand All @@ -128,7 +128,7 @@ spec:
successThreshold: {{ .Values.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
resources:
{{- toYaml .Values.policyhub.resources | nindent 10 }}
{{- toYaml .Values.service.resources | nindent 10 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
14 changes: 7 additions & 7 deletions charts/policy-hub/templates/job-policy-hub-migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ metadata:
spec:
template:
metadata:
name: {{ .Values.policyhubmigrations.name }}-migrations
name: {{ .Values.migrations.name }}-migrations
spec:
restartPolicy: Never
containers:
Expand All @@ -43,8 +43,8 @@ spec:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
image: "{{ .Values.policyhubmigrations.image.name }}:{{ .Values.policyhubmigrations.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: "{{ .Values.policyhubmigrations.imagePullPolicy }}"
image: "{{ .Values.migrations.image.name }}:{{ .Values.migrations.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: "{{ .Values.migrations.imagePullPolicy }}"
env:
- name: DOTNET_ENVIRONMENT
value: "{{ .Values.dotnetEnvironment }}"
Expand All @@ -67,14 +67,14 @@ spec:
value: "Server={{ .Values.externalDatabase.host }};Database={{ .Values.externalDatabase.database }};Port={{ .Values.externalDatabase.port }};User Id={{ .Values.externalDatabase.username }};Password=$(POLICY_HUB_PASSWORD);Ssl Mode={{ .Values.dbConnection.sslMode }};"
{{- end }}
- name: "SEEDING__TESTDATAENVIRONMENTS__0"
value: "{{ .Values.policyhubmigrations.seeding.testDataEnvironments }}"
value: "{{ .Values.migrations.seeding.testDataEnvironments }}"
- name: "SEEDING__DATAPATHS__0"
value: "{{ .Values.policyhubmigrations.seeding.testDataPaths }}"
value: "{{ .Values.migrations.seeding.testDataPaths }}"
- name: "SERILOG__MINIMUMLEVEL__Default"
value: "{{ .Values.policyhubmigrations.logging.default }}"
value: "{{ .Values.migrations.logging.default }}"
ports:
- name: http
containerPort: {{ .Values.portContainer }}
protocol: TCP
resources:
{{- toYaml .Values.policyhubmigrations.resources | nindent 10 }}
{{- toYaml .Values.migrations.resources | nindent 10 }}
4 changes: 2 additions & 2 deletions charts/policy-hub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# SPDX-License-Identifier: Apache-2.0
###############################################################

policyhub:
service:
image:
name: "docker.io/tractusx/policy-hub-service"
tag: ""
Expand Down Expand Up @@ -45,7 +45,7 @@ policyhub:
path: "/ready"
swaggerEnabled: false

policyhubmigrations:
migrations:
image:
name: "docker.io/tractusx/policy-hub-migrations"
tag: ""
Expand Down
2 changes: 1 addition & 1 deletion consortia/argocd-app-templates/appsetup-stable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:
backend:
service: "policy-hub-service"
port: 8080
policyhubmigrations:
migrations:
logging:
default: "Debug"
postgresql:
Expand Down
4 changes: 2 additions & 2 deletions consortia/environments/values-beta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ ingress:
- path: "/api/policy-hub"
pathType: "Prefix"

policyhub:
service:
swaggerEnabled: true

policyhubmigrations:
migrations:
logging:
default: "Debug"

Expand Down
4 changes: 2 additions & 2 deletions consortia/environments/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ keycloak:
tokenValidationParameters:
validAudience: "Cl23-CX-Policy-Hub"

policyhub:
service:
image:
tag: "dev"
imagePullPolicy: "Always"
swaggerEnabled: true

policyhubmigrations:
migrations:
image:
tag: "dev"
imagePullPolicy: "Always"
Expand Down
4 changes: 2 additions & 2 deletions consortia/environments/values-int.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ keycloak:
tokenValidationParameters:
validAudience: "Cl23-CX-Policy-Hub"

policyhub:
service:
swaggerEnabled: true

policyhubmigrations:
migrations:
logging:
default: "Debug"

Expand Down
4 changes: 2 additions & 2 deletions consortia/environments/values-pen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ ingress:
- path: "/api/policy-hub"
pathType: "Prefix"

policyhub:
service:
swaggerEnabled: true

policyhubmigrations:
migrations:
logging:
default: "Debug"

Expand Down
4 changes: 2 additions & 2 deletions consortia/environments/values-rc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ ingress:
- path: "/api/policy-hub"
pathType: "Prefix"

policyhub:
service:
image:
tag: "rc"
imagePullPolicy: "Always"
swaggerEnabled: true

policyhubmigrations:
migrations:
image:
tag: "rc"
imagePullPolicy: "Always"
Expand Down

0 comments on commit 79559ef

Please sign in to comment.