Rick Foland f858a1e4cd
Added LoadBalancer annotations and LoadBalancerIP (#111)
Co-authored-by: Marc-Antoine Fernandes <marcantoinefernandes@gmail.com>
2022-12-06 11:58:03 +01:00

30 lines
801 B
YAML

{{- if .Values.minikube }}
# we don't need a loadbalancer for local deployment purposes
{{ else }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "caddy-ingress-controller.fullname" . }}
namespace: {{ .Release.Namespace }}
{{- with .Values.loadBalancer.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "caddy-ingress-controller.labels" . | nindent 4 }}
spec:
type: "LoadBalancer"
loadBalancerIP: {{ .Values.loadBalancer.loadBalancerIP }} #Deprecated in Kubernetes v1.24
ports:
- name: http
port: 80
protocol: TCP
targetPort: http
- name: https
port: 443
protocol: TCP
targetPort: https
selector:
{{- include "caddy-ingress-controller.selectorLabels" . | nindent 4 }}
{{- end }}