---
# Traefik service configuration with static LoadBalancer IP
apiVersion: v1
kind: Service
metadata:
  name: traefik
  namespace: kube-system
  annotations:
    # Get a stable IP from MetalLB
    metallb.universe.tf/address-pool: production
    metallb.universe.tf/allow-shared-ip: traefik-lb
  labels:
    app.kubernetes.io/instance: traefik-kube-system
    app.kubernetes.io/name: traefik
spec:
  type: LoadBalancer
  loadBalancerIP: {{ .cluster.loadBalancerIp }}
  selector:
    app.kubernetes.io/instance: traefik-kube-system
    app.kubernetes.io/name: traefik
  ports:
    - name: web
      port: 80
      targetPort: web
    - name: websecure
      port: 443
      targetPort: websecure
  externalTrafficPolicy: Local
