postfinance / kubenurse

Kubernetes network monitoring
MIT License
416 stars 39 forks source link

add annotation and TLS secretName to ingress #141

Closed karnzx closed 3 months ago

karnzx commented 5 months ago

Add annotation and secretName to ingress template. Now ingress can used with Cert-manager. For example to generate HTTPS let'sencrypt certificate.

$ helm template kubenurse helm/kubenurse/ --show-only templates/ingress.yaml --set 'ingress.annotations.cert-manager\.io/cluster-issuer=letsencrypt-http01'
---
# Source: kubenurse/templates/ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  labels:
    helm.sh/chart: kubenurse-0.0.1-dummy
    app.kubernetes.io/name: kubenurse
    app.kubernetes.io/instance: kubenurse
    app.kubernetes.io/version: "v0.0.1-dummy"
    app.kubernetes.io/managed-by: Helm
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-http01
  name: kubenurse
  namespace: default
spec:
  ingressClassName: nginx
  rules:
  - host: dummy-kubenurse.example.com
    http:
      paths:
      - backend:
          service:
            name: kubenurse
            port:
              number: 8080
        path: /
        pathType: Prefix
  tls:
  - hosts:
    - dummy-kubenurse.example.com
    secretName: kubenurse-ingress-tls
clementnuss commented 4 months ago

hi !

I'm sorry this took this long, this PR went under the radar. It's looking good, except for the TLS secret name: can you make it configurable through the values.yaml file ? and ideally absent per default.

clementnuss commented 3 months ago

I made the tls secret name optional and configurable through the values.yaml with https://github.com/postfinance/kubenurse/commit/943bf66e6c7fa8f6bca2e9f9adbeea8a6a66c9ea