Skip to content

Commit

Permalink
Merge pull request #7 from shakahl/feature/helm-chart-hasura-graphql-…
Browse files Browse the repository at this point in the history
…engine

[hasura-graphql-engine] v0.0.2
  • Loading branch information
shakahl authored Dec 10, 2020
2 parents 88cc851 + 5f0045d commit cc5158b
Show file tree
Hide file tree
Showing 9 changed files with 246 additions and 164 deletions.
37 changes: 37 additions & 0 deletions .github/chart_schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: str()
home: str(required=False)
version: str()
apiVersion: str()
appVersion: any(str(), num(), required=False)
description: str()
keywords: list(str(), required=False)
sources: list(str(), required=False)
maintainers: list(include('maintainer'), required=False)
dependencies: list(include('dependency'), required=False)
icon: str(required=False)
engine: str(required=False)
condition: str(required=False)
tags: str(required=False)
deprecated: bool(required=False)
kubeVersion: str(required=False)
annotations: map(str(), str(), required=False)
type: str(required=False)
---
maintainer:
name: str()
email: str(required=False)
url: str(required=False)
---
dependency:
name: str()
version: str()
repository: str()
condition: str(required=False)
tags: list(str(), required=False)
enabled: bool(required=False)
import-values: any(list(str()), list(include('import-value')), required=False)
alias: str(required=False)
---
import-value:
child: str()
parent: str()
42 changes: 42 additions & 0 deletions .github/lintconf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
rules:
braces:
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
brackets:
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
colons:
max-spaces-before: 0
max-spaces-after: 1
commas:
max-spaces-before: 0
min-spaces-after: 1
max-spaces-after: 1
comments:
require-starting-space: true
min-spaces-from-content: 2
document-end: disable
document-start: disable # No --- to start a file
empty-lines:
max: 2
max-start: 0
max-end: 0
hyphens:
max-spaces-after: 1
indentation:
spaces: consistent
indent-sequences: whatever # - list indentation will handle both indentation and without
check-multi-line-strings: false
key-duplicates: enable
line-length: disable # Lines can be any length
new-line-at-end-of-file: enable
new-lines:
type: unix
trailing-spaces: enable
truthy:
level: warning
2 changes: 1 addition & 1 deletion charts/hasura-graphql-engine/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ engine: gotpl

type: application

version: 0.0.1
version: 0.0.2

appVersion: "v1.0.0"

Expand Down
4 changes: 2 additions & 2 deletions charts/hasura-graphql-engine/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this

{{- define "imagenameCliMigrationsV2" -}}
{{- if eq .Values.image.tag "" -}}
{{- .Values.image.repository -}}.cli-migrations-v2
{{- printf "%s.cli-migrations-v2" .Values.image.repository -}}
{{- else -}}
{{- printf "%s:%s" .Values.image.repository .Values.image.tag -}}.cli-migrations-v2
{{- printf "%s:%s.cli-migrations-v2" .Values.image.repository .Values.image.tag -}}
{{- end -}}
{{- end -}}

Expand Down
43 changes: 20 additions & 23 deletions charts/hasura-graphql-engine/templates/db-initialize-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,25 @@ spec:
restartPolicy: Never
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{ toYaml . | indent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: {{ template "imagename" . }}
command: ["/bin/sh"]
args: ["-c", {{ .Values.application.initializeCommand }}]
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.application.secretName }}
envFrom:
- secretRef:
name: {{ .Values.application.secretName | quote -}}
{{- end }}
{{ if .Values.hasura.env }}
env:
{{- toYaml .Values.hasura.env | nindent 8 }}
{{- end }}
{{- if .Values.hasura.serverOptions }}
{{ toYaml .Values.hasura.serverOptions | indent 8 }}
{{- end }}
{{ range $cfgKey, $cfgVal := .Values.hasura.config -}}
- name: {{ template "prefixenv" $cfgKey }}
value: {{ tpl (toString $cfgVal) $ | quote }}
{{ end }}
{{- end -}}
- name: {{ .Chart.Name }}
image: {{ template "imagenameCliMigrationsV2" . }}
command: ["/bin/sh"]
args: ["-c", {{ .Values.application.initializeCommand }}]
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.application.secretName }}
envFrom:
- secretRef:
name: {{ .Values.application.secretName | quote }}
{{- end }}
env:
{{- with .Values.env }}
{{ toYaml . | indent 12 }}
{{- end }}
{{- range $cfgKey, $cfgVal := .Values.config }}
- name: {{ template "prefixenv" $cfgKey }}
value: {{ tpl (toString $cfgVal) $ | quote }}
{{- end }}
{{- end }}
27 changes: 13 additions & 14 deletions charts/hasura-graphql-engine/templates/db-migrate-hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ spec:
release: {{ .Release.Name }}
spec:
restartPolicy: Never
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml .Values.imagePullSecrets | nindent 10 }}
{{ toYaml . | indent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: {{ template "imagenameCliMigrationsV2" . }}
Expand All @@ -31,18 +33,15 @@ spec:
{{- if .Values.application.secretName }}
envFrom:
- secretRef:
name: {{ .Values.application.secretName | quote -}}
name: {{ .Values.application.secretName | quote }}
{{- end }}
env:
{{- with .Values.env }}
{{ toYaml . | indent 12 }}
{{- end }}
{{- range $cfgKey, $cfgVal := .Values.config }}
- name: {{ template "prefixenv" $cfgKey }}
value: {{ tpl (toString $cfgVal) $ | quote }}
{{- end }}
{{- if .Values.hasura.env }}
env:
{{- toYaml .Values.hasura.env | nindent 10 }}
{{ end }}
{{- if .Values.hasura.serverOptions -}}
{{ toYaml .Values.hasura.serverOptions | indent 8 -}}
{{ end }}
{{ range $cfgKey, $cfgVal := .Values.hasura.config -}}
- name: {{ template "prefixenv" $cfgKey }}
value: {{ tpl (toString $cfgVal) $ | quote }}
{{ end }}

{{- end -}}
{{- end }}
43 changes: 24 additions & 19 deletions charts/hasura-graphql-engine/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,79 +22,84 @@ spec:
tier: "{{ .Values.application.tier }}"
release: {{ .Release.Name }}
{{- end }}
{{ if .Values.strategyType -}}
{{- if .Values.strategyType -}}
strategy:
type: {{ .Values.strategyType | quote }}
{{- end }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{ toYaml . | indent 8 }}
{{- end }}
labels:
{{- include "hasura-graphql-engine.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{ toYaml . | indent 8 }}
{{- end }}
serviceAccountName: {{ include "hasura-graphql-engine.serviceAccountName" . }}
{{- with .Values.podSecurityContext }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{ toYaml . | indent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{- with .Values.securityContext }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{ toYaml . | indent 12 }}
{{- end }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.application.secretName }}
envFrom:
- secretRef:
name: {{ .Values.application.secretName | quote -}}
{{ end }}
{{- if .Values.hasura.env }}
env:
{{- toYaml .Values.hasura.env | nindent 12 -}}
{{ end -}}
{{ if .Values.hasura.serverOptions -}}
{{- toYaml .Values.hasura.serverOptions | indent 12 }}
name: {{ .Values.application.secretName | quote }}
{{- end }}
env:
{{- with .Values.env }}
{{ toYaml . | indent 12 }}
{{- end }}
{{- range $cfgKey, $cfgVal := .Values.hasura.config }}
{{- range $cfgKey, $cfgVal := .Values.config }}
- name: {{ template "prefixenv" $cfgKey }}
value: {{ tpl (toString $cfgVal) $ | quote }}
{{- end }}
ports:
- name: http
containerPort: 8080
protocol: TCP
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: {{ .Values.livenessProbe.path | default "/healthz" }}
scheme: HTTP
port: http
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
{{- end }}
{{- if .Values.readinessProbe.enabled }}
readinessProbe:
httpGet:
path: {{ .Values.readinessProbe.path | default "/healthz" }}
scheme: HTTP
port: http
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
{{ if .Values.resources -}}
{{- end }}
{{- with .Values.resources }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{ toYaml . | indent 12 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{ toYaml . | indent 8 }}
{{- end }}
Loading

0 comments on commit cc5158b

Please sign in to comment.