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

feat: Allow for annotations on ingress instead using the Gatus kind #5

Open
aumer-amr opened this issue Feb 3, 2025 · 1 comment
Open
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@aumer-amr
Copy link
Owner

aumer-amr commented Feb 3, 2025

Example yaml config:

enabled: true
client:
  dns-resolver: tcp://1.1.1.1:53

would be in annotations:

gatus.io/enabled: "true"
gatus.io/client.dns-resolver: "tcp://1.1.1.1:53"

However how to deal with maps, for example:

conditions:
      - "[STATUS] == 200"
      - "[BODY].status == UP"
      - "[RESPONSE_TIME] < 300"

This can either turn into a json array, or maybe another solution is better, feedback is required. Note: the name+value of an annotation can only be 256kb (which should be more than enough)

@aumer-amr aumer-amr added enhancement New feature or request question Further information is requested labels Feb 3, 2025
@aumer-amr aumer-amr self-assigned this Feb 3, 2025
@mircea-pavel-anton
Copy link

mircea-pavel-anton commented Feb 3, 2025

Maybe something like this could work?

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: test-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
    gatus.io/enabled: "true"
    gatus.io/name: "test" # or deduced from the Ingress name
    gatus.io/group: "external" # or deduced from ingress class?
    gatus.io/client.dns-resolver: "tcp://1.1.1.1:53" #? could also have a default?
    gatus.io/interval: "1m" #? could be a default value
    gatus.io/conditions: |
      - "[STATUS] == 200"
      - "[BODY].status == UP"
      - "[RESPONSE_TIME] < 300"

spec:
  ingressClassName: nginx-example
  rules:
  - http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: test
            port:
              number: 80

Though I would use a different prefix and not gatus.io/ since this is "Not affiliated with gatus.io". Maybe aumer.gatus-operator/?

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

No branches or pull requests

2 participants