| @ -1,8 +0,0 @@ | |||||
| # pgadmin | |||||
| kubectl create -f pv-local-pgadmin.yaml | |||||
| kubectl create -f pvc-pgadmin.yaml | |||||
| kubectl create -f pgadmin-secret.yaml | |||||
| kubectl create -f pgadmin-service.yaml | |||||
| kubectl create -f pgadmin-deployment.yaml | |||||
| kubectl create -f pgadmin-configmap.yaml | |||||
| watch kubectl get all -n postgres | |||||
| @ -1 +0,0 @@ | |||||
| kubectl exec -ti deployment.apps/postgres -n postgres -- /bin/bash | |||||
| @ -1,6 +0,0 @@ | |||||
| kubectl delete -f pgadmin-configmap.yaml | |||||
| kubectl delete -f pgadmin-secret.yaml | |||||
| kubectl delete -f pgadmin-service.yaml | |||||
| kubectl delete -f pgadmin-deployment.yaml | |||||
| kubectl delete -f pvc-pgadmin.yaml | |||||
| kubectl delete -f pv-local-pgadmin.yaml | |||||
| @ -1,23 +0,0 @@ | |||||
| apiVersion: v1 | |||||
| kind: ConfigMap | |||||
| metadata: | |||||
| name: pgadmin-config | |||||
| namespace: postgres | |||||
| data: | |||||
| servers.json: | | |||||
| { | |||||
| "Servers": { | |||||
| "1": { | |||||
| "Name": "PostgreSQL DB", | |||||
| "Group": "Servers", | |||||
| "Port": 5432, | |||||
| "Username": "postgres", | |||||
| "Host": "postgres", | |||||
| "SSLMode": "prefer", | |||||
| "MaintenanceDB": "postgres" | |||||
| } | |||||
| } | |||||
| } | |||||
| config_local.py: | | |||||
| SECURITY_EMAIL_VALIDATOR_ARGS={"check_deliverability": False} | |||||
| @ -1,52 +0,0 @@ | |||||
| apiVersion: apps/v1 | |||||
| kind: Deployment | |||||
| metadata: | |||||
| name: pgadmin | |||||
| namespace: postgres | |||||
| spec: | |||||
| replicas: 1 | |||||
| selector: | |||||
| matchLabels: | |||||
| app: pgadmin | |||||
| template: | |||||
| metadata: | |||||
| labels: | |||||
| app: pgadmin | |||||
| spec: | |||||
| initContainers: | |||||
| - name: pgadmin-init | |||||
| image: alpine | |||||
| args: [ "sh", "-c", "chown 5050:5050 /var/lib/pgadmin " ] | |||||
| volumeMounts: | |||||
| - name: pgadmin-data | |||||
| mountPath: /var/lib/pgadmin | |||||
| containers: | |||||
| - name: pgadmin | |||||
| image: ubuntu | |||||
| imagePullPolicy: Always | |||||
| env: | |||||
| - name: PGADMIN_DEFAULT_EMAIL | |||||
| value: creylopez@yahoo.es | |||||
| - name: PGADMIN_DEFAULT_PASSWORD | |||||
| valueFrom: | |||||
| secretKeyRef: | |||||
| name: pgadmin | |||||
| key: pgadmin-password | |||||
| volumeMounts: | |||||
| - name: pgadmin-config | |||||
| mountPath: /pgadmin4/servers.json | |||||
| subPath: servers.json | |||||
| readOnly: true | |||||
| - name: pgadmin-config | |||||
| mountPath: /pgadmin4/config_local.py | |||||
| subPath: config_local.py | |||||
| readOnly: true | |||||
| - name: pgadmin-data | |||||
| mountPath: /var/lib/pgadmin | |||||
| volumes: | |||||
| - name: pgadmin-config | |||||
| configMap: | |||||
| name: pgadmin-config | |||||
| - name: pgadmin-data | |||||
| persistentVolumeClaim: | |||||
| claimName: pgadmin-pv-claim | |||||
| @ -1,8 +0,0 @@ | |||||
| apiVersion: v1 | |||||
| kind: Secret | |||||
| type: Opaque | |||||
| metadata: | |||||
| name: pgadmin | |||||
| namespace: postgres | |||||
| data: | |||||
| pgadmin-password: UmV5MTE3Ngo= | |||||
| @ -1,14 +0,0 @@ | |||||
| apiVersion: v1 | |||||
| kind: Service # Create service | |||||
| metadata: | |||||
| name: pgadmin # Sets the service name | |||||
| namespace: postgres | |||||
| labels: | |||||
| app: pgadmin # Defines app to create service for | |||||
| spec: | |||||
| type: NodePort # Sets the service type | |||||
| ports: | |||||
| - port: 80 # Sets the port to run the postgres application | |||||
| nodePort: 30200 | |||||
| selector: | |||||
| app: pgadmin | |||||
| @ -1,55 +0,0 @@ | |||||
| apiVersion: apps/v1 | |||||
| kind: StatefulSet | |||||
| metadata: | |||||
| name: pgadmin | |||||
| namespace: postgres | |||||
| spec: | |||||
| serviceName: pgadmin-service | |||||
| podManagementPolicy: Parallel | |||||
| replicas: 1 | |||||
| updateStrategy: | |||||
| type: RollingUpdate | |||||
| selector: | |||||
| matchLabels: | |||||
| app: pgadmin | |||||
| template: | |||||
| metadata: | |||||
| labels: | |||||
| app: pgadmin | |||||
| spec: | |||||
| terminationGracePeriodSeconds: 10 | |||||
| containers: | |||||
| - name: pgadmin | |||||
| image: dpage/pgadmin4:5.4 | |||||
| imagePullPolicy: Always | |||||
| env: | |||||
| - name: PGADMIN_DEFAULT_EMAIL | |||||
| value: celestino.rey@gmail.com | |||||
| - name: PGADMIN_DEFAULT_PASSWORD | |||||
| valueFrom: | |||||
| secretKeyRef: | |||||
| name: pgadmin | |||||
| key: pgadmin-password | |||||
| ports: | |||||
| - name: http | |||||
| containerPort: 80 | |||||
| protocol: TCP | |||||
| volumeMounts: | |||||
| - name: pgadmin-config | |||||
| mountPath: /pgadmin4/servers.json | |||||
| subPath: servers.json | |||||
| readOnly: true | |||||
| - name: pgadmin-data | |||||
| mountPath: /var/lib/pgadmin | |||||
| volumes: | |||||
| - name: pgadmin-config | |||||
| configMap: | |||||
| name: pgadmin-config | |||||
| volumeClaimTemplates: | |||||
| - metadata: | |||||
| name: pgadmin-data | |||||
| spec: | |||||
| accessModes: [ "ReadWriteOnce" ] | |||||
| resources: | |||||
| requests: | |||||
| storage: 3Gi | |||||
| @ -1,11 +0,0 @@ | |||||
| apiVersion: v1 | |||||
| kind: PersistentVolume | |||||
| metadata: | |||||
| name: pgadmin-config | |||||
| spec: | |||||
| capacity: | |||||
| storage: 1Gi | |||||
| accessModes: | |||||
| - ReadWriteOnce | |||||
| hostPath: | |||||
| path: "/mnt/cluster/postgres/pgadmin-config" | |||||
| @ -1,11 +0,0 @@ | |||||
| apiVersion: v1 | |||||
| kind: PersistentVolume | |||||
| metadata: | |||||
| name: pgadmin-data | |||||
| spec: | |||||
| capacity: | |||||
| storage: 3Gi | |||||
| accessModes: | |||||
| - ReadWriteOnce | |||||
| hostPath: | |||||
| path: "/mnt/cluster/postgres/pgadmin" | |||||
| @ -1,14 +0,0 @@ | |||||
| apiVersion: v1 | |||||
| kind: PersistentVolumeClaim | |||||
| metadata: | |||||
| name: pgadmin-config-pv-claim | |||||
| namespace: postgres | |||||
| labels: | |||||
| app: postgres | |||||
| spec: | |||||
| accessModes: | |||||
| - ReadWriteOnce | |||||
| storageClassName: "" | |||||
| resources: | |||||
| requests: | |||||
| storage: 1Gi | |||||
| @ -1,14 +0,0 @@ | |||||
| apiVersion: v1 | |||||
| kind: PersistentVolumeClaim | |||||
| metadata: | |||||
| name: pgadmin-pv-claim | |||||
| namespace: postgres | |||||
| labels: | |||||
| app: postgres | |||||
| spec: | |||||
| accessModes: | |||||
| - ReadWriteOnce | |||||
| storageClassName: "" | |||||
| resources: | |||||
| requests: | |||||
| storage: 3Gi | |||||