Skip to content

Commit

Permalink
Merge pull request #796 from eclipse-tractusx/feat/charts/bpdm-template
Browse files Browse the repository at this point in the history
Charts: Add BPDM Common library Chart
  • Loading branch information
nicoprow authored Mar 29, 2024
2 parents e59be75 + ae1fa70 commit c3e5528
Show file tree
Hide file tree
Showing 58 changed files with 856 additions and 1,381 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ target
/charts/bpdm/charts/Chart.lock
/charts/bpdm/charts/bpdm-gate/Chart.lock
/charts/bpdm/charts/bpdm-pool/Chart.lock
/charts/bpdm/charts/**/*.tgz
#Developer application properties
application-developer.properties
application-developer.yml
*.drawio.svg.bkp

11 changes: 11 additions & 0 deletions charts/bpdm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog (https://keepachangelog.com/en/1.0.0/),

## [4.0.4] - 2024-03-29

### Changed

- update BPDM Pool Chart to version 6.0.4
- update BPDM Gate Chart to version 5.0.4
- update BPDM Orchestrator Chart to version 2.0.4
- update BPDM Cleaning Service Dummy Chart to version 2.0.4
- update BPDM Bridge Chart to version 2.0.4
- remove fullNameOverride from postgres

## [4.0.3] - 2024-03-12

### Changed
Expand Down
14 changes: 8 additions & 6 deletions charts/bpdm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ apiVersion: v2
name: bpdm
type: application
description: A Helm chart for Kubernetes that deploys the BPDM applications
version: 4.0.3
version: 4.0.4
appVersion: "5.0.1"
home: https://github.com/eclipse-tractusx/bpdm
sources:
Expand All @@ -33,25 +33,27 @@ maintainers:

dependencies:
- name: bpdm-gate
version: 5.0.3
version: 5.0.4
alias: bpdm-gate
condition: bpdm-gate.enabled
- name: bpdm-pool
version: 6.0.3
version: 6.0.4
alias: bpdm-pool
condition: bpdm-pool.enabled
- name: bpdm-bridge-dummy
version: 2.0.3
version: 2.0.4
alias: bpdm-bridge-dummy
condition: bpdm-bridge-dummy.enabled
- name: bpdm-cleaning-service-dummy
version: 2.0.3
version: 2.0.4
alias: bpdm-cleaning-service-dummy
condition: bpdm-cleaning-service-dummy.enabled
- name: bpdm-orchestrator
version: 2.0.3
version: 2.0.4
alias: bpdm-orchestrator
condition: bpdm-orchestrator.enabled
- name: bpdm-common
version: 1.0.0
- name: postgresql
version: 11.9.13
repository: https://charts.bitnami.com/bitnami
Expand Down
6 changes: 6 additions & 0 deletions charts/bpdm/charts/bpdm-bridge-dummy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog (https://keepachangelog.com/en/1.0.0/),

## [2.0.4] - 2024-03-29

### Added

- add dependency to BPDM Common Chart

## [2.0.3] - 2024-03-12

### Changed
Expand Down
5 changes: 4 additions & 1 deletion charts/bpdm/charts/bpdm-bridge-dummy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ apiVersion: v2
type: application
name: bpdm-bridge-dummy
appVersion: "5.0.1"
version: 2.0.3
version: 2.0.4
description: A Helm chart for deploying the BPDM bridge dummy service
home: https://eclipse-tractusx.github.io/docs/kits/Business%20Partner%20Kit/Adoption%20View
sources:
Expand All @@ -33,6 +33,9 @@ dependencies:
repository: https://charts.bitnami.com/bitnami
alias: postgres
condition: postgres.enabled
- name: bpdm-common
version: 1.0.0
repository: "file://../bpdm-common"
maintainers:
- name: Nico Koprowski
- name: Fabio D. Mota
95 changes: 0 additions & 95 deletions charts/bpdm/charts/bpdm-bridge-dummy/templates/_helpers.tpl

This file was deleted.

33 changes: 11 additions & 22 deletions charts/bpdm/charts/bpdm-bridge-dummy/templates/configMap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,14 @@
# SPDX-License-Identifier: Apache-2.0
################################################################################

apiVersion: v1
kind: ConfigMap
metadata:
name: {{include "bpdm.fullname" .}}
labels:
{{- include "bpdm.labels" . | nindent 4 }}
data:
deployment.yml: |-
# Place for putting standard deployment configuration
# which can be overwritten by external.yml
bpdm:
datasource:
host: {{ include "bpdm.postgresDependency" . }}
pool:
base-url: http://{{ include "bpdm.toReleaseName" (list . "bpdm-pool") }}
gate:
base-url: http://{{ include "bpdm.toReleaseName" (list . "bpdm-gate") }}
external.yml: |-
# External properties for overwriting application config
{{- if .Values.applicationConfig }}
{{- .Values.applicationConfig | toYaml | nindent 4 }}
{{- end }}
{{ include "bpdm-common.configMap" (dict "context" $ "defaultValues" "bpdm-bridge-dummy.configmapDefaults") -}}
{{- define "bpdm-bridge-dummy.configmapDefaults" -}}
bpdm:
datasource:
host: {{ include "bpdm.postgresDependency" . }}
client:
gate:
base-url: http://{{ include "bpdm.toReleaseName" (list . "bpdm-gate") }}
pool:
base-url: http://{{ include "bpdm.toReleaseName" (list . "bpdm-pool") }}
{{- end -}}
90 changes: 1 addition & 89 deletions charts/bpdm/charts/bpdm-bridge-dummy/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,92 +18,4 @@
# SPDX-License-Identifier: Apache-2.0
################################################################################

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "bpdm.fullname" . }}
labels:
{{- include "bpdm.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "bpdm.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configMap.yaml") . | sha256sum }}
{{- with .Values.podAnnotations}}
{{- toYaml . | nindent 8}}
{{- end}}
labels:
{{- include "bpdm.selectorLabels" . | nindent 8}}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
# @url: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server
automountServiceAccountToken: false
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: SPRING_PROFILES_ACTIVE
value: {{ .Values.springProfiles | join "," }}
- name: SPRING_CONFIG_IMPORT
value: "/etc/conf/deployment.yml,/etc/conf/external.yml,/etc/conf/secrets.yml"
- name: SPRING_DATASOURCE_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "bpdm.postgresDependency" . }}
key: password
ports:
- name: http
containerPort: 8083
protocol: TCP
# @url: https://cloud.google.com/blog/products/containers-kubernetes/kubernetes-best-practices-setting-up-health-checks-with-readiness-and-liveness-probes
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
readinessProbe:
{{- toYaml .Values.readinessProbe | nindent 12 }}
startupProbe:
{{- toYaml .Values.startupProbe | nindent 12 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- mountPath: /etc/conf
name: config
readOnly: true
- mountPath: /tmp
name: cache
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: config
projected:
sources:
- configMap:
name: {{ include "bpdm.fullname" . }}
- secret:
name: {{ include "bpdm.fullname" . }}
- name: cache
emptyDir:
sizeLimit: 200Mi
{{ include "bpdm-common.deployment" . -}}
62 changes: 1 addition & 61 deletions charts/bpdm/charts/bpdm-bridge-dummy/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,64 +19,4 @@
################################################################################


{{if .Values.ingress.enabled}}
{{- $fullName := include "bpdm.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "bpdm.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{ include "bpdm-common.ingress" . -}}
Loading

0 comments on commit c3e5528

Please sign in to comment.