2022-08-15:k8s安装pgadmin,yaml如何写?
答案2022-08-15:
yaml如下:
代码语言:yaml复制# 依赖postgres.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: pgadmin
name: pgadmin
namespace: moonfdd
spec:
replicas: 1
selector:
matchLabels:
app: pgadmin
template:
metadata:
labels:
app: pgadmin
spec:
containers:
- env:
- name: PGADMIN_DEFAULT_EMAIL
value: "user@domain.com"
- name: PGADMIN_DEFAULT_PASSWORD
value: "moonfdd"
image: "dpage/pgadmin4"
imagePullPolicy: IfNotPresent
name: pgadmin
---
apiVersion: v1
kind: Service
metadata:
labels:
app: pgadmin
name: pgadmin
namespace: moonfdd
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
app: pgadmin
type: NodePort
结果如下: