Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting of additional labels for services #1678

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 16 additions & 5 deletions README.md

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions templates/core/core-svc.yaml
Expand Up @@ -4,6 +4,9 @@ metadata:
name: {{ template "harbor.core" . }}
labels:
{{ include "harbor.labels" . | indent 4 }}
{{- with .Values.core.serviceLabels }}
{{- toYaml . | nindent 4 }}
{{- end}}
{{- with .Values.core.serviceAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
3 changes: 3 additions & 0 deletions templates/database/database-svc.yaml
Expand Up @@ -5,6 +5,9 @@ metadata:
name: "{{ template "harbor.database" . }}"
labels:
{{ include "harbor.labels" . | indent 4 }}
{{- with .Values.database.internal.serviceLabels }}
{{- toYaml . | nindent 4 }}
{{- end}}
spec:
ports:
- port: 5432
Expand Down
3 changes: 3 additions & 0 deletions templates/exporter/exporter-svc.yaml
Expand Up @@ -5,6 +5,9 @@ metadata:
name: "{{ template "harbor.exporter" . }}"
labels:
{{ include "harbor.labels" . | indent 4 }}
{{- with .Values.exporter.serviceLabels }}
{{- toYaml . | nindent 4 }}
{{- end}}
spec:
ports:
- name: {{ template "harbor.metricsPortName" . }}
Expand Down
3 changes: 3 additions & 0 deletions templates/jobservice/jobservice-svc.yaml
Expand Up @@ -4,6 +4,9 @@ metadata:
name: "{{ template "harbor.jobservice" . }}"
labels:
{{ include "harbor.labels" . | indent 4 }}
{{- with .Values.jobservice.serviceLabels }}
{{- toYaml . | nindent 4 }}
{{- end}}
spec:
ports:
- name: {{ ternary "https-jobservice" "http-jobservice" .Values.internalTLS.enabled }}
Expand Down
9 changes: 9 additions & 0 deletions templates/nginx/service.yaml
Expand Up @@ -7,6 +7,9 @@ metadata:
name: {{ $clusterIP.name }}
labels:
{{ include "harbor.labels" . | indent 4 }}
{{- with $clusterIP.labels }}
{{- toYaml . | nindent 4 }}
{{- end}}
{{- with $clusterIP.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand All @@ -30,6 +33,9 @@ spec:
name: {{ $nodePort.name }}
labels:
{{ include "harbor.labels" . | indent 4 }}
{{- with $nodePort.labels }}
{{- toYaml . | nindent 4 }}
{{- end}}
spec:
type: NodePort
ports:
Expand All @@ -52,6 +58,9 @@ spec:
name: {{ $loadBalancer.name }}
labels:
{{ include "harbor.labels" . | indent 4 }}
{{- with $loadBalancer.labels }}
{{- toYaml . | nindent 4 }}
{{- end}}
{{- with $loadBalancer.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
3 changes: 3 additions & 0 deletions templates/portal/service.yaml
Expand Up @@ -4,6 +4,9 @@ metadata:
name: "{{ template "harbor.portal" . }}"
labels:
{{ include "harbor.labels" . | indent 4 }}
{{- with .Values.portal.serviceLabels }}
{{- toYaml . | nindent 4 }}
{{- end}}
{{- with .Values.portal.serviceAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
3 changes: 3 additions & 0 deletions templates/redis/service.yaml
Expand Up @@ -5,6 +5,9 @@ metadata:
name: {{ template "harbor.redis" . }}
labels:
{{ include "harbor.labels" . | indent 4 }}
{{- with .Values.redis.internal.serviceLabels }}
{{- toYaml . | nindent 4 }}
{{- end}}
spec:
ports:
- port: 6379
Expand Down
3 changes: 3 additions & 0 deletions templates/registry/registry-svc.yaml
Expand Up @@ -4,6 +4,9 @@ metadata:
name: "{{ template "harbor.registry" . }}"
labels:
{{ include "harbor.labels" . | indent 4 }}
{{- with .Values.registry.serviceLabels }}
{{- toYaml . | nindent 4 }}
{{- end}}
spec:
ports:
- name: {{ ternary "https-registry" "http-registry" .Values.internalTLS.enabled }}
Expand Down
3 changes: 3 additions & 0 deletions templates/trivy/trivy-svc.yaml
Expand Up @@ -5,6 +5,9 @@ metadata:
name: "{{ template "harbor.trivy" . }}"
labels:
{{ include "harbor.labels" . | indent 4 }}
{{- with .Values.trivy.serviceLabels }}
{{- toYaml . | nindent 4 }}
{{- end}}
spec:
ports:
- name: {{ ternary "https-trivy" "http-trivy" .Values.internalTLS.enabled }}
Expand Down
22 changes: 22 additions & 0 deletions values.yaml
Expand Up @@ -58,6 +58,8 @@ expose:
staticClusterIP: ""
# Annotations on the ClusterIP service
annotations: {}
# additional labels for the ClusterIP service
labels: {}
ports:
# The service port Harbor listens on when serving HTTP
httpPort: 80
Expand All @@ -66,6 +68,8 @@ expose:
nodePort:
# The name of NodePort service
name: harbor
# additional labels for the NodePort service
labels: {}
ports:
http:
# The service port Harbor listens on when serving HTTP
Expand All @@ -80,6 +84,8 @@ expose:
loadBalancer:
# The name of LoadBalancer service
name: harbor
# additional labels for the LoadBalancer service
labels: {}
# Set the IP if the LoadBalancer supports assigning IP
IP: ""
ports:
Expand Down Expand Up @@ -443,6 +449,8 @@ portal:
podLabels: {}
## Additional service annotations
serviceAnnotations: {}
## Additional service labels
serviceLabels: {}
## The priority class to run the pod as
priorityClassName:

Expand Down Expand Up @@ -480,6 +488,8 @@ core:
podLabels: {}
## Additional service annotations
serviceAnnotations: {}
## Additional service labels
serviceLabels: {}
## User settings configuration json string
configureUserSettings:
# The provider for updating project quota(usage), there are 2 options, redis or db.
Expand Down Expand Up @@ -570,6 +580,8 @@ jobservice:
podAnnotations: {}
## Additional deployment labels
podLabels: {}
## Additional service labels
serviceLabels: {}
# 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.
Expand Down Expand Up @@ -620,6 +632,8 @@ registry:
podAnnotations: {}
## Additional deployment labels
podLabels: {}
## Additional service labels
serviceLabels: {}
## The priority class to run the pod as
priorityClassName:
# Secret is used to secure the upload state from client
Expand Down Expand Up @@ -741,6 +755,8 @@ trivy:
podAnnotations: {}
## Additional deployment labels
podLabels: {}
## Additional service labels
serviceLabels: {}
## The priority class to run the pod as
priorityClassName:

Expand Down Expand Up @@ -773,6 +789,8 @@ database:
readinessProbe:
timeoutSeconds: 1
extraEnvVars: []
## Additional service labels
serviceLabels: {}
nodeSelector: {}
tolerations: []
affinity: {}
Expand Down Expand Up @@ -834,6 +852,8 @@ redis:
# memory: 256Mi
# cpu: 100m
extraEnvVars: []
## Additional service labels
serviceLabels: {}
nodeSelector: {}
tolerations: []
affinity: {}
Expand Down Expand Up @@ -887,6 +907,8 @@ exporter:
podAnnotations: {}
## Additional deployment labels
podLabels: {}
## Additional service labels
serviceLabels: {}
serviceAccountName: ""
# mount the service account token
automountServiceAccountToken: false
Expand Down