argocd-helm/charts/argo-rollouts/templates/dashboard/service.yaml
Jean Mainguy 3be6c52a64
feat(argo-rollouts): Add ability to define dashboard service node port (#1138)
* feat(argo-rollouts): Add ability to define dashboard service node port

Signed-off-by: Jean Mainguy <9969006+jhandguy@users.noreply.github.com>

* Apply changes from code review

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

Co-authored-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
2022-02-21 00:01:39 +01:00

43 lines
1.5 KiB
YAML

{{- if .Values.dashboard.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: {{ include "argo-rollouts.fullname" . }}-dashboard
labels:
app.kubernetes.io/component: {{ .Values.dashboard.component }}
{{- include "argo-rollouts.labels" . | nindent 4 }}
{{- with .Values.dashboard.service.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
annotations:
{{- with .Values.serviceAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.dashboard.service.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with .Values.dashboard.service.externalIPs }}
externalIPs: {{- toYaml . | nindent 4 }}
{{- end }}
{{- if eq .Values.dashboard.service.type "LoadBalancer" }}
{{- with .Values.dashboard.service.loadBalancerIP }}
loadBalancerIP: {{ . | quote }}
{{- end }}
{{- with .Values.dashboard.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges: {{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
type: {{ .Values.dashboard.service.type }}
ports:
- name: {{ .Values.dashboard.service.portName }}
protocol: TCP
port: {{ .Values.dashboard.service.port }}
targetPort: {{ .Values.dashboard.service.targetPort }}
{{- if and (eq .Values.dashboard.service.type "NodePort") .Values.dashboard.service.nodePort }}
nodePort: {{ .Values.dashboard.service.nodePort }}
{{- end }}
selector:
app.kubernetes.io/component: {{ .Values.dashboard.component }}
{{- include "argo-rollouts.selectorLabels" . | nindent 4 }}
{{- end }}