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

fix(helm): allow custom TLS settings for UI ingress #417

Merged
merged 1 commit into from
Mar 9, 2024

Conversation

erikgb
Copy link

@erikgb erikgb commented Mar 9, 2024

Our target clusters are OpenShift, and to get the cluster default edge-terminated ingress TLS, we need to be able to set some strange/special Ingress TLS settings. This was possible with the 2.x version of the chart, but not anymore. I think this fix will retain the previous behavior (non-breaking) and is also less complex IMO.

Our values look like this in this area:

ui:
  enabled: true
  ingress:
    enabled: true
    hosts:
      - host: policy-reporter.apps.${CLUSTER_DOMAIN}
        paths:
          - path: /
            pathType: Prefix
    tls:
      - {}

Without this fix, this ends up becoming invalid:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  labels:
    app.kubernetes.io/instance: policy-reporter-preview
    app.kubernetes.io/name: policy-reporter-ui
    app.kubernetes.io/version: 3.0.0-alpha
  name: policy-reporter-ui
spec:
  rules:
  - host: policy-reporter.apps.${CLUSTER_DOMAIN}
    http:
      paths:
      - backend:
          service:
            name: policy-reporter-ui
            port:
              number: 8080
        path: /
        pathType: Prefix
  tls:
  - hosts: null
    secretName: null

And it should look like this:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  labels:
    app.kubernetes.io/component: ui
    app.kubernetes.io/instance: policy-reporter
    app.kubernetes.io/name: ui
    app.kubernetes.io/part-of: policy-reporter
    app.kubernetes.io/version: 1.9.2
  name: policy-reporter-ui
  namespace: kyverno
spec:
  rules:
  - host: policy-reporter.apps.${CLUSTER_DOMAIN}
    http:
      paths:
      - backend:
          service:
            name: policy-reporter-ui
            port:
              number: 8080
        path: /
        pathType: Prefix
  tls:
  - {}

@fjogeleit fjogeleit merged commit 2a361ba into kyverno:3.x Mar 9, 2024
1 check passed
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.

None yet

2 participants