Skip to content

Commit

Permalink
feat(Gate-Pool): Deploy all helm charts with umbrella structure
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiodmota committed May 24, 2023
1 parent 22d05ec commit 449d8b5
Show file tree
Hide file tree
Showing 31 changed files with 295 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/helm-chart-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ jobs:
# install the chart to the kind cluster and run helm test
# define charts to test with the --charts parameter
- name: Run chart-testing (install)
run: ct install --charts charts/pool,charts/gate --config charts/config/chart-testing-config.yaml
run: ct install --charts charts/bpdm,charts/bpdm/charts/bpdm-pool,charts/bpdm/charts/bpdm-gate --config charts/config/chart-testing-config.yaml
if: ${{ env.CHART_CHANGED == 'true' }}
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ target
#local database data
/db
#Helm dependencies
/charts/pool/charts
/charts/pool/Chart.lock
/charts/gate/charts
/charts/gate/Chart.lock
/charts/bpdm/Chart.lock
/charts/bpdm/charts/Chart.lock
/charts/bpdm/charts/bpdm-gate/Chart.lock
/charts/bpdm/charts/bpdm-pool/Chart.lock
#Developer application properties
application-developer.properties
49 changes: 49 additions & 0 deletions charts/bpdm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
################################################################################
# Copyright (c) 2021,2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
################################################################################

apiVersion: v2
name: bpdm umbrella-chart
type: application
description: A Helm chart for Kubernetes that deploys the gate and pool applications
version: 0.1.0
appVersion: 1.0.0
home: https://github.com/eclipse-tractusx/bpdm
sources:
- https://github.com/eclipse-tractusx/bpdm

dependencies:
- name: bpdm-gate
version: 4.0.0-alpha.5
alias: bpdm-gate
condition: bpdm-gate.enabled
- name: bpdm-pool
version: 5.0.0-alpha.4
alias: bpdm-pool
condition: bpdm-pool.enabled
- name: opensearch
version: 2.*.*
repository: https://opensearch-project.github.io/helm-charts/
alias: opensearch
condition: opensearch.enabled
- name: postgresql
version: 11.*.*
repository: https://charts.bitnami.com/bitnami
alias: postgres
condition: postgres.enabled
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,31 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{- define "bpdm-gate.poolServiceName" -}}
{{- $config := .Values.applicationConfig -}}
{{- if and $config (not (empty $config.bpdm)) -}}
{{- $bpdm := $config.bpdm -}}
{{- if and $bpdm (not (empty $bpdm.pool)) -}}
{{- $pool := $bpdm.pool -}}
{{- if and $pool (not (empty (index $pool "base-url"))) -}}
{{- index $pool "base-url" -}}
{{- else -}}
{{- printf "%s-bpdm-pool" .Release.Name -}}
{{- end -}}
{{- else -}}
{{- printf "%s-bpdm-pool" .Release.Name -}}
{{- end -}}
{{- else -}}
{{- printf "%s-bpdm-pool" .Release.Name -}}
{{- end -}}
{{- end }}







{{/*
Selector labels
*/}}
Expand All @@ -83,6 +108,7 @@ Determine postgres service/host name to connect to
{{- include "includeWithPostgresContext" (list $ "postgresql.primary.fullname") }}
{{- end }}}


{{/*
Invoke include on given definition with postgresql dependency context
Usage: include "includeWithPostgresContext" (list $ "your_include_function_here")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ data:
datasource:
host: {{ include "bpdm.postgresDependency" . }}
pool:
base-url: http://pool-bpdm:8080/api/catena
base-url: {{include "bpdm-gate.poolServiceName" .}}
external.yml: |-
# External properties for overwriting application config
{{- if .Values.applicationConfig }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ spec:
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: 8081
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
{{- if .Values.ingress.enabled -}}
################################################################################
# Copyright (c) 2021,2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
################################################################################

{{ 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)) }}
Expand All @@ -15,24 +35,6 @@ apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
################################################################################
# Copyright (c) 2021,2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
################################################################################
name: {{ $fullName }}
labels:
{{- include "bpdm.labels" . | nindent 4 }}
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,12 @@ applicationConfig:

# Used to overwrite the secret property values of the application configuration
applicationSecrets:
spring:
datasource:
# overwrite for security reasons
password: bpdm
# bpdm:
# saas:
# api-key: ...

postgres:
enabled: true
auth:
database: bpdm
# overwrite for security reasons
postgresPassword: bpdm
username: bpdm
# overwrite for security reasons
password: bpdm
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ spec:
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: 8080
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
{{- if .Values.ingress.enabled -}}
################################################################################
# Copyright (c) 2021,2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
################################################################################

{{ 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)) }}
Expand All @@ -15,24 +36,6 @@ apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
################################################################################
# Copyright (c) 2021,2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
################################################################################
name: {{ $fullName }}
labels:
{{- include "bpdm.labels" . | nindent 4 }}
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ livenessProbe:
path: "/actuator/health/liveness"
port: 8080
scheme: HTTP
failureThreshold: 3
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 5
initialDelaySeconds: 120
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1

Expand Down Expand Up @@ -177,8 +177,54 @@ postgres:
enabled: true
auth:
database: bpdm
# overwrite for security reasons
postgresPassword: bpdm
username: bpdm
# overwrite for security reasons
password: bpdm

opensearch:
enabled: true
replicas: 1
protocol: http
roles:
- master
- ingest
- data
resources:
limits:
cpu: 300m
memory: 2Gi
requests:
cpu: 100m
memory: 2Gi
config:
opensearch.yml: |
cluster.name: opensearch-cluster
# Bind to all interfaces because we don't know what
# IP address Docker will assign to us.
network.host: 0.0.0.0
# Disable security
plugins.security.disabled: true
securityConfig:
enabled: false
extraInitContainers:
# Image that performs the sysctl operation to modify Kernel settings
# needed sometimes to avoid boot errors
- name: sysctl
image: docker.io/bitnami/bitnami-shell:10-debian-10-r199
imagePullPolicy: "IfNotPresent"
command:
- /bin/bash
- -ec
- |
CURRENT=`sysctl -n vm.max_map_count`;
DESIRED="262144";
if [ "$DESIRED" -gt "$CURRENT" ]; then
sysctl -w vm.max_map_count=262144;
fi;
CURRENT=`sysctl -n fs.file-max`;
DESIRED="65536";
if [ "$DESIRED" -gt "$CURRENT" ]; then
sysctl -w fs.file-max=65536;
fi;
securityContext:
runAsUser: 0
privileged: true

Loading

0 comments on commit 449d8b5

Please sign in to comment.