argocd-helm/charts/argo-rollouts/templates/dashboard/service.yaml
Gazal 2df52cba0e
feat(argo-rollouts): add loadBalancerClass field for Service resource (#2772)
Most users of ArgoCD may use `Ingress` (and soon `HTTPRoute`), but for those who may want to use `Service` of type `LoadBalancer`, this would be useful.
The `loadBalancerClass` field would allow for a `CloudProvider` agnostic way of offloading the reconciliation for Kubernetes Service resources of type `LoadBalancer` to an external controller.

Signed-off-by: Gazal Gafoor <gazal.gafoor@rea-group.com>
Signed-off-by: Gazal <gazal.gafoor@rea-group.com>
Co-authored-by: Aikawa <yu.croco@gmail.com>
2024-08-31 11:12:52 +01:00

47 lines
1.7 KiB
YAML

{{- if .Values.dashboard.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: {{ include "argo-rollouts.fullname" . }}-dashboard
namespace: {{ .Release.Namespace | quote }}
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.loadBalancerClass }}
loadBalancerClass: {{ . }}
{{- end }}
{{- 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 }}