Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support k8gb behind a reverse proxy #1710

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

abaguas
Copy link
Collaborator

@abaguas abaguas commented Aug 25, 2024

⚠️ Note that this PR is based on #1672 ⚠️

Problem

K8GB reads the IP addresses it exposes from Ingress.Status.LoadBalancer.Ingress or from Service.Status.LoadBalancer.Ingress for ingresses configured with Kubernetes Ingress or Istio Virtual Service, respectively.
However, in some setups the clients do not route their traffic to these IP addresses because the cluster is behind a reverse proxy.

Solution

To support this setup, K8GB should expose DNS records with the IP address of the reverse proxy. Since the address is unknown to the cluster the K8GB administrator must provide it via configuration. This PR adds to K8GB the capability to read IP address from an annotation k8gb.io/exposed-ip-addresses on Ingress and Service resources.

Examples

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  labels:
    app: ingress
  annotations:
    k8gb.io/exposed-ip-addresses: "185.199.110.153"
apiVersion: v1
kind: Service
metadata:
  name: istio-ingressgateway
  namespace: istio-ingress
  labels:
    app: istio-ingressgateway
  annotations:
    k8gb.io/exposed-ip-addresses: "185.199.110.153,185.199.109.153"

Fixes #1275

Signed-off-by: Andre Baptista Aguas <[email protected]>
Problem
K8GB reads IP addresses from `Ingress.Status.LoadBalancer.Ingress` or from `Service.Status.LoadBalancer.Ingress` for ingress configured with Kubernetes Ingress and Istio Virtual Service, respectively.
The IP addresses exposed by these resources are the IP addresses exposed by the Kubernetes Cluster. However, in some setups the clients do not route their traffic to these IP addresses because the cluster is behind a reverse proxy.

Solution
To support this setup, K8GB should expose DNS records with the IP address of the reverse proxy. Since the address is unknown to the cluster the K8GB administrator must provide it via configuration. This PR adds to K8GB the capability to read IP address from an annotation `k8gb.io/external-ips` on Ingress and Service resources.

Examples
```
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  labels:
    app: ingress
  annotations:
    k8gb.io/external-ips: "185.199.110.153"
```

```
apiVersion: v1
kind: Service
metadata:
  name: istio-ingressgateway
  namespace: istio-ingress
  labels:
    app: istio-ingressgateway
  annotations:
    k8gb.io/external-ips: "185.199.110.153,185.199.109.153"
```

Fixes k8gb-io#1275

Signed-off-by: Andre Baptista Aguas <[email protected]>
@abaguas abaguas marked this pull request as draft August 25, 2024 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reverse proxy support?
1 participant