kubernetes-helmkubernetes-dashboard

Helm for kubernetes-dashboard not creating ingress


I'm trying to get kubernetes-dashboard up and running under KIND but I'm not getting an ingress created even-though I think I changed the values.yaml to do that. Here is what I have for that section any idea what I'm missing/doing wrong:

ingress:
  ## If true, Kubernetes Dashboard Ingress will be created.
  ##
  enabled: true

  ## Kubernetes Dashboard Ingress labels
  labels:
    key: value

  ## Kubernetes Dashboard Ingress annotations
  annotations:
    kubernetes.io/ingress.class: nginx
    kubernetes.io/tls-acme: 'true'

  ## If you plan to use TLS backend with enableInsecureLogin set to false
  ## (default), you need to uncomment the below.
  ## If you use ingress-nginx < 0.21.0
#     nginx.ingress.kubernetes.io/secure-backends: "true"
  ## if you use ingress-nginx >= 0.21.0
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"

  ## Kubernetes Dashboard Ingress Class
#  className: "example-lb"

  ## Kubernetes Dashboard Ingress paths
  ## Both `/` and `/*` are required to work on gce ingress.
  paths:
    - /
    - /*

  ## Custom Kubernetes Dashboard Ingress paths. Will override default paths.
  ##
  customPaths:
    - pathType: ImplementationSpecific
      backend:
        service:
          name: ssl-redirect
          port:
            name: use-annotation
    - pathType: ImplementationSpecific
      backend:
        service:
          name: >-
            {{ include "kubernetes-dashboard.fullname" . }}
          port:
            # Don't use string here, use only integer value!
            number: 443

  # Kubernetes Dashboard Ingress hostnames
  # Must be provided if Ingress is enabled
  #
  hosts:
    - local.com
  # Kubernetes Dashboard Ingress TLS configuration
  # Secrets must be manually created in the namespace
  #
  tls:
    - secretName: kubernetes-dashboard-tls
      hosts:
        - local.com

This will run and if I run:

helm upgrade -f dashboard/values.yaml  dashboard dashboard
Release "dashboard" has been upgraded. Happy Helming!
NAME: dashboard
LAST DEPLOYED: Fri Dec 10 16:41:46 2021
NAMESPACE: kubernetes-dashboard
STATUS: deployed
REVISION: 7
TEST SUITE: None

$ kubectl get pods
NAME                                              READY   STATUS    RESTARTS   AGE
dashboard-kubernetes-dashboard-5d89cf78dd-g6tmb   1/1     Running   0          94m

But:

$ kubectl get ingress
No resources found in kubernetes-dashboard namespace.

Now stackoverflow won't post my question, because I posted mostly code. Maybe this will trick it.


Solution

  • I ended up creating my own ingress:

    ---
    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
      name: dashboard
      namespace: kubernetes-dashboard
      annotations:
        kubernetes.io/ingress.class: "nginx"
        ingress.kubernetes.io/add-base-url: "true"
        nginx.ingress.kubernetes.io/secure-backends: "true"
        nginx.ingress.kubernetes.io/ssl-passthrough: "true"
        nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
        nginx.ingress.kubernetes.io/rewrite-target: /$2
    spec:
      tls:
        - hosts:
          - {{ .Values.apps.nameSpace }}.{{ .Values.apps.domain }}
          secretName: my-tls-secret
      rules:
      - host: {{ .Values.apps.nameSpace }}.{{ .Values.apps.domain }}
        http:
          paths:
          - pathType: Prefix
            path: /dashboard(/|$)(.*)
            backend:
              service:
                name: dashboard-kubernetes-dashboard
                port:
                  number: 443