kubernetes-yaml/examples/pgadmin4/pgadmin4.yaml
2024-10-10 09:05:31 +00:00

92 lines
2.1 KiB
YAML

---
# 创建 Namespace
apiVersion: v1
kind: Namespace
metadata:
name: hty1024-db
---
# 创建 Service
apiVersion: v1
kind: Service
metadata:
name: hty1024-db-pgadmin4-service
namespace: hty1024-db
labels:
app.k8s.hty1024.com/env: prod
app.k8s.hty1024.com/type: db
app.k8s.hty1024.com/name: pgadmin4
app.k8s.hty1024.com/version: 8.12.0
app.k8s.hty1024.com/resources: service
spec:
type: NodePort
ports:
- name: pgadmin4
port: 80
targetPort: 80
nodePort: 30000
selector:
app.k8s.hty1024.com/env: prod
app.k8s.hty1024.com/type: db
app.k8s.hty1024.com/name: pgadmin4
app.k8s.hty1024.com/version: 8.12.0
app.k8s.hty1024.com/resources: pod
---
# 创建 Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: hty1024-db-pgadmin4
namespace: hty1024-db
labels:
app.k8s.hty1024.com/env: prod
app.k8s.hty1024.com/type: db
app.k8s.hty1024.com/name: pgadmin4
app.k8s.hty1024.com/version: 8.12.0
app.k8s.hty1024.com/resources: deployment
spec:
replicas: 1
minReadySeconds: 30
selector:
matchLabels:
app.k8s.hty1024.com/env: prod
app.k8s.hty1024.com/type: db
app.k8s.hty1024.com/name: pgadmin4
app.k8s.hty1024.com/version: 8.12.0
app.k8s.hty1024.com/resources: pod
template:
metadata:
labels:
app.k8s.hty1024.com/env: prod
app.k8s.hty1024.com/type: db
app.k8s.hty1024.com/name: pgadmin4
app.k8s.hty1024.com/version: 8.12.0
app.k8s.hty1024.com/resources: pod
spec:
terminationGracePeriodSeconds: 60
volumes:
- name: localtime
hostPath:
path: /etc/localtime
containers:
- name: pgadmin4
image: dpage/pgadmin4:8.12.0
ports:
- name: http
containerPort: 80
volumeMounts:
- name: localtime
mountPath: /etc/localtime
readOnly: true
env:
- name: PGADMIN_DEFAULT_EMAIL
value: "test@hty1024.com"
- name: PGADMIN_DEFAULT_PASSWORD
value: "123456"
nodeSelector:
node.k8s.hty1024.com/type: app