Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm improvement #281

Merged
merged 11 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/registry/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sources:
- https://github.com/eclipse-tractusx/sldt-digital-twin-registry

type: application
version: 0.3.31
version: 0.3.32
appVersion: 0.3.23

dependencies:
Expand Down
103 changes: 52 additions & 51 deletions charts/registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,57 +30,58 @@ helm install registry -n semantics charts/registry

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| enableKeycloak | bool | `true` | |
| enablePostgres | bool | `true` | |
| keycloak.args[0] | string | `"kc.sh import --file /opt/keycloak/data/import/default-realm-import.json; kc.sh start-dev --hostname=registry-keycloak --hostname-strict=false --proxy=edge"` | |
| keycloak.auth.adminPassword | string | `"admin"` | |
| keycloak.auth.adminUser | string | `"admin"` | |
| keycloak.command[0] | string | `"/bin/sh"` | |
| keycloak.command[1] | string | `"-c"` | |
| keycloak.externalDatabase.existingSecret | string | `"keycloak-database-credentials"` | |
| keycloak.extraVolumeMounts[0].mountPath | string | `"/opt/keycloak/data/import/default-realm-import.json"` | |
| keycloak.extraVolumeMounts[0].name | string | `"init-script-vol"` | |
| keycloak.extraVolumeMounts[0].subPath | string | `"default-realm-import.json"` | |
| keycloak.extraVolumes[0].configMap.name | string | `"init-script-vol"` | |
| keycloak.extraVolumes[0].name | string | `"init-script-vol"` | |
| keycloak.fullnameOverride | string | `"registry-keycloak"` | |
| keycloak.postgresql.enabled | bool | `false` | |
| keycloak.service.type | string | `"ClusterIP"` | |
| postgresql.auth.database | string | `"default-database"` | |
| postgresql.auth.password | string | `"password"` | |
| postgresql.auth.username | string | `"default-user"` | |
| postgresql.primary.persistence.enabled | bool | `true` | |
| postgresql.primary.persistence.size | string | `"50Gi"` | |
| postgresql.service.ports.postgresql | int | `5432` | |
| registry.authentication | bool | `true` | |
| registry.containerPort | int | `4243` | |
| registry.dataSource.driverClassName | string | `"org.postgresql.Driver"` | |
| registry.dataSource.password | string | `""` | |
| registry.dataSource.sqlInitPlatform | string | `"pg"` | |
| registry.dataSource.url | string | `"jdbc:postgresql://database:5432"` | |
| registry.dataSource.user | string | `"default-user"` | |
| registry.host | string | `"minikube"` | |
| registry.idpClientId | string | `"default-client"` | |
| registry.idpIssuerUri | string | `""` | |
| registry.image.registry | string | `"docker.io"` | |
| registry.image.repository | string | `"tractusx/sldt-digital-twin-registry"` | |
| registry.image.version | string | `""` | |
| registry.imagePullPolicy | string | `"IfNotPresent"` | |
| registry.ingress.annotations | object | `{}` | |
| registry.ingress.className | string | `"nginx"` | |
| registry.ingress.enabled | bool | `false` | |
| registry.ingress.tls | bool | `false` | |
| registry.ingress.urlPrefix | string | `"/semantics/registry"` | |
| registry.replicaCount | int | `1` | |
| registry.resources.limits.memory | string | `"1024Mi"` | |
| registry.resources.requests.memory | string | `"512Mi"` | |
| registry.service.port | int | `8080` | |
| registry.service.type | string | `"ClusterIP"` | |
| registry.tenantId | string | `"default-tenant"` | |
| registry.externalSubjectIdWildcardPrefix | string | `PUBLIC_READABLE` | |
| registry.externalSubjectIdWildcardAllowedTypes | string | `manufacturerPartId,assetLifecyclePhase` | |
| Key | Type | Default | Description |
|------------------------------------------------|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------|
| enableKeycloak | bool | `true` | |
| enablePostgres | bool | `true` | |
| keycloak.args[0] | string | `"kc.sh import --file /opt/keycloak/data/import/default-realm-import.json; kc.sh start-dev --hostname=registry-keycloak --hostname-strict=false --proxy=edge"` | |
| keycloak.auth.adminPassword | string | `"admin"` | |
| keycloak.auth.adminUser | string | `"admin"` | |
| keycloak.command[0] | string | `"/bin/sh"` | |
| keycloak.command[1] | string | `"-c"` | |
| keycloak.externalDatabase.existingSecret | string | `"keycloak-database-credentials"` | |
| keycloak.extraVolumeMounts[0].mountPath | string | `"/opt/keycloak/data/import/default-realm-import.json"` | |
| keycloak.extraVolumeMounts[0].name | string | `"init-script-vol"` | |
| keycloak.extraVolumeMounts[0].subPath | string | `"default-realm-import.json"` | |
| keycloak.extraVolumes[0].configMap.name | string | `"init-script-vol"` | |
| keycloak.extraVolumes[0].name | string | `"init-script-vol"` | |
| keycloak.fullnameOverride | string | `"registry-keycloak"` | |
| keycloak.postgresql.enabled | bool | `false` | |
| keycloak.service.type | string | `"ClusterIP"` | |
| postgresql.auth.database | string | `"default-database"` | |
| postgresql.auth.password | string | `"password"` | |
| postgresql.auth.username | string | `"default-user"` | |
| postgresql.primary.persistence.enabled | bool | `true` | |
| postgresql.primary.persistence.size | string | `"50Gi"` | |
| postgresql.service.ports.postgresql | int | `5432` | |
| registry.name | string | `digital-twin-registry` | |
| registry.authentication | bool | `true` | |
| registry.containerPort | int | `4243` | |
| registry.dataSource.driverClassName | string | `"org.postgresql.Driver"` | |
| registry.dataSource.password | string | `""` | |
| registry.dataSource.sqlInitPlatform | string | `"pg"` | |
| registry.dataSource.url | string | `"jdbc:postgresql://database:5432"` | |
| registry.dataSource.user | string | `"default-user"` | |
| registry.host | string | `"minikube"` | |
| registry.idpClientId | string | `"default-client"` | |
| registry.idpIssuerUri | string | `""` | |
| registry.image.registry | string | `"docker.io"` | |
| registry.image.repository | string | `"tractusx/sldt-digital-twin-registry"` | |
| registry.image.version | string | `""` | |
| registry.imagePullPolicy | string | `"IfNotPresent"` | |
| registry.ingress.annotations | object | `{}` | |
| registry.ingress.className | string | `"nginx"` | |
| registry.ingress.enabled | bool | `false` | |
| registry.ingress.tls | bool | `false` | |
| registry.ingress.urlPrefix | string | `"/semantics/registry"` | |
| registry.replicaCount | int | `1` | |
| registry.resources.limits.memory | string | `"1024Mi"` | |
| registry.resources.requests.memory | string | `"512Mi"` | |
| registry.service.port | int | `8080` | |
| registry.service.type | string | `"ClusterIP"` | |
| registry.tenantId | string | `"default-tenant"` | |
| registry.externalSubjectIdWildcardPrefix | string | `PUBLIC_READABLE` | |
| registry.externalSubjectIdWildcardAllowedTypes | string | `manufacturerPartId,assetLifecyclePhase` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
48 changes: 48 additions & 0 deletions charts/registry/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "chart.name" -}}
florianrusch-zf marked this conversation as resolved.
Show resolved Hide resolved
{{- default .Chart.Name .Values.nameOverride | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end }}

{{/*
Create a default fully qualified app name.
If release name contains chart name it will be used as a full name.
*/}}
{{- define "chart.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "chart.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "chart.labels" -}}
helm.sh/chart: {{ include "chart.chart" . }}
{{ include "chart.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}


{{- define "chart.selectorLabels" -}}
app.kubernetes.io/name: {{ include "chart.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
apiVersion: v1
tunacicek marked this conversation as resolved.
Show resolved Hide resolved
kind: Secret
metadata:
name: keycloak-database-credentials
name: {{ .Values.keycloak.externalDatabase.existingSecret }}
type: Opaque
data:
db-host: {{ printf "%s-postgresql" .Release.Name | b64enc }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
kind: ConfigMap
apiVersion: v1
metadata:
name: init-script-vol
name: {{ .Values.registry.name }}-keycloak-configmap
data:
default-realm-import.json: |-
{{ .Files.Get "config/default-realm-import.json" | indent 4 }}
15 changes: 7 additions & 8 deletions charts/registry/templates/registry/registry-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,26 @@
# SPDX-License-Identifier: Apache-2.0
###############################################################

{{- $deployment_name := printf "cx-%s-registry" .Release.Name }}
{{- $sec_name := printf "%s-sec" $deployment_name }}
{{- $svc_name := printf "%s-svc" $deployment_name }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ $deployment_name }}
name: {{ .Values.registry.name }}
labels:
{{- include "chart.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.registry.replicaCount }}
selector:
matchLabels:
app: {{ $deployment_name }}
{{- include "chart.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
app: {{ $deployment_name }}
{{- include "chart.selectorLabels" . | nindent 8 }}
spec:
securityContext:
runAsUser: 100
containers:
- name: {{ $deployment_name }}
- name: {{ .Values.registry.name }}
image: {{ .Values.registry.image.registry }}/{{ .Values.registry.image.repository }}:{{ .Values.registry.image.version | default .Chart.AppVersion }}
imagePullPolicy: {{ .Values.registry.imagePullPolicy }}
securityContext:
Expand Down Expand Up @@ -70,7 +69,7 @@ spec:
failureThreshold: 3
envFrom:
- secretRef:
name: {{ $sec_name }}
name: {{ .Values.registry.name }}
resources:
{{ .Values.registry.resources | toYaml | indent 12 }}
imagePullSecrets:
Expand Down
9 changes: 3 additions & 6 deletions charts/registry/templates/registry/registry-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,14 @@
# SPDX-License-Identifier: Apache-2.0
###############################################################

{{- $deployment_name := printf "cx-%s-registry" .Release.Name }}
{{- $svc_name := printf "%s-svc" $deployment_name }}
{{- $ingr_name := printf "%s-ingr" $deployment_name }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $ingr_name }}
name: {{ .Values.registry.name }}
annotations:
{{ .Values.registry.ingress.annotations | toYaml | indent 4 }}
labels:
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
{{- include "chart.labels" . | nindent 4 }}
spec:
ingressClassName: {{ .Values.registry.ingress.className }}
{{- if .Values.registry.ingress.tls }}
Expand All @@ -46,7 +43,7 @@ spec:
pathType: Prefix
backend:
service:
name: {{ $svc_name }}
name: {{ include "chart.fullname" . }}
port:
number: {{ .Values.registry.service.port }}
{{- end}}
4 changes: 1 addition & 3 deletions charts/registry/templates/registry/registry-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@
# SPDX-License-Identifier: Apache-2.0
###############################################################

{{- $deployment_name := printf "cx-%s-registry" .Release.Name }}
{{- $sec_name := printf "%s-sec" $deployment_name }}
apiVersion: v1
kind: Secret
metadata:
name: {{ $sec_name }}
name: {{ .Values.registry.name }}
type: Opaque
data:
{{- if .Values.enablePostgres }}
Expand Down
Loading
Loading