---
#
# ConfigMap for MetalLB; not part of the AIStore Chart (or any chart) since
# different deployments will have different LoadBalancer solutions available
# to them. On our reference baremetal deployment we use metallb in L2 mode
# and the template 'ingress.yaml' in the AIS chart.
#
# If running k8s baremetal, there's no ready-made cloud provider
# provisioned loadbalancer service - so we use metalLB
# (https://metallb.universe.tf/). Using metalLB with BGP in
# the presence of Calico is tricky (see site) so the following
# is the simple layer 2 alternative as also described on the
# site. It does have the disadvantage of channeling all
# gateway traffic through a single node (from which it fans
# out to all pods matching the selector, ie all proxy pods) -
# as a simple redirection service the AIS proxy traffic is
# low in bandwidth although there can be many requests/s.
#
# In this example we dedicate a few addresses
# 10.132.179.10-20 for ingress. In the AIS chart values.yaml
# the .Values.aiscluster.ingress.gateway.externalIP must be in this
# range, or leave it blank and let metalLB assign.
#
apiVersion: v1
kind: ConfigMap
metadata:
  name: metallb-config
  namespace: metallb-system
data:
  config: |
    address-pools:
    - name: default
      protocol: layer2
      addresses:
      - 10.132.179.10-10.132.179.20

