Skip to content

Commit

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

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

{{- define "app.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.fullname" . }}
labels:
app: {{ include "app.fullname" . }}
{{ include "app.labels.common" $ | indent 4 }}
spec:
productName: {{ include "app.microservice.product.name" $ }}
appId: {{ .Values.operator.microservice.spec.appId | default (include "app.fullname" .) }}
name: {{ .Values.operator.microservice.spec.name | default (include "app.fullname" .) }}
description: {{ .Values.operator.microservice.spec.description | default (include "app.fullname" .) }}
version: {{ template "app.version" $ }}
type: {{ .Values.operator.microservice.spec.type | default .Values.name }}
{{- end }}
17 changes: 17 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,23 @@ oidc:

# 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 1f4d608

Please sign in to comment.