traefik-helm-chart icon indicating copy to clipboard operation
traefik-helm-chart copied to clipboard

Add additional service for internal IP

Open muffl0n opened this issue 4 years ago • 2 comments

We're running a private GKE cluster that is reachable via internal IPs (via VPN) as well as via external IPs (via external Loadbalancer). We currently use ingress-nginx where you can configure an additional internal service. See:

  • https://github.com/kubernetes/ingress-nginx/blob/master/charts/ingress-nginx/templates/controller-service.yaml
  • https://github.com/kubernetes/ingress-nginx/blob/master/charts/ingress-nginx/templates/controller-service-internal.yaml
controller:
  service:
    internal:
      enabled: true
      annotations:
        networking.gke.io/internal-load-balancer-subnet: gke-services
        networking.gke.io/load-balancer-type: Internal
      loadBalancerIP: 10.10.10.10

The benefit is, that we can allow some Ingresses to only be accessible via private IPs.

I could not find a smiliar possibility to do this in Traefik. Am I missing something?

muffl0n avatar Jun 29 '21 11:06 muffl0n

Hi ! Also interested by this feature. Any update or roadmap please ?

yogeek avatar Aug 04 '22 14:08 yogeek

I have ended up applying this Service object manually as the Helm Chart doesn't provide an option for both Internal & External LB. If you need this managed by Helm you should be able to add a template file when installing.

>cat manifests/traefik/lb-internal.yaml 
apiVersion: v1
kind: Service
metadata:
  annotations:
    networking.gke.io/load-balancer-type: "Internal"
    networking.gke.io/internal-load-balancer-subnet: "int-01"
    networking.gke.io/internal-load-balancer-allow-global-access: "true"
  name: traefik-internal
  namespace: traefik
spec:
  externalTrafficPolicy: Cluster
  loadBalancerIP: 10.2.8.2
  ports:
    - name: web
      port: 80
      protocol: TCP
      targetPort: web
    - name: websecure
      port: 443
      protocol: TCP
      targetPort: websecure
  selector:
    app.kubernetes.io/instance: traefik
    app.kubernetes.io/name: traefik
  sessionAffinity: None
  type: LoadBalancer

christidis avatar Sep 26 '22 11:09 christidis