I have an error trying to deploy the official phpmyadmin
image locally in Kubernetes cluster. Please look at my yaml
configs. I haven't any idea what I did wrong. I tried phpmyadmin/phpmyadmin
image but the 404 error stays. I also viewed configs from other people but it doesn't differ from mine. This is my first experience in Kubernetes so maybe I don't know some development approaches.
ingress-service.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-service
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/use-regex: "true"
spec:
rules:
- http:
paths:
- path: /phpmyadmin/?(.*)
pathType: Prefix
backend:
service:
name: phpmyadmin-cluster-ip-service
port:
number: 80
phpmyadmin-cluster-ip-service.yaml
apiVersion: v1
kind: Service
metadata:
name: phpmyadmin-cluster-ip-service
spec:
type: ClusterIP
selector:
app: phpmyadmin
ports:
- port: 80
targetPort: 80
protocol: TCP
phpmyadmin-deployment.yaml Ip 192.168.64.7 is given by minikube.
apiVersion: apps/v1
kind: Deployment
metadata:
name: phpmyadmin-deployment
labels:
tier: backend
spec:
replicas: 1
selector:
matchLabels:
app: phpmyadmin
tier: backend
template:
metadata:
labels:
app: phpmyadmin
tier: backend
spec:
restartPolicy: Always
containers:
- name: phpmyadmin
image: phpmyadmin:latest
ports:
- name: phpmyadmin
containerPort: 80
protocol: TCP
imagePullPolicy: Always
env:
- name: PMA_ABSOLUTE_URI
value: "http://192.168.64.7/phpmyadmin/"
- name: PMA_VERBOSE
value: "PhpMyAdmin"
- name: PMA_HOST
value: mysql-service
- name: PMA_PORT
value: "3306"
- name: UPLOAD_LIMIT
value: "268435456"
- name: PMA_ARBITRARY
value: "0"
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-secret
key: MYSQL_ROOT_PASSWORD
I omitted MySQL yaml
configs thinking it doesn't related to phpmyadmin
issue but if they can help I will pushlish it too.