From 9d9d689133bb1168cad8b28c91d59fd7e1d16e64 Mon Sep 17 00:00:00 2001 From: afreyermuth98 Date: Wed, 14 Jun 2023 17:07:41 +0200 Subject: [PATCH 1/2] Allow customization of annotations on services exposing metrics Signed-off-by: afreyermuth98 --- README.md | 3 +++ templates/exporter/exporter-svc.yaml | 4 ++++ templates/jobservice/jobservice-svc.yaml | 4 ++++ templates/registry/registry-svc.yaml | 4 ++++ values.yaml | 7 +++++++ 5 files changed, 22 insertions(+) diff --git a/README.md b/README.md index ca150b575..d9590b5b3 100644 --- a/README.md +++ b/README.md @@ -247,6 +247,7 @@ The following table lists the configurable parameters of the Harbor chart and th | `jobservice.tolerations` | Tolerations for pod assignment | `[]` | | `jobservice.affinity` | Node/Pod affinities | `{}` | | `jobservice.podAnnotations` | Annotations to add to the jobservice pod | `{}` | +| `jobservice.serviceAnnotations` | Annotations to add to the jobservice service | `{}` | | `jobservice.priorityClassName` | The priority class to run the pod as | | | `jobservice.secret` | Secret is used when job service communicates with other components. If a secret key is not specified, Helm will generate one. Must be a string of 16 chars. | | | **Registry** | | | @@ -264,6 +265,7 @@ The following table lists the configurable parameters of the Harbor chart and th | `registry.affinity` | Node/Pod affinities | `{}` | | `registry.middleware` | Middleware is used to add support for a CDN between backend storage and `docker pull` recipient. See [official docs](https://github.com/docker/distribution/blob/master/docs/configuration.md#middleware). | | | `registry.podAnnotations` | Annotations to add to the registry pod | `{}` | +| `registry.serviceAnnotations` | Annotations to add to the registry service | `{}` | | `registry.priorityClassName` | The priority class to run the pod as | | | `registry.secret` | Secret is used to secure the upload state from client and registry storage backend. See [official docs](https://github.com/docker/distribution/blob/master/docs/configuration.md#http). If a secret key is not specified, Helm will generate one. Must be a string of 16 chars. | | | `registry.credentials.username` | The username that harbor core uses internally to access the registry instance. Together with the `registry.credentials.password`, a htpasswd  is created. This is an alternative to providing `registry.credentials.htpasswdString`. For more details see [official docs](https://github.com/docker/distribution/blob/master/docs/configuration.md#htpasswd). | `harbor_registry_user` | @@ -343,6 +345,7 @@ The following table lists the configurable parameters of the Harbor chart and th | `exporter.replicas` | The replica count | `1` | | `exporter.revisionHistoryLimit` | The revision history limit | `10` | | `exporter.podAnnotations` | Annotations to add to the exporter pod | `{}` | +| `exporter.serviceAnnotations` | Annotations to add to the exporter service | `{}` | | `exporter.image.repository` | Repository for redis image | `goharbor/harbor-exporter` | | `exporter.image.tag` | Tag for exporter image | `dev` | | `exporter.nodeSelector` | Node labels for pod assignment | `{}` | diff --git a/templates/exporter/exporter-svc.yaml b/templates/exporter/exporter-svc.yaml index 4a6f3fdec..e8446b47a 100644 --- a/templates/exporter/exporter-svc.yaml +++ b/templates/exporter/exporter-svc.yaml @@ -5,6 +5,10 @@ metadata: name: "{{ template "harbor.exporter" . }}" labels: {{ include "harbor.labels" . | indent 4 }} +{{- with .Values.exporter.serviceAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} +{{- end }} spec: ports: - name: {{ template "harbor.metricsPortName" . }} diff --git a/templates/jobservice/jobservice-svc.yaml b/templates/jobservice/jobservice-svc.yaml index d2b7a47fd..79ff169fd 100644 --- a/templates/jobservice/jobservice-svc.yaml +++ b/templates/jobservice/jobservice-svc.yaml @@ -4,6 +4,10 @@ metadata: name: "{{ template "harbor.jobservice" . }}" labels: {{ include "harbor.labels" . | indent 4 }} +{{- with .Values.jobservice.serviceAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} +{{- end }} spec: ports: - name: {{ ternary "https-jobservice" "http-jobservice" .Values.internalTLS.enabled }} diff --git a/templates/registry/registry-svc.yaml b/templates/registry/registry-svc.yaml index 749690ea0..bda68d112 100644 --- a/templates/registry/registry-svc.yaml +++ b/templates/registry/registry-svc.yaml @@ -4,6 +4,10 @@ metadata: name: "{{ template "harbor.registry" . }}" labels: {{ include "harbor.labels" . | indent 4 }} +{{- with .Values.registry.serviceAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} +{{- end }} spec: ports: - name: {{ ternary "https-registry" "http-registry" .Values.internalTLS.enabled }} diff --git a/values.yaml b/values.yaml index 5ed0c03dd..10d42ed73 100644 --- a/values.yaml +++ b/values.yaml @@ -518,6 +518,8 @@ jobservice: affinity: {} ## Additional deployment annotations podAnnotations: {} + ## Additional service annotations + serviceAnnotations: {} ## Additional deployment labels podLabels: {} # Secret is used when job service communicates with other components. @@ -558,6 +560,8 @@ registry: affinity: {} ## Additional deployment annotations podAnnotations: {} + ## Additional service annotations + serviceAnnotations: {} ## Additional deployment labels podLabels: {} ## The priority class to run the pod as @@ -788,6 +792,7 @@ redis: existingSecret: "" ## Additional deployment annotations podAnnotations: {} + svcAnnotations: {} ## Additional deployment labels podLabels: {} @@ -800,6 +805,8 @@ exporter: # cpu: 100m extraEnvVars: [] podAnnotations: {} + ## Additional service annotations + serviceAnnotations: {} ## Additional deployment labels podLabels: {} serviceAccountName: "" From 43180f06100b7d3344c55a4fe62b20c2be16a8eb Mon Sep 17 00:00:00 2001 From: afreyermuth98 Date: Thu, 15 Jun 2023 09:17:05 +0200 Subject: [PATCH 2/2] :poop: Corrected some bad naming Signed-off-by: afreyermuth98 --- values.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/values.yaml b/values.yaml index 10d42ed73..96a49e24d 100644 --- a/values.yaml +++ b/values.yaml @@ -792,7 +792,8 @@ redis: existingSecret: "" ## Additional deployment annotations podAnnotations: {} - svcAnnotations: {} + ## Additional service annotations + serviceAnnotations: {} ## Additional deployment labels podLabels: {}