How to deploy phpadmin in Azure Kubernetes?

I have deployed MySQL using this YAML file.

apiVersion: v1
kind: Service
metadata:
  name: mysqlsb
  labels:
    app: dataenv
spec:
  ports:
    - port: 3306
  selector:
    app: dataenv
    tier: mysql
  clusterIP: None
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: mysql-pv-claim
  labels:
    app: dataenv
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 20Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: dataenv-mysql
  labels:
    app: dataenv
spec:
  selector:
    matchLabels:
      app: dataenv
      tier: mysql
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: dataenv
        tier: mysql
    spec:
      containers:
      - image: mysql:5.6
        name: mysql
        env:
        - name: MYSQL_ROOT_PASSWORD
          valueFrom:
            secretKeyRef:
              name: mysql-pass
              key: password
        ports:
        - containerPort: 3306
          name: mysql
        volumeMounts:
        - name: mysql-persistent-storage
          mountPath: /var/lib/mysql
      volumes:
      - name: mysql-persistent-storage
        persistentVolumeClaim:
          claimName: mysql-pv-claim

The instance is running and I can create tables via command line.

How do I deploy phpMyAdmin to manage this pod?


You can use port forwarding

kubectl port-forward service/<<svcname>> 3306:3306

based on your service name:

kubectl port-forward service/mysqlsb 3306:3306

Then you can access it from your desktop (via phpmyadmin or any other GUI) using servername as localhost and port 3306