major(ingress): Migrate hel1 to ha-proxy controller

Most ingresses annotations should be work with small changes.
This commit is contained in:
2026-05-06 10:37:24 +02:00
parent 464280cdc4
commit 0b73242b65
19 changed files with 310 additions and 49 deletions
@@ -0,0 +1,15 @@
haproxy:
enabled: true
autosync: true
pdb:
minAvailable: 1
resources:
controller:
cpu: "100m"
memory: "100Mi"
annotations:
load-balancer.hetzner.cloud/http-redirect-http: "true"
load-balancer.hetzner.cloud/location: hel1
load-balancer.hetzner.cloud/name: load-balancer-1
load-balancer.hetzner.cloud/type: lb11
load-balancer.hetzner.cloud/use-private-ip: "true"
+10
View File
@@ -0,0 +1,10 @@
haproxy:
enabled: false
autosync: true
pdb:
minAvailable: 1
resources:
controller:
cpu: "100m"
memory: "100Mi"
annotations: []
@@ -0,0 +1,40 @@
{{- if .Values.clusterConfig.argo.enabled }}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: ingress-haproxy
namespace: argocd
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
spec:
destination:
namespace: ingress-haproxy
server: 'https://kubernetes.default.svc'
sources:
- repoURL: {{ .Values.clusterConfig.manifests }}
targetRevision: HEAD
path: helmfile.d
plugin:
name: helmfile-cmp
env:
- name: CLUSTER_NAME
value: {{ .Values.clusterConfig.cluster }}
- name: HELMFILE_ENVIRONMENT
value: default
- name: HELMFILE_FILE_PATH
value: ingress-haproxy.yaml.gotmpl
project: sys
syncPolicy:
managedNamespaceMetadata:
labels:
component: sys
syncOptions:
- CreateNamespace=true
- ApplyOutOfSyncOnly=true
- ServerSideApply=true
{{- if .Values.haproxy.autosync }}
automated:
prune: true
# selfHeal: false
{{- end }}
{{- end }}
@@ -0,0 +1,16 @@
{{- if .Values.clusterConfig.cilium.enabled }}
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: allow-host-traffic
namespace: ingress-haproxy
spec:
egress:
- toEntities:
- kube-apiserver
- host
endpointSelector:
matchLabels:
app.kubernetes.io/name: kubernetes-ingress
app.kubernetes.io/instance: ingress-haproxy
{{- end }}
@@ -0,0 +1,16 @@
{{- if .Values.clusterConfig.cilium.enabled }}
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: allow-hubble-traffic
namespace: ingress-haproxy
spec:
egress:
- toFQDNs:
- matchPattern: hubble.*.*.*
- matchPattern: hubble.*.*.*.*
endpointSelector:
matchLabels:
app.kubernetes.io/name: kubernetes-ingress
app.kubernetes.io/instance: ingress-haproxy
{{- end }}
@@ -0,0 +1,19 @@
{{- if .Values.clusterConfig.cilium.enabled }}
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: allow-prometheus-metrics
namespace: ingress-haproxy
spec:
endpointSelector:
matchLabels:
app.kubernetes.io/instance: ingress-haproxy
ingress:
- fromEndpoints:
- matchLabels:
io.kubernetes.pod.namespace: prometheus
- toPorts:
- ports:
- port: "1024"
protocol: TCP
{{- end }}
@@ -0,0 +1,21 @@
{{- if .Values.clusterConfig.cilium.enabled }}
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: allow-world-to-ingress-haproxy
namespace: ingress-haproxy
spec:
endpointSelector:
matchLabels:
app.kubernetes.io/name: kubernetes-ingress
app.kubernetes.io/instance: ingress-haproxy
ingress:
- fromEntities:
- world
- toPorts:
- ports:
- port: "80"
protocol: TCP
- port: "443"
protocol: TCP
{{- end }}
@@ -0,0 +1,98 @@
## 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"
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