Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "apiVersion": "apps/v1",
- "kind": "Deployment",
- "metadata": {
- "name": "sample-db"
- },
- "spec": {
- "replicas": 1,
- "selector": {
- "matchLabels": {
- "app": "sample-db"
- }
- },
- "strategy": {},
- "template": {
- "metadata": {
- "labels": {
- "app": "sample-db"
- }
- },
- "spec": {
- "volumes": [
- {
- "name": "sample-db-storage",
- "persistentVolumeClaim": {
- "claimName": "sample-db-pvclaim"
- }
- }
- ],
- "containers": [
- {
- "image": "postgres",
- "name": "sample-db",
- "env": [
- {
- "name": "POSTGRES_USER",
- "valueFrom": {
- "configMapKeyRef": {
- "name": "sample-db-config",
- "key": "db_user"
- }
- }
- },
- {
- "name": "POSTGRES_PASSWORD",
- "valueFrom": {
- "configMapKeyRef": {
- "name": "sample-db-config",
- "key": "db_password"
- }
- }
- },
- {
- "name": "PGDATA",
- "value": "/var/lib/postgresql/data/pgdata"
- },
- {
- "name": "POSTGRES_DB",
- "value": "sample"
- }
- ],
- "ports": [
- {
- "containerPort": 5432,
- "name": "sample-db"
- }
- ],
- "volumeMounts": [
- {
- "name": "sample-db-storage",
- "mountPath": "/var/lib/postgresql/data"
- }
- ]
- }
- ]
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment