Deploy phpmyadmin to kubernetes issue

Viewed 782

I have the following configuration to deploy phpmyadmin to kubernetes.I have two problems with this:

  1. When the pod goes up it doesn't start the apache, I have to run service apache2 start
  2. when I enter phpmyadmin I find that it has not taken the environment variable PMA_HOST that is pointing to the IP where the database is up and running
apiVersion: apps/v1
kind: Deployment
metadata:
  name: phpmyadmin
  labels:
    app: phpmyadmin
spec:
  replicas: 1
  selector:
    matchLabels:
      app: phpmyadmin
  template:
    metadata:
      labels:
        app: phpmyadmin
    spec:
      containers:
        - name: phpmyadmin
          image: phpmyadmin/phpmyadmin:5
          ports:
            - containerPort: 80
              protocol: TCP
          env:
            - name: PMA_HOST
              value: MY_DATABASE_IP

kubernetes deploy

I did a test with a Docker pointing to the same database and it works fine

docker run --name myadmin -d -e PMA_HOST=MY_DATABASE_IP -p 8080:80 phpmyadmin/phpmyadmin:5

docker run

0 Answers
Related