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 2 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
102 changes: 51 additions & 51 deletions charts/registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,57 +30,57 @@ 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.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)
16 changes: 8 additions & 8 deletions charts/registry/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "chart.name" -}}
{{- define "dtr.name" -}}
{{- 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" -}}
{{- define "dtr.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
Expand All @@ -25,24 +25,24 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "chart.chart" -}}
{{- define "dtr.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" . }}
{{- define "dtr.labels" -}}
helm.sh/chart: {{ include "dtr.chart" . }}
{{ include "dtr.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" . }}
{{- define "dtr.selectorLabels" -}}
app.kubernetes.io/name: {{ include "dtr.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
kind: ConfigMap
apiVersion: v1
metadata:
name: {{ include "chart.fullname" . }}-keycloak-configmap
name: {{ include "dtr.fullname" . }}-keycloak-configmap
tunacicek marked this conversation as resolved.
Show resolved Hide resolved
data:
default-realm-import.json: |-
{{ .Files.Get "config/default-realm-import.json" | indent 4 }}
12 changes: 6 additions & 6 deletions charts/registry/templates/registry/registry-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "chart.fullname" . }}
name: {{ include "dtr.fullname" . }}
labels:
{{- include "chart.labels" . | nindent 4 }}
{{- include "dtr.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.registry.replicaCount }}
selector:
matchLabels:
{{- include "chart.selectorLabels" . | nindent 6 }}
{{- include "dtr.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "chart.selectorLabels" . | nindent 8 }}
{{- include "dtr.selectorLabels" . | nindent 8 }}
spec:
securityContext:
runAsUser: 100
containers:
- name: {{ .Chart.Name }}
- name: {{ include "dtr.fullname" . }}
tunacicek marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -69,7 +69,7 @@ spec:
failureThreshold: 3
envFrom:
- secretRef:
name: {{ include "chart.fullname" . }}
name: {{ include "dtr.fullname" .}}
resources:
{{ .Values.registry.resources | toYaml | indent 12 }}
imagePullSecrets:
Expand Down
6 changes: 3 additions & 3 deletions charts/registry/templates/registry/registry-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "chart.fullname" . }}
name: {{ include "dtr.fullname" . }}
annotations:
{{ .Values.registry.ingress.annotations | toYaml | indent 4 }}
labels:
{{- include "chart.labels" . | nindent 4 }}
{{- include "dtr.labels" . | nindent 4 }}
spec:
ingressClassName: {{ .Values.registry.ingress.className }}
{{- if .Values.registry.ingress.tls }}
Expand All @@ -43,7 +43,7 @@ spec:
pathType: Prefix
backend:
service:
name: {{ include "chart.fullname" . }}
name: {{ include "dtr.fullname" . }}
port:
number: {{ .Values.registry.service.port }}
{{- end}}
2 changes: 1 addition & 1 deletion charts/registry/templates/registry/registry-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ include "chart.fullname" . }}
name: {{ include "dtr.fullname" . }}
type: Opaque
data:
{{- if .Values.enablePostgres }}
Expand Down
6 changes: 3 additions & 3 deletions charts/registry/templates/registry/registry-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "chart.fullname" . }}
name: {{ include "dtr.fullname" . }}
tunacicek marked this conversation as resolved.
Show resolved Hide resolved
labels:
{{- include "chart.labels" . | nindent 4 }}
{{- include "dtr.labels" . | nindent 4 }}
spec:
type: {{ .Values.registry.service.type }}
ports:
- port: {{ .Values.registry.service.port }}
targetPort: {{ .Values.registry.containerPort }}
selector:
{{- include "chart.selectorLabels" . | nindent 4 }}
{{- include "dtr.selectorLabels" . | nindent 4 }}
2 changes: 1 addition & 1 deletion charts/registry/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# SPDX-License-Identifier: Apache-2.0
###############################################################

{{- $fullName := include "chart.fullname" . }}
{{- $fullName := include "dtr.fullname" . }}
{{- $testconnection_name := printf "%s-test-script-pod" $fullName }}
{{- $testsec_name := printf "%s-test-credentials" $fullName }}
{{- $testconfig_name := printf "%s-test-script" $fullName }}
Expand Down
3 changes: 1 addition & 2 deletions charts/registry/templates/tests/test-credentials.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
#
# SPDX-License-Identifier: Apache-2.0
###############################################################

{{- $fullName := include "chart.fullname" . }}
{{- $fullName := include "dtr.fullname" . }}
{{- $testsec_name := printf "%s-test-credentials" $fullName }}
apiVersion: v1
kind: Secret
Expand Down
Loading
Loading