diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index 8c81a33..d664cb7 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -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 "+" "_" }} diff --git a/templates/operator-microservice.yaml b/templates/operator-microservice.yaml new file mode 100644 index 0000000..ce84726 --- /dev/null +++ b/templates/operator-microservice.yaml @@ -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 }} diff --git a/values.yaml b/values.yaml index a2507eb..fd59cf6 100644 --- a/values.yaml +++ b/values.yaml @@ -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 @@ -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