From 9a133f69b4abda2660189e47d43959b5cb428921 Mon Sep 17 00:00:00 2001 From: Benjamin Chrobot <168231920+bchrobot-mh@users.noreply.github.com> Date: Wed, 28 Aug 2024 15:01:23 -0400 Subject: [PATCH] feat(selfserve-ui): support enable, labels, and annotations for service (#701) --- helm/charts/kratos-selfservice-ui-node/README.md | 3 +++ .../templates/service.yaml | 12 +++++++++++- helm/charts/kratos-selfservice-ui-node/values.yaml | 8 ++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/helm/charts/kratos-selfservice-ui-node/README.md b/helm/charts/kratos-selfservice-ui-node/README.md index 594d349924..f1525a528e 100644 --- a/helm/charts/kratos-selfservice-ui-node/README.md +++ b/helm/charts/kratos-selfservice-ui-node/README.md @@ -63,6 +63,9 @@ A Helm chart for ORY Kratos's example ui for Kubernetes | securityContext.runAsUser | int | `10000` | | | securityContext.seLinuxOptions.level | string | `"s0:c123,c456"` | | | securityContext.seccompProfile.type | string | `"RuntimeDefault"` | | +| service.annotations | object | `{}` | If you do want to specify annotations, uncomment the following lines, adjust them as necessary, and remove the curly braces after 'annotations:'. | +| service.enabled | bool | `true` | En-/disable the service | +| service.labels | object | `{}` | Provide custom labels. Use the same syntax as for annotations. | | service.loadBalancerIP | string | `""` | The load balancer IP | | service.name | string | `"http"` | The service port name. Useful to set a custom service port name if it must follow a scheme (e.g. Istio) | | service.nodePort | string | `""` | | diff --git a/helm/charts/kratos-selfservice-ui-node/templates/service.yaml b/helm/charts/kratos-selfservice-ui-node/templates/service.yaml index 7d4eb371aa..81eeeaadec 100644 --- a/helm/charts/kratos-selfservice-ui-node/templates/service.yaml +++ b/helm/charts/kratos-selfservice-ui-node/templates/service.yaml @@ -1,9 +1,18 @@ +{{- if .Values.service.enabled -}} +--- apiVersion: v1 kind: Service metadata: name: {{ include "kratos-selfservice-ui-node.fullname" . }} labels: -{{ include "kratos-selfservice-ui-node.labels" . | indent 4 }} + {{- include "kratos-selfservice-ui-node.labels" . | nindent 4 }} + {{- with .Values.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + annotations: + {{- with .Values.service.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: type: {{ .Values.service.type }} {{- if eq .Values.service.type "LoadBalancer" }} @@ -24,3 +33,4 @@ spec: selector: app.kubernetes.io/name: {{ include "kratos-selfservice-ui-node.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/helm/charts/kratos-selfservice-ui-node/values.yaml b/helm/charts/kratos-selfservice-ui-node/values.yaml index 55357e4d6f..7f7152b827 100644 --- a/helm/charts/kratos-selfservice-ui-node/values.yaml +++ b/helm/charts/kratos-selfservice-ui-node/values.yaml @@ -25,6 +25,7 @@ config: ## -- Service configuration service: + enabled: true type: ClusterIP # -- The load balancer IP loadBalancerIP: "" @@ -32,6 +33,13 @@ service: port: 80 # -- The service port name. Useful to set a custom service port name if it must follow a scheme (e.g. Istio) name: http + # -- Provide custom labels. Use the same syntax as for annotations. + labels: {} + # -- If you do want to specify annotations, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'annotations:'. + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" ## -- Secret configuration secret: