From 4ed90a440352e48ff812362e9ac63f9c9178f48e Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Sat, 22 Oct 2022 04:09:55 +0200 Subject: [PATCH] minimal hasura gql server + postgres k8s config Test with: podman kube play deployment.yaml --- deployment.yaml | 68 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 deployment.yaml diff --git a/deployment.yaml b/deployment.yaml new file mode 100644 index 0000000..bbd7987 --- /dev/null +++ b/deployment.yaml @@ -0,0 +1,68 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: hasura + hasuraService: custom + name: hasura + namespace: default +spec: + replicas: 1 + selector: + matchLabels: + app: hasura + template: + metadata: + creationTimestamp: null + labels: + app: hasura + spec: + containers: + - image: hasura/graphql-engine:v2.13.0 + imagePullPolicy: IfNotPresent + name: graphql + env: + - name: HASURA_GRAPHQL_DATABASE_URL + value: postgres://admin:admin@localhost:5432/hasura + ## enable the console served by server + - name: HASURA_GRAPHQL_ENABLE_CONSOLE + value: "true" + ## enable debugging mode. It is recommended to disable this in production + - name: HASURA_GRAPHQL_DEV_MODE + value: "true" + ports: + - containerPort: 8080 + protocol: TCP + resources: {} + - args: + - postgres + env: + - name: POSTGRES_USER + value: admin + - name: POSTGRES_PASSWORD + value: admin + - name: POSTGRES_DB + value: hasura + image: docker.io/library/postgres:14 + name: db + ports: + - containerPort: 5432 + hostPort: 5432 + resources: {} + securityContext: + capabilities: + drop: + - CAP_MKNOD + - CAP_NET_RAW + - CAP_AUDIT_WRITE + volumeMounts: + - mountPath: /var/lib/postgresql/data + name: 287b935fc2bc82f82816c5ef9158c75fd769170f1d3395eac79be2e827c3fa4a-pvc + enableServiceLinks: false + hostname: pg + restartPolicy: Never + volumes: + - name: 287b935fc2bc82f82816c5ef9158c75fd769170f1d3395eac79be2e827c3fa4a-pvc + persistentVolumeClaim: + claimName: 287b935fc2bc82f82816c5ef9158c75fd769170f1d3395eac79be2e827c3fa4a +status: {}