-
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 AAS discovery dependency chart templates
- Loading branch information
1 parent
84e5ebc
commit 5cefd10
Showing
7 changed files
with
203 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 AAS Discovery (Basyx v2 - AAS v3) | ||
name: aas-discovery | ||
type: application | ||
version: 0.0.1 |
62 changes: 62 additions & 0 deletions
62
examples/cloud/dependency_charts/aas-discovery/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 "aas-discovery.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 "aas-discovery.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 "aas-discovery.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "aas-discovery.labels" -}} | ||
helm.sh/chart: {{ include "aas-discovery.chart" . }} | ||
{{ include "aas-discovery.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "aas-discovery.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "aas-discovery.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "aas-discovery.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "aas-discovery.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
11 changes: 11 additions & 0 deletions
11
examples/cloud/dependency_charts/aas-discovery/templates/aas-discovery-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,11 @@ | ||
{{- if .Values.enabled }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "aas-discovery.fullname" . }}-config | ||
labels: | ||
{{- include "aas-discovery.labels" . | nindent 4 }} | ||
data: | ||
application.properties: |- | ||
{{ .Values.config | nindent 4 }} | ||
{{ end -}} |
42 changes: 42 additions & 0 deletions
42
examples/cloud/dependency_charts/aas-discovery/templates/aas-discovery-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,42 @@ | ||
{{- if .Values.enabled }} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "aas-discovery.fullname" . }} | ||
labels: | ||
{{- include "aas-discovery.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ .Values.replicaCount }} | ||
selector: | ||
matchLabels: | ||
{{- include "aas-discovery.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
{{- with .Values.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "aas-discovery.selectorLabels" . | nindent 8 }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: {{ .Values.image.name }} | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
ports: | ||
- name: http | ||
containerPort: {{ .Values.service.port }} | ||
protocol: TCP | ||
volumeMounts: | ||
- mountPath: /workspace/config/application.properties | ||
name: {{ template "aas-discovery.fullname" $ }}-config | ||
subPath: application.properties | ||
volumes: | ||
- name: {{ template "aas-discovery.fullname" $ }}-config | ||
configMap: | ||
name: {{ template "aas-discovery.fullname" $ }}-config | ||
{{ end -}} |
28 changes: 28 additions & 0 deletions
28
examples/cloud/dependency_charts/aas-discovery/templates/aas-discovery-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 and .Values.ingress.enabled .Values.enabled }} | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
labels: | ||
{{- include "aas-discovery.labels" . | nindent 4 }} | ||
name: {{ include "aas-discovery.fullname" . }} | ||
annotations: | ||
kubernetes.io/ingress.class: nginx | ||
cert-manager.io/cluster-issuer: letsencrypt | ||
spec: | ||
tls: | ||
- hosts: | ||
- {{ .Values.ingress.host }} | ||
secretName: {{ include "aas-discovery.fullname" . }}-tls | ||
rules: | ||
- host: {{ .Values.ingress.host }} | ||
http: | ||
paths: | ||
- path: / | ||
# rewriteTarget: /$1 | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: {{ include "aas-discovery.fullname" . }} | ||
port: | ||
number: {{ .Values.service.port }} | ||
{{ end -}} |
17 changes: 17 additions & 0 deletions
17
examples/cloud/dependency_charts/aas-discovery/templates/aas-discovery-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,17 @@ | ||
{{- if .Values.enabled }} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "aas-discovery.fullname" . }} | ||
labels: | ||
{{- include "aas-discovery.labels" . | nindent 4 }} | ||
spec: | ||
type: {{ .Values.service.type }} | ||
ports: | ||
- port: {{ .Values.service.port }} | ||
targetPort: http | ||
protocol: TCP | ||
name: http | ||
selector: | ||
{{- include "aas-discovery.selectorLabels" . | nindent 4 }} | ||
{{ end -}} |
38 changes: 38 additions & 0 deletions
38
examples/cloud/dependency_charts/aas-discovery/values.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,38 @@ | ||
imagePullSecrets: [] | ||
|
||
# Enabled by default | ||
enabled: true | ||
|
||
image: | ||
name: eclipsebasyx/aas-discovery:2.0.0-SNAPSHOT | ||
pullPolicy: IfNotPresent | ||
|
||
resources: {} | ||
podAnnotations: {} | ||
|
||
service: | ||
type: ClusterIP | ||
port: 8080 | ||
|
||
ingress: | ||
enabled: false | ||
host: aas-discovery.local | ||
|
||
# Content of application.properties | ||
config: | | ||
server.port=8080 | ||
spring.application.name=AAS Discovery Service | ||
basyx.aasdiscoveryservice.name=aas-discovery-service | ||
basyx.backend=MongoDB | ||
spring.data.mongodb.host=mongo | ||
spring.data.mongodb.database=aas-discovery | ||
spring.data.mongodb.authentication-database=admin | ||
spring.data.mongodb.username=mongoAdmin | ||
spring.data.mongodb.password=mongoPassword | ||
basyx.cors.allowed-origins=* | ||
basyx.cors.allowed-methods=GET,POST,PATCH,DELETE,PUT,OPTIONS,HEAD | ||