docs/docs/deployment/deployment-guides/kubernetes-helm.mdx
import Thumbnail from '@site/src/components/Thumbnail'; import LatestRelease from '@site/src/components/LatestRelease';
To help you easily install Hasura GraphQL Engine on Kubernetes, we're happy to provide a Helm Chart repository with GraphQL Engine and its ecosystem, including:
In this guide, you will get up and running quickly with the Hasura GraphQL Engine and a Postgres database on Kubernetes using Helm Chart.
Run this command to add Hasura Helm repository:
helm repo add hasura https://hasura.github.io/helm-charts
Run the following command to install both the Hasura GraphQL Engine and a Postgres database. We assume that the release
name is hasura and the admin secret is hasura:
helm install hasura --set secret.adminSecret=hasura hasura/graphql-engine
:::info Keep your admin secret strong and safe
Remember to set strong admin secrets before going live.
:::
After the GraphQL Engine Helm Chart was installed successfully, print Kubernetes pods with kubectl to verify.
NAME READY STATUS RESTARTS AGE
hasura-graphql-engine-6cc69694dd-r4dnh 1/1 Running 1 (75s ago) 2m58s
hasura-postgres-5fd95db548-f4vhg 1/1 Running 0 2m58s
By default, the Helm Chart doesn't enable ingress. You need to enable port-forwarding on the graphql-engine pod to
localhost.
kubectl port-forward hasura-graphql-engine-6cc69694dd-r4dnh 8080:8080
:::info Hasura ships with a Postgres database
Hasura relies on a Postgres database to store its metadata, and this database can also be used to store your application data.
If you'd like to connect another type of database for storing application data, check out our list of supported databases.
:::
Open the Hasura Console by navigating to http://localhost:8080/console.
On the Hasura Console, navigate to Data -> Create table and create a sample table called profiles with the following
columns:
profiles (
id SERIAL PRIMARY KEY, -- serial -> auto-incrementing integer
name TEXT
)
<Thumbnail src="/img/getting-started/create-profile-table.png" alt="Create a table" width="1200px" />
Now, insert some sample data into the table using the Insert Row tab of the profiles table.
Head to the API tab in the Console and try running the following query:
query {
profiles {
id
name
}
}
You'll see that you get all the inserted data!
<Thumbnail src="/img/getting-started/profile-query.png" alt="Try out a query" width="1200px" />
You can set the Enterprise License Key value when installing the Helm chart to enable Enterprise features.
helm install hasura --set secret.adminSecret=hasura --set secret.eeLicenseKey=<license-key> hasura/graphql-engine
You can see full configuration values at the Github repository and example values to get started.
If you intend to install the all-in-one deployment stack with Hasura Enterprise and its ecosystem you can try the hasura-enterprise-stack Helm Chart. The Helm Chart is a collection of sub-charts that includes:
Those sub-charts are disabled by default. You can enable desired charts only.
Run this command to add Hasura Helm repository:
helm repo add hasura https://hasura.github.io/helm-charts
By default, the Helm Chart will start with the basic GraphQL Engine chart above. In this guide, we will enable Hasura Enterprise with a Redis cache.
Create an extended values.yaml file locally with the following values:
global:
redis:
enabled: true
password: redispassword
graphql-engine:
secret:
adminSecret: 'hasura'
eeLicenseKey: '<set your license key here>'
Then install the Helm Chart with the file.
helm install hasura -f ./values.yaml hasura/hasura-enterprise-stack
After the Helm Chart was installed successfully, print Kubernetes pods with kubectl to verify.
NAME READY STATUS RESTARTS AGE
hasura-graphql-engine-65d75f997f-pkwj9 1/1 Running 0 11s
hasura-postgres-5fd95db548-6x844 1/1 Running 0 11s
hasura-redis-master-0 1/1 Running 0 11s
hasura-redis-replicas-0 1/1 Running 0 11s
You can see full configuration values at the Github repository and example values to get started.