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

[Bug] Ingress not created when only defaultBackend (instead of rules) is specified #1774

Closed
repository opened this issue Nov 26, 2024 · 3 comments · Fixed by #1791
Closed
Labels
bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@repository
Copy link

repository commented Nov 26, 2024

Describe the bug
An ingress is not created when only the defaultBackend property is specified, instead of rules.

Version
v5.15.1

To Reproduce
Deploy Grafana using this manifest

---
apiVersion: grafana.integreatly.org/v1beta1
kind: Grafana
metadata:
  name: grafana
  namespace: monitoring
  labels:
    dashboards: grafana
spec:
  config:
    log:
      mode: "console"
    auth:
      disable_login_form: "false"
    security:
      admin_user: admin
      admin_password: ${GRAFANA_ADMIN_PASSWORD}
  ingress:
    spec:
      ingressClassName: tailscale
      defaultBackend:
        service:
          name: grafana-service
          port:
            number: 3000
      tls:
        - hosts:
            - gf

Expected behavior
An ingress is created.

The ingress works correctly when created manually, or with the below manifest instead.

---
apiVersion: grafana.integreatly.org/v1beta1
kind: Grafana
metadata:
  name: grafana
  namespace: monitoring
  labels:
    dashboards: grafana
spec:
  config:
    log:
      mode: "console"
    auth:
      disable_login_form: "false"
    security:
      admin_user: admin
      admin_password: ${GRAFANA_ADMIN_PASSWORD}
  ingress:
    spec:
      ingressClassName: tailscale
      rules:
        - http:
            paths:
              - path: /
                pathType: Prefix
                backend:
                  service:
                    name: grafana-service
                    port:
                      number: 3000
      tls:
        - hosts:
            - gf

Suspect component/Location where the bug might be occurring
This check fails (silently) when there are no rules specified.

Runtime

  • OS: Talos
  • Grafana Operator Version v5.15.1
  • Environment: Kubernetes
  • Deployment type: Helm/FluxCD
@repository repository added bug Something isn't working needs triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 26, 2024
@repository
Copy link
Author

Side note: it is somewhat redundant if we have to specify the default backend/rule that matches the name and port of our Grafana deployment. Aside from the convenience of creating/destroying them together, why not create each separately at this point?

@theSuess
Copy link
Member

theSuess commented Dec 9, 2024

Thanks for reporting this. I'll get to implementing this before the next release (probably around early January).

@theSuess theSuess added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 9, 2024
@theSuess
Copy link
Member

Created #1791 to resolve this. This also uncovered some default rules we would apply but currently don't as the ingress reconciler will merge the (now no longer) required rules, replacing any defaults we specified.

Ideally, this should be all you need now:

---
apiVersion: grafana.integreatly.org/v1beta1
kind: Grafana
metadata:
  labels:
    instance: my-ingress-stack
  name: my-ingress-stack
spec:
  ingress:
    spec:
      ingressClassName: nginx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants