kubernetes-yaml/examples/pgadmin4/pgadmin4.yaml

92 lines
2.1 KiB
YAML
Raw Normal View History

2023-12-15 16:39:01 +08:00
---
# 创建 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
2024-10-11 01:03:00 +08:00
app.k8s.hty1024.com/version: 8.12.0
2023-12-15 16:39:01 +08:00
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
2024-10-11 01:03:00 +08:00
app.k8s.hty1024.com/version: 8.12.0
2023-12-15 16:39:01 +08:00
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
2024-10-11 01:03:00 +08:00
app.k8s.hty1024.com/version: 8.12.0
2023-12-15 16:39:01 +08:00
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
2024-10-11 01:03:00 +08:00
app.k8s.hty1024.com/version: 8.12.0
2023-12-15 16:39:01 +08:00
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
2024-10-11 01:03:00 +08:00
app.k8s.hty1024.com/version: 8.12.0
2023-12-15 16:39:01 +08:00
app.k8s.hty1024.com/resources: pod
spec:
terminationGracePeriodSeconds: 60
volumes:
- name: localtime
hostPath:
path: /etc/localtime
containers:
- name: pgadmin4
2024-10-11 01:03:00 +08:00
image: dpage/pgadmin4:8.12.0
2023-12-15 16:39:01 +08:00
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