-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add submodel registry dependency chart templates
- Loading branch information
1 parent
cc8608f
commit 84e5ebc
Showing
7 changed files
with
207 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: v2 | ||
description: A Helm chart for running the Basyx SM Registry (Basyx v2 - AAS v3) | ||
name: sm-registry | ||
type: application | ||
version: 0.0.1 |
62 changes: 62 additions & 0 deletions
62
examples/cloud/dependency_charts/sm-registry/templates/_helpers.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "sm-registry.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "sm-registry.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 "sm-registry.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "sm-registry.labels" -}} | ||
helm.sh/chart: {{ include "sm-registry.chart" . }} | ||
{{ include "sm-registry.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "sm-registry.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "sm-registry.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "sm-registry.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "sm-registry.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
9 changes: 9 additions & 0 deletions
9
examples/cloud/dependency_charts/sm-registry/templates/sm-registry-configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "sm-registry.fullname" . }}-config | ||
labels: | ||
{{- include "sm-registry.labels" . | nindent 4 }} | ||
data: | ||
application.yaml: |- | ||
{{ .Values.config | nindent 4 }} |
49 changes: 49 additions & 0 deletions
49
examples/cloud/dependency_charts/sm-registry/templates/sm-registry-deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "sm-registry.fullname" . }} | ||
labels: | ||
{{- include "sm-registry.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ .Values.replicaCount }} | ||
selector: | ||
matchLabels: | ||
{{- include "sm-registry.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
{{- with .Values.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "sm-registry.selectorLabels" . | nindent 8 }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: {{ .Values.image.name }} | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
env: | ||
{{- if .Values.kafka.connectionString }} | ||
- name: KAFKA_BOOTSTRAP_SERVERS | ||
value: {{ .Values.kafka.connectionString }} | ||
{{- end }} | ||
{{- if .Values.mongodb.connectionString }} | ||
- name: SPRING_DATA_MONGODB_URI | ||
value: {{ .Values.mongodb.connectionString }} | ||
{{- end }} | ||
ports: | ||
- name: http | ||
containerPort: {{ .Values.service.port }} | ||
protocol: TCP | ||
volumeMounts: | ||
- mountPath: /workspace/config/application.yaml | ||
name: {{ template "sm-registry.fullname" $ }}-config | ||
subPath: application.yaml | ||
volumes: | ||
- name: {{ template "sm-registry.fullname" $ }}-config | ||
configMap: | ||
name: {{ template "sm-registry.fullname" $ }}-config |
28 changes: 28 additions & 0 deletions
28
examples/cloud/dependency_charts/sm-registry/templates/sm-registry-ingress.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{{- if .Values.ingress.enabled }} | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
labels: | ||
{{- include "sm-registry.labels" . | nindent 4 }} | ||
name: {{ include "sm-registry.fullname" . }} | ||
annotations: | ||
cert-manager.io/cluster-issuer: letsencrypt | ||
spec: | ||
ingressClassName: nginx | ||
tls: | ||
- hosts: | ||
- {{ .Values.ingress.host }} | ||
secretName: {{ include "sm-registry.fullname" . }}-tls | ||
rules: | ||
- host: {{ .Values.ingress.host }} | ||
http: | ||
paths: | ||
- path: / | ||
# rewriteTarget: /$1 | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: {{ include "sm-registry.fullname" . }} | ||
port: | ||
number: {{ .Values.service.port }} | ||
{{ end -}} |
15 changes: 15 additions & 0 deletions
15
examples/cloud/dependency_charts/sm-registry/templates/sm-registry-service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "sm-registry.fullname" . }} | ||
labels: | ||
{{- include "sm-registry.labels" . | nindent 4 }} | ||
spec: | ||
type: {{ .Values.service.type }} | ||
ports: | ||
- port: {{ .Values.service.port }} | ||
targetPort: http | ||
protocol: TCP | ||
name: http | ||
selector: | ||
{{- include "sm-registry.selectorLabels" . | nindent 4 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
imagePullSecrets: [] | ||
|
||
image: | ||
# Possible current options: | ||
# - eclipsebasyx/submodel-registry-log-mongodb:2.0.0-SNAPSHOT | ||
# - eclipsebasyx/submodel-registry-kafka-mongodb:2.0.0-SNAPSHOT - Storage - MongoDB - Event-sink- Kafka | ||
# - eclipsebasyx/submodel-registry-log-mongodb:2.0.0-SNAPSHOT - Storage - MongoDB - Event-sink- Logging (Pod) | ||
# - eclipsebasyx/submodel-registry-kafka-mem:2.0.0-SNAPSHOT - Storage - In-memory - Event-sink- Kafka | ||
# - eclipsebasyx/submodel-registry-log-mem:2.0.0-SNAPSHOT - Storage - In-memory - Event-sink- Logging (Pod) | ||
|
||
# If Kafka is used, then the appropriate Bootstrap connection string must be provided. | ||
# If Mongo is used, then the appropriate MongoDB connection string must be provided. | ||
name: eclipsebasyx/submodel-registry-log-mongodb:2.0.0-SNAPSHOT | ||
pullPolicy: IfNotPresent | ||
|
||
resources: {} | ||
podAnnotations: {} | ||
|
||
kafka: | ||
connectionString: null | ||
mongodb: | ||
connectionString: null | ||
|
||
service: | ||
type: ClusterIP | ||
port: 8080 | ||
|
||
ingress: | ||
enabled: false | ||
host: sm-registry.local | ||
|
||
# Content of application.yaml | ||
config: | | ||
basyx: | ||
cors: | ||
allowed-origins: "*" | ||
allowed-methods: "GET,POST,PATCH,DELETE,PUT,OPTIONS,HEAD" | ||