diff --git a/charts/argo-cd/templates/argocd-commit-server/networkpolicy.yaml b/charts/argo-cd/templates/argocd-commit-server/networkpolicy.yaml index c04a4a90..0c31a670 100644 --- a/charts/argo-cd/templates/argocd-commit-server/networkpolicy.yaml +++ b/charts/argo-cd/templates/argocd-commit-server/networkpolicy.yaml @@ -1,5 +1,6 @@ -kind: NetworkPolicy +{{- if .Values.global.networkPolicy.create }} apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy metadata: name: {{ template "argo-cd.commitServer.fullname" . }} namespace: {{ include "argo-cd.namespace" . }} @@ -21,3 +22,4 @@ spec: - namespaceSelector: { } ports: - port: 8087 +{{- end }} diff --git a/charts/argo-cd/templates/argocd-commit-server/service.yaml b/charts/argo-cd/templates/argocd-commit-server/service.yaml index e689f5b9..48e6200f 100644 --- a/charts/argo-cd/templates/argocd-commit-server/service.yaml +++ b/charts/argo-cd/templates/argocd-commit-server/service.yaml @@ -3,6 +3,17 @@ kind: Service metadata: name: {{ template "argo-cd.commitServer.fullname" . }} namespace: {{ include "argo-cd.namespace" . }} + labels: + {{- include "argo-cd.labels" (dict "context" . "component" .Values.commitServer.name "name" .Values.commitServer.name) | nindent 4 }} + {{- with .Values.commitServer.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.commitServer.service.annotations }} + annotations: + {{- range $key, $value := . }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- end }} spec: ports: - name: server diff --git a/charts/argo-cd/templates/argocd-commit-server/serviceaccount.yaml b/charts/argo-cd/templates/argocd-commit-server/serviceaccount.yaml index aefa7530..ceed7aa7 100644 --- a/charts/argo-cd/templates/argocd-commit-server/serviceaccount.yaml +++ b/charts/argo-cd/templates/argocd-commit-server/serviceaccount.yaml @@ -1,9 +1,18 @@ +{{- if .Values.commitServer.serviceAccount.create }} apiVersion: v1 kind: ServiceAccount metadata: - labels: - app.kubernetes.io/name: argocd-commit-server - app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: commit-server name: {{ include "argo-cd.commitServer.serviceAccountName" . }} namespace: {{ include "argo-cd.namespace" . }} + {{- with .Values.commitServer.serviceAccount.annotations }} + annotations: + {{- range $key, $value := . }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- end }} + labels: + {{- include "argo-cd.labels" (dict "context" . "component" .Values.commitServer.name "name" .Values.commitServer.name) | nindent 4 }} + {{- with .Values.commitServer.serviceAccount.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }}