Skip to content

Commit 2bbc71d

Browse files
committed
Submit hasura chart
1 parent 360955d commit 2bbc71d

File tree

10 files changed

+307
-0
lines changed

10 files changed

+307
-0
lines changed

submitted/hasura-helm3/.helmignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj

submitted/hasura-helm3/Chart.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: v2
2+
name: hasura-helm3-chart
3+
description: A Helm chart for Hasura GraphQL Engine
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
version: 0.1.0
18+
19+
# This is the version number of the application being deployed. This version number should be
20+
# incremented each time you make changes to the application.
21+
appVersion: v1.0.0-beta.6

submitted/hasura-helm3/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Li Chong
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

submitted/hasura-helm3/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# hasura-helm3-chart
2+
This a simple helm v3 chart for [Hasura](https://hasura.io) v1.0.0-beta.6
3+
4+
## Prerequisites
5+
- Kubernetes cluster (1 node with Minikube or Docker is OK)
6+
- Helm ~v3.0.0.beta1
7+
- kubectl
8+
9+
## Installation
10+
1. This chart doesn't include dependencies: postgresql, please install postgresql chart at first
11+
2. Install hasura chart:
12+
13+
```bash
14+
helm install test-hasura ./hasura-helm3-chart \
15+
--set postgresDbUrl=HASURA_GRAPHQL_DATABASE_URL
16+
```
17+
18+
> Examples of HASURA_GRAPHQL_DATABASE_URL:
19+
>
20+
> ```bash
21+
> postgres://admin:password@postgresql-service-host:5432/my-db
22+
> postgres://admin:@postgresql-service-host:5432/my-db (if there is no password)
23+
> ```
24+
25+
26+
27+
3. After the pod deployed and ready, you can head to http://localhost and the hasura console should be loaded!
28+
29+
## Contributions
30+
Welcome any PR to improve this chart. Let's [Hasura](https://hasura.io)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Thank you for installing {{ .Chart.Name }}.
2+
3+
Your release is named {{ .Release.Name }}.
4+
5+
Before running the application, please confirm your database at the URL defined by variable [postgresDbUrl] when installation is running normally
6+
7+
To learn more about the release, try:
8+
9+
$ helm status {{ .Release.Name }}
10+
$ helm get {{ .Release.Name }}
11+
12+
To access the application, try to head to: http://localhost and the console should load!
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "hasura-helm3-chart.name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
8+
9+
{{/*
10+
Create a default fully qualified app name.
11+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12+
If release name contains chart name it will be used as a full name.
13+
*/}}
14+
{{- define "hasura-helm3-chart.fullname" -}}
15+
{{- if .Values.fullnameOverride -}}
16+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
17+
{{- else -}}
18+
{{- $name := default .Chart.Name .Values.nameOverride -}}
19+
{{- if contains $name .Release.Name -}}
20+
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
21+
{{- else -}}
22+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
23+
{{- end -}}
24+
{{- end -}}
25+
{{- end -}}
26+
27+
{{/*
28+
Create chart name and version as used by the chart label.
29+
*/}}
30+
{{- define "hasura-helm3-chart.chart" -}}
31+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
32+
{{- end -}}
33+
34+
{{/*
35+
Common labels
36+
*/}}
37+
{{- define "hasura-helm3-chart.labels" -}}
38+
app.kubernetes.io/name: {{ include "hasura-helm3-chart.name" . }}
39+
helm.sh/chart: {{ include "hasura-helm3-chart.chart" . }}
40+
app.kubernetes.io/instance: {{ .Release.Name }}
41+
{{- if .Chart.AppVersion }}
42+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
43+
{{- end }}
44+
app.kubernetes.io/managed-by: {{ .Release.Service }}
45+
{{- end -}}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
apiVersion: apps/v1beta2
2+
kind: Deployment
3+
metadata:
4+
name: {{ template "hasura-helm3-chart.fullname" . }}
5+
labels:
6+
{{ include "hasura-helm3-chart.labels" . | indent 4 }}
7+
spec:
8+
replicas: {{ .Values.replicaCount }}
9+
selector:
10+
matchLabels:
11+
app.kubernetes.io/name: {{ include "hasura-helm3-chart.name" . }}
12+
app.kubernetes.io/instance: {{ .Release.Name }}
13+
template:
14+
metadata:
15+
labels:
16+
app.kubernetes.io/name: {{ include "hasura-helm3-chart.name" . }}
17+
app.kubernetes.io/instance: {{ .Release.Name }}
18+
spec:
19+
containers:
20+
- name: {{ .Chart.Name }}
21+
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
22+
imagePullPolicy: {{ .Values.image.pullPolicy }}
23+
env:
24+
- name: HASURA_GRAPHQL_DATABASE_URL
25+
value: {{ .Values.postgresDbUrl }}
26+
- name: HASURA_GRAPHQL_ENABLE_CONSOLE
27+
value: "true"
28+
ports:
29+
- name: http
30+
containerPort: 8080
31+
protocol: TCP
32+
livenessProbe:
33+
httpGet:
34+
path: /
35+
port: http
36+
readinessProbe:
37+
httpGet:
38+
path: /
39+
port: http
40+
resources:
41+
{{ toYaml .Values.resources | indent 12 }}
42+
{{- with .Values.nodeSelector }}
43+
nodeSelector:
44+
{{ toYaml . | indent 8 }}
45+
{{- end }}
46+
{{- with .Values.affinity }}
47+
affinity:
48+
{{ toYaml . | indent 8 }}
49+
{{- end }}
50+
{{- with .Values.tolerations }}
51+
tolerations:
52+
{{ toYaml . | indent 8 }}
53+
{{- end }}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{{- if .Values.ingress.enabled -}}
2+
{{- $fullName := include "hasura-helm3-chart.fullname" . -}}
3+
{{- $svcPort := .Values.service.port -}}
4+
apiVersion: networking.k8s.io/v1beta1
5+
kind: Ingress
6+
metadata:
7+
name: {{ $fullName }}
8+
labels:
9+
{{ include "hasura-helm3-chart.labels" . | indent 4 }}
10+
{{- with .Values.ingress.annotations }}
11+
annotations:
12+
{{- toYaml . | nindent 4 }}
13+
{{- end }}
14+
spec:
15+
{{- if .Values.ingress.tls }}
16+
tls:
17+
{{- range .Values.ingress.tls }}
18+
- hosts:
19+
{{- range .hosts }}
20+
- {{ . | quote }}
21+
{{- end }}
22+
secretName: {{ .secretName }}
23+
{{- end }}
24+
{{- end }}
25+
rules:
26+
{{- range .Values.ingress.hosts }}
27+
- host: {{ .host | quote }}
28+
http:
29+
paths:
30+
{{- range .paths }}
31+
- path: {{ . }}
32+
backend:
33+
serviceName: {{ $fullName }}
34+
servicePort: {{ $svcPort }}
35+
{{- end }}
36+
{{- end }}
37+
{{- end }}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ template "hasura-helm3-chart.fullname" . }}
5+
labels:
6+
{{ include "hasura-helm3-chart.labels" . | indent 4 }}
7+
spec:
8+
type: {{ .Values.service.type }}
9+
ports:
10+
- port: {{ .Values.service.port }}
11+
targetPort: http
12+
protocol: TCP
13+
name: http
14+
selector:
15+
app.kubernetes.io/name: {{ include "hasura-helm3-chart.name" . }}
16+
app.kubernetes.io/instance: {{ .Release.Name }}

submitted/hasura-helm3/values.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Default values for hasura-helm3-chart.
2+
# This is a YAML-formatted file.
3+
# Declare variables to be passed into your templates.
4+
5+
replicaCount: 1
6+
7+
image:
8+
repository: hasura/graphql-engine
9+
pullPolicy: IfNotPresent
10+
11+
nameOverride: ""
12+
fullnameOverride: ""
13+
14+
service:
15+
type: LoadBalancer
16+
port: 80
17+
18+
ingress:
19+
enabled: false
20+
annotations: {}
21+
# kubernetes.io/ingress.class: nginx
22+
# kubernetes.io/tls-acme: "true"
23+
hosts:
24+
- host: chart-example.local
25+
paths: []
26+
27+
tls: []
28+
# - secretName: chart-example-tls
29+
# hosts:
30+
# - chart-example.local
31+
32+
resources: {}
33+
# We usually recommend not to specify default resources and to leave this as a conscious
34+
# choice for the user. This also increases chances charts run on environments with little
35+
# resources, such as Minikube. If you do want to specify resources, uncomment the following
36+
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
37+
# limits:
38+
# cpu: 100m
39+
# memory: 128Mi
40+
# requests:
41+
# cpu: 100m
42+
# memory: 128Mi
43+
44+
nodeSelector: {}
45+
46+
tolerations: []
47+
48+
affinity: {}
49+
50+
# Chart specific variables
51+
postgresDbUrl: postgres://username:password@hostname:port/dbname

0 commit comments

Comments
 (0)