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

[bitnami/phpmyadmin] not working with traefik ingress controller #2627

Closed
Ankitchandre opened this issue May 20, 2020 · 9 comments
Closed

[bitnami/phpmyadmin] not working with traefik ingress controller #2627

Ankitchandre opened this issue May 20, 2020 · 9 comments

Comments

@Ankitchandre
Copy link
Contributor

Which chart:
[bitnami/phpmyadmin] 5.0.5

Describe the bug
I'm trying to install phpyadmin with traefik as ingress controller. It deploys without problems but when I try to open the ingress url phpmyadmin only shows a blank page. When opening dev-tools in chrome I saw that the element has a display: none style. After removing this I see an error message that a missassignment between HTTP and HTTPS. When I try to log in it errors with Failed to set session cookie. Maybe you are using HTTP instead of HTTPS to access phpMyAdmin.

What you expected to happen:
Actually see the phpmyadmin login when opening the ingress URL.

How to reproduce it (as minimally and precisely as possible):

Install traefik as an ingress controller
run helm install --name phpmyadmin stable/phpmyadmin --set ingress.enabled=true,ingress.host=phpmyadmin.example.com

Version of Helm and Kubernetes:

Client: &version.Version{SemVer:"v2.16.5", GitCommit:"89bd14c1541fa93a09492010030fd3699ca65a97", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.16.5", GitCommit:"89bd14c1541fa93a09492010030fd3699ca65a97", GitTreeState:"clean"}

  • Output of kubectl version:

Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:20:10Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.6-beta.0", GitCommit:"e7f962ba86f4ce7033828210ca3556393c377bcc", GitTreeState:"clean", BuildDate:"2020-01-15T08:18:29Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}

@Ankitchandre
Copy link
Contributor Author

same issue exists in helm/chart git repo #9914 and #22458

@dani8art
Copy link
Contributor

Hi @Ankitchandre , here I could see two possible mistakes and one suggestion:

  --set ingress.enabled=true,ingress.hosts[0].name=phpmyadmin.example.com
  • There could be sth wrong with liveness probe, you should try to configure it better
## PhpMyAdmin containers' liveness and readiness probes. Evaluated as a template.
## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
##
livenessProbe:
  initialDelaySeconds: 30
  timeoutSeconds: 30
  periodSeconds: 10
  successThreshold: 1
  failureThreshold: 6
  httpGet:
    path: /
    port: http
readinessProbe:
  initialDelaySeconds: 30
  timeoutSeconds: 30
  periodSeconds: 10
  successThreshold: 1
  failureThreshold: 6
  httpGet:
    path: /
    port: http

Finally, you could try this. It works for me.

$ helm install phpmyadmin bitnami/phpmyadmin \
  --set ingress.enabled=true,ingress.hosts[0].name=phpmyadmin.example.com

@Ankitchandre
Copy link
Contributor Author

Thanks dani for the help. I tried that on my local and it worked , but with the follwoing values file and with chart phpmyadmin version 5.0.5 , i still get the same error .
values.yaml >>

phpmyadmin:
image:
registry: docker.io
repository: bitnami/phpmyadmin
tag: 5.0.2-debian-10-r58
pullPolicy: IfNotPresent

service:
type: ClusterIP
port: 80

db:
port: 3306

ingress:
enabled: true
rewriteTarget: false
annotations:
kubernetes.io/ingress.class: traefik
traefik.ingress.kubernetes.io/rewrite-target: /
hosts:
- name: phpmyadmin.cluster.local
path: /

@Ankitchandre
Copy link
Contributor Author

Also , deployment goes without any error and all liveness readiness passed.

@dani8art
Copy link
Contributor

dani8art commented May 25, 2020

Hi @Ankitchandre ,

I'm using the this version too:

NAME                    CHART VERSION   APP VERSION     DESCRIPTION                                   
bitnami/phpmyadmin      5.0.5           5.0.2           phpMyAdmin is an mysql administration frontend

Also, if you want to access using phpmyadmin.example.com you should use:

ingress:
  ## Set this to true to enable ingress record generation
  ##
  enabled: true

  ## Set this to true in order to add the corresponding annotations for cert-manager
  ##
  certManager: false

  ## Set this to true in order to add the corresponding annotations to redirect traffic to /
  ##
  rewriteTarget: true

  ## Additional Ingress annotations done as key:value pairs
  ## Example:
  annotations:
    kubernetes.io/ingress.class: traefik
    traefik.ingress.kubernetes.io/rewrite-target: /
  ##
  # annotations

  ## The list of hostnames to be covered with this ingress record.
  ## Most likely this will be just one host, but in the event more hosts are needed, this is an array
  ##
  hosts:
    - name: phpmyadmin.example.com
      path: /

      ## Set this to true in order to enable TLS on the ingress record
      tls: false

      ## Optionally specify the TLS hosts for the ingress record
      ## Useful when the Ingress controller supports www-redirection
      ## If not specified, the above host name will be used
      # tlsHosts:
      # - www.phpmyadmin.local
      # - phpmyadmin.local

      ## If TLS is set to true, you must declare what secret will store the key/certificate for TLS
      tlsSecret: phpmyadmin.local-tls

@Ankitchandre
Copy link
Contributor Author

Hi @dani8art

In above yaml , you have provided ingress as "enabled: false" and yet passing annotations for traefik ??
How does it work ? I tried both and stuck with the same result.
PS: We use traefik as ingress controller

@dani8art
Copy link
Contributor

you have provided ingress as "enabled: false"

Sorry, I wanted to say that you were passing - name: phpmyadmin.cluster.local and I forgot to put it enabled=true.

  • What traefik.ingress.kubernetes.io/rewrite-target: / means exactly?
  • Could it be some misconfigurations in traefik?
  • What do you actually want HTTP or HTTPS?

@Ankitchandre
Copy link
Contributor Author

@dani8art i found "traefik.ingress.kubernetes.io/rewrite-target: /" in one of the documentation . I removed it and tried as well , results were same . Traefik is configured correctly for both http and https, coz i am running a dev env on cluster, and everything works fine.
Thing to note >
see line number 17 of "https://github.com/bitnami/charts/blob/master/bitnami/phpmyadmin/templates/ingress.yaml"
nginx is hardcoded as controller. Does the chart even picks up when we mention traefik as controller in values.yaml ?

@Ankitchandre
Copy link
Contributor Author

i found the problem it was rewriteTarget: true , we need to set it to false and use traefik in annotations . it worked now .

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

No branches or pull requests

2 participants