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

CRD Backend Support #146

Open
alex-bezek opened this issue Feb 14, 2023 · 1 comment
Open

CRD Backend Support #146

alex-bezek opened this issue Feb 14, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@alex-bezek
Copy link
Collaborator

Description

Currently, we create tunnel group backends for highly available tunnels to services within a k8s cluster. Ngrok also supports these other backends:

  • http response backend: static http response value
  • Failover backend: takes a list of other backends
  • weighted backends: takes a list of other backends

If we treat our tunnel groups as a Backend, and create crd's for these other backends that can reference each other and tunnel groups, we could use them with the ingress spec

Use Case

apiVersion: ingress.k8s.ngrok.com/v1alpha1
kind: HttpResponseBackend
metadata:
  name: http-response-backend-404
spec:
  body: "404 Not Found"
  status: 404
---
apiVersion: ingress.k8s.ngrok.com/v1alpha1
kind: FailoverBackend
metadata:
  name: failover-backend
spec:
  backends:
    - resource:
        apiGroup: ingress.k8s.ngrok.com/v1alpha1
        kind: HttpResponseBackend
        name: http-response-backend-404
    - service:
        name: test-service
        port:
          number: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-resource-backend
spec:
  defaultBackend:
    resource:
      apiGroup: ingress.k8s.ngrok.com/v1alpha1
      kind: HttpResponseBackend
      name: http-response-backend-404
  rules:
    - host: foo.bar.com
      http:
        paths:
          - path: /foo
            pathType: Prefix
            backend:
              service: # Makes a tunnel group backend for this service
                name: test-service
                port:
                  number: 80
              resource: # References other backend types
                apiGroup: ingress.k8s.ngrok.com/v1alpha1
                kind: FailoverBackend
                name: failover-backend

Related issues

No response

@alex-bezek alex-bezek added enhancement New feature or request needs-triage Issues that need triage labels Feb 14, 2023
@alex-bezek alex-bezek removed the needs-triage Issues that need triage label Mar 14, 2023
@alex-bezek
Copy link
Collaborator Author

This seems valid to create CRDs for different backends in the future. We may just support it for gateway or backport it to ingress when we go do this work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant