diff --git a/manifests/01-namespaces/pg.yaml b/manifests/01-namespaces/pg.yaml index 1d8d45d..3b26f03 100644 --- a/manifests/01-namespaces/pg.yaml +++ b/manifests/01-namespaces/pg.yaml @@ -28,4 +28,13 @@ metadata: app: postgres namespace: pg data: - postgres-dbname: mainbase \ No newline at end of file + postgres-dbname: mainbase +--- +apiVersion: v1 +kind: Secret +metadata: + name: pgadmin-secret + namespace: pg +type: Opaque +data: + pgadmin-default-password: YWRtb24= \ No newline at end of file diff --git a/manifests/02-deployments/deployment-pgadmin.yaml b/manifests/02-deployments/deployment-pgadmin.yaml new file mode 100644 index 0000000..b2a2337 --- /dev/null +++ b/manifests/02-deployments/deployment-pgadmin.yaml @@ -0,0 +1,32 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: pgadmin + namespace: pg +spec: + selector: + matchLabels: + app: pgadmin + replicas: 1 + template: + metadata: + labels: + app: pgadmin + spec: + containers: + - name: pgadmin4 + image: dpage/pgadmin4 + env: + - name: PGADMIN_DEFAULT_EMAIL + value: "un359@mail.ru" + - name: PGADMIN_DEFAULT_PASSWORD + valueFrom: + secretKeyRef: + name: pgadmin-secret + key: pgadmin-default-password + - name: PGADMIN_PORT + value: "80" + ports: + - containerPort: 80 + name: pgadminport \ No newline at end of file diff --git a/manifests/03-services/svc-pgadmin.yaml b/manifests/03-services/svc-pgadmin.yaml new file mode 100644 index 0000000..7e85ab4 --- /dev/null +++ b/manifests/03-services/svc-pgadmin.yaml @@ -0,0 +1,16 @@ + +--- +apiVersion: v1 +kind: Service +metadata: + name: pgadmin + labels: + app: pgadmin + namespace: pg +spec: + selector: + app: pgadmin + ports: + - port: 80 + name: pgadmin + targetport: 80 diff --git a/manifests/04-routes/httproute-pgadmin.yaml b/manifests/04-routes/httproute-pgadmin.yaml new file mode 100644 index 0000000..2f1e16b --- /dev/null +++ b/manifests/04-routes/httproute-pgadmin.yaml @@ -0,0 +1,20 @@ +--- +apiVersion: gateway.networking.k8s.io/v1beta1 +kind: HTTPRoute +metadata: + name: http-pgadmin + namespace: default +spec: + hostnames: + - pgadmin.guaranteedstruggle.host + parentRefs: + - name: my-gateway + namespace: default + rules: + - matches: + - path: + type: PathPrefix + value: / + backendRefs: + - name: pgadmin + port: 80