{{- if .Values.clusterConfig.cilium.enabled }}
{{if .Values.cilium.loadbalancerPool.enabled }}
apiVersion: "cilium.io/v2alpha1"
kind: CiliumLoadBalancerIPPool
metadata:
  name: "loadbalancer"
spec:
  blocks:
  {{- range .Values.cilium.loadbalancerPool.cidr }}
  - cidr: {{ . }}
  {{- end }}
---
apiVersion: "cilium.io/v2alpha1"
kind: CiliumL2AnnouncementPolicy
metadata:
  name: policy
spec:
  nodeSelector:
    matchExpressions:
      - key: node-role.kubernetes.io/control-plane
        operator: DoesNotExist
  externalIPs: true
  loadBalancerIPs: true
{{- end}}
{{- end }}
