{{- $ns := default .Release.Namespace .Values.namespace }}
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
  name: {{ .Values.name }}
  namespace: {{ $ns }}
spec:
  autoAssign: {{ .Values.autoAssign }}
  addresses:
  - {{ .Values.from }}-{{ .Values.to }}
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
  name: {{ .Values.name }}
  namespace: {{ $ns }}
spec:
  ipAddressPools:
  - {{ .Values.name }}
