111 lines
2.6 KiB
Go Template
111 lines
2.6 KiB
Go Template
## HAProxy Kubernetes Ingress Controller configuration
|
|
## Ref: https://www.haproxy.com/documentation/kubernetes-ingress/
|
|
##
|
|
controller:
|
|
resources:
|
|
requests:
|
|
cpu: {{ .Values.haproxy.resources.controller.cpu }}
|
|
memory: {{ .Values.haproxy.resources.controller.memory }}
|
|
|
|
ingressClass: haproxy
|
|
|
|
ingressClassResource:
|
|
name: haproxy
|
|
default: true
|
|
|
|
config:
|
|
body-size: "0"
|
|
tune.bufsize: "131072"
|
|
ssl-redirect: "true"
|
|
forwarded-for: "true"
|
|
|
|
# Disable QUIC ar Hetzner LB doesn't support UDP
|
|
quic-enabled: "false"
|
|
|
|
# Proxy protocol
|
|
proxy-protocol: "10.0.0.0/8"
|
|
use-proxy-protocol: "true"
|
|
|
|
tolerations:
|
|
- key: unschedulable
|
|
operator: Exists
|
|
effect: NoSchedule
|
|
- key: node-role.kubernetes.io/control-plane
|
|
operator: Exists
|
|
effect: NoSchedule
|
|
|
|
affinity:
|
|
nodeAffinity:
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
nodeSelectorTerms:
|
|
- matchExpressions:
|
|
- key: kubernetes.io/hostname
|
|
operator: In
|
|
values: {{ .Values.clusterConfig.ingress_nodes }}
|
|
|
|
podAntiAffinity:
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
- labelSelector:
|
|
matchExpressions:
|
|
- key: app.kubernetes.io/instance
|
|
operator: In
|
|
values:
|
|
- ingress-haproxy
|
|
- key: app.kubernetes.io/name
|
|
operator: In
|
|
values:
|
|
- kubernetes-ingress
|
|
topologyKey: "kubernetes.io/hostname"
|
|
|
|
replicaCount: {{ .Values.clusterConfig.ingress_replica_count }}
|
|
|
|
PodDisruptionBudget:
|
|
enable: true
|
|
minAvailable: {{ .Values.haproxy.pdb.minAvailable }}
|
|
|
|
service:
|
|
{{- if .Values.clusterConfig.ingress_loadbalancer }}
|
|
type: LoadBalancer
|
|
{{- if .Values.clusterConfig.ingress_nodeport }}
|
|
nodePorts:
|
|
http: 30080
|
|
https: 30443
|
|
{{- end }}
|
|
{{- else if .Values.clusterConfig.ingress_nodeport }}
|
|
type: NodePort
|
|
externalTrafficPolicy: Local
|
|
nodePorts:
|
|
http: 30080
|
|
https: 30443
|
|
{{- else }}
|
|
type: ClusterIP
|
|
{{- end }}
|
|
annotations:
|
|
{{- with .Values.haproxy.annotations }}
|
|
{{ toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
|
|
hostNetwork: {{ .Values.clusterConfig.ingress_hostnetwork }}
|
|
|
|
hostPorts:
|
|
enable: {{ .Values.clusterConfig.ingress_hostport }}
|
|
http: 80
|
|
https: 443
|
|
|
|
stats:
|
|
enabled: true
|
|
|
|
prometheus:
|
|
enabled: true
|
|
port: 1024
|
|
service:
|
|
annotations:
|
|
prometheus.io/scrape: "true"
|
|
prometheus.io/port: "1024"
|
|
|
|
serviceMonitor:
|
|
enabled: true
|
|
|
|
extraArgs:
|
|
- --disable-quic
|