From 46fe9c605b4a10a2579d600f74f90df5d79e573b Mon Sep 17 00:00:00 2001 From: hasura-bot Date: Fri, 17 Dec 2021 14:07:10 +0530 Subject: [PATCH] docs: expose hasura on https on GCP using kubernetes (close #2956) GITHUB_PR_NUMBER: 5770 GITHUB_PR_URL: https://github.com/hasura/graphql-engine/pull/5770 PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3176 Co-authored-by: Vitalii Tverdokhlib <1549046+vitaliytv@users.noreply.github.com> GitOrigin-RevId: ece332f40261e6b7afec58b81364967935b7ad9c --- .../google-kubernetes-engine-cloud-sql.rst | 66 +++++++++++++++++-- 1 file changed, 62 insertions(+), 4 deletions(-) diff --git a/docs/graphql/core/deployment/deployment-guides/google-kubernetes-engine-cloud-sql.rst b/docs/graphql/core/deployment/deployment-guides/google-kubernetes-engine-cloud-sql.rst index 27208970a51..444521188cb 100644 --- a/docs/graphql/core/deployment/deployment-guides/google-kubernetes-engine-cloud-sql.rst +++ b/docs/graphql/core/deployment/deployment-guides/google-kubernetes-engine-cloud-sql.rst @@ -166,6 +166,9 @@ If there are any errors, check the logs of the GraphQL engine: Expose GraphQL engine --------------------- +HTTP +^^^^ + Now that we have Hasura running, let's expose it on an IP using a LoadBalancer. .. code-block:: bash @@ -174,9 +177,8 @@ Now that we have Hasura running, let's expose it on an IP using a LoadBalancer. --port 80 --target-port 8080 \ --type LoadBalancer - -Open Hasura console -------------------- +Open the Hasura console +*********************** Wait for the external IP to be allocated, check the status using the command below. It usually takes a couple of minutes. @@ -188,7 +190,63 @@ command below. It usually takes a couple of minutes. Once the IP is allocated, visit the IP in a browser and it should open the console. -.. _gc_kubernetes_logs: +HTTPS +^^^^^ + +Let's expose Hasura with `Ingress +`_. Create service: + +.. code-block:: yaml + + + apiVersion: v1 + kind: Service + metadata: + labels: + app: hasura + name: hasura + spec: + ports: + - protocol: TCP + port: 80 + targetPort: 8080 + selector: + app: hasura + type: NodePort + +Create Managed Certificate: + +.. code-block:: yaml + + apiVersion: networking.gke.io/v1beta1 + kind: ManagedCertificate + metadata: + name: hasura-cert + spec: + domains: + - example.com + + +Create Ingress: + +.. code-block:: yaml + + apiVersion: extensions/v1beta1 + kind: Ingress + metadata: + name: basic-ingress + annotations: + networking.gke.io/managed-certificates: "hasura-cert" + spec: + rules: + - host: example.com + http: + paths: + - backend: + serviceName: hasura + servicePort: 80 + + Logs ----