2022-03-01:k8s安装phpmyadmin,yaml如何写?
答案2022-03-01:
yaml如下:
代码语言:yaml复制apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: phpmyadmin
name: phpmyadmin
namespace: moonfdd
spec:
replicas: 1
selector:
matchLabels:
app: phpmyadmin
template:
metadata:
labels:
app: phpmyadmin
spec:
containers:
- env:
- name: PMA_HOST
value: mysql.fddtest
- name: PMA_PORT
value: '3306'
image: phpmyadmin/phpmyadmin
imagePullPolicy: IfNotPresent
name: phpmyadmin
---
apiVersion: v1
kind: Service
metadata:
labels:
app: phpmyadmin
name: phpmyadmin
namespace: moonfdd
spec:
ports:
- name: 80-80
port: 80
protocol: TCP
targetPort: 80
selector:
app: phpmyadmin
type: NodePort
结果如下: