Skip to content

Instantly share code, notes, and snippets.

@janeczku
Created November 10, 2023 13:41
Show Gist options
  • Save janeczku/a114a795a19e5585a10f801788b692f0 to your computer and use it in GitHub Desktop.
Save janeczku/a114a795a19e5585a10f801788b692f0 to your computer and use it in GitHub Desktop.
Configure RKE2 to expose the Nginx Ingress behind a Metallb VIP
  1. Before installing RKE2 on the node create the following file:
# /var/lib/rancher/rke2/server/manifests/rke2-ingress-nginx-config.yaml
---
apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
  name: rke2-ingress-nginx
  namespace: kube-system
spec:
  valuesContent: |-
    controller:
      config:
        use-forwarded-headers: "true"
        enable-real-ip: "true"
      publishService:
        enabled: true
      service:
        enabled: true
        type: LoadBalancer
        external:
          enabled: true
        externalTrafficPolicy: Local
        annotations:
          metallb.universe.tf/loadBalancerIPs: 192.168.20.45 # Configure static load balancer IP
  1. Install RKE2 normally

  2. Install Metallb into the cluster

  3. Have fun!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment