Skip to content

Commit

Permalink
feat: add product store microservice
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejpetras committed Feb 20, 2024
1 parent 9ceeee8 commit 9a8288e
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
8 changes: 8 additions & 0 deletions templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@
{{- end -}}
{{- end -}}

{{- define "app-angular.microservice.product.name" -}}
{{- if .Values.operator.microservice.spec.productName -}}
{{- .Values.operator.microservice.spec.productName -}}
{{- else -}}
{{ include "app-angular.product.name" $ }}
{{- end -}}
{{- end -}}

{{- define "app-angular.labels.common" -}}
version: {{ .Values.version | default .Values.image.tag | quote }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Expand Down
16 changes: 16 additions & 0 deletions templates/operator-microservice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{ if .Values.operator.microservice.enabled }}
apiVersion: onecx.tkit.org/v1
kind: Microservice
metadata:
name: {{ include "app-angular.fullname" . }}
labels:
app: {{ include "app-angular.fullname" . }}
{{ include "app-angular.labels.common" $ | indent 4 }}
spec:
productName: {{ include "app-angular.microservice.product.name" $ }}
appId: {{ .Values.operator.microservice.spec.appId | default (include "app-angular.fullname" .) }}
name: {{ .Values.operator.microservice.spec.name | default (include "app-angular.fullname" .) }}
description: {{ .Values.operator.microservice.spec.description | default (include "app-angular.fullname" .) }}
version: {{ template "app-angular.version" $ }}
type: {{ .Values.operator.microservice.spec.type | default .Values.name }}
{{- end }}
19 changes: 18 additions & 1 deletion values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ image:
# Docker repository (application name)
repository: "change-me"
# Docker image tag (application version)
tag: "master"
tag: "main"
# pull policy Always | IfNotPresent | Never
pull: IfNotPresent

Expand Down Expand Up @@ -113,6 +113,23 @@ envCustom:

# Kubernetes operator configuration
operator:
# product store microservice
microservice:
# enable or disable configuration for operator
enabled: true
# CRD
spec:
# default deployment name (release_name-name)
appId:
# default release name (product name)
productName:
# application description (release_name-name)
description:
# default deployment name (release_name-name)
name:
# .Values.name or this type
type:

# permissions
permission:
# enable or disable configuration for operator
Expand Down

0 comments on commit 9a8288e

Please sign in to comment.