-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable Data API and Hasura in CKAN charts (#13)
* Enable hasura in k8s * Add hasura envars * Add data-api svc/secret/deployment
- Loading branch information
1 parent
6c240a3
commit 8ec6181
Showing
7 changed files
with
168 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{{ if .Values.dataAPI.enable }} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ .Values.general.projectId }}-data-api | ||
labels: | ||
app: data-api | ||
spec: | ||
{{ if not .Values.dataAPI.hpa.enable }} | ||
replicas: {{ .Values.dataAPI.replicaCount | default 1 }} | ||
{{ end }} | ||
selector: | ||
matchLabels: | ||
app: data-api | ||
template: | ||
metadata: | ||
labels: | ||
app: data-api | ||
spec: | ||
{{ if .Values.general.imagePullSecrets }} | ||
imagePullSecrets: | ||
- name: {{ .Values.general.imagePullSecrets }} | ||
{{ end }} | ||
containers: | ||
- name: data-api | ||
{{ if .Values.dataAPI.image.digest }} | ||
image: {{ .Values.dataAPI.image.repository | default "datopian/data-api" }}@{{ .Values.dataAPI.image.digest }} | ||
{{ else }} | ||
image: {{ .Values.dataAPI.image.repository | default "datopian/data-api" }}:{{ .Values.dataAPI.image.tag }} | ||
{{ end }} | ||
imagePullPolicy: {{ .Values.dataAPI.image.pullPolicy | default "Always" }} | ||
{{ if .Values.dataAPI.env }} | ||
envFrom: | ||
- secretRef: | ||
name: {{ .Values.general.projectId }}-data-api-envvars | ||
{{ end }} | ||
{{ if .Values.dataAPI.livenessProbe }} | ||
livenessProbe: | ||
{{ with .Values.dataAPI.livenessProbe }} | ||
{{ toYaml . | nindent 12 }} | ||
{{ end }} | ||
{{ end }} | ||
resources: | ||
{{ if .Values.dataAPI.resources }} | ||
{{ with .Values.dataAPI.resources }} | ||
{{ toYaml . | nindent 12 }} | ||
{{ end }} | ||
{{ else }} | ||
limits: | ||
cpu: 600m | ||
memory: 1G | ||
requests: | ||
cpu: 100m | ||
memory: 0.8G | ||
{{ end }} | ||
ports: | ||
- containerPort: 3000 | ||
protocol: TCP | ||
|
||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{{ if .Values.dataAPI.enable }} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ .Values.general.projectId }}-data-api-svc | ||
spec: | ||
type: {{ .Values.dataAPI.serviceType | default "ClusterIP" }} | ||
ports: | ||
- port: {{ .Values.dataAPI.port | default 80 }} | ||
targetPort: {{ .Values.dataAPI.targetPort | default 3000 }} | ||
protocol: TCP | ||
name: http | ||
selector: | ||
app: data-api | ||
{{ end }} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{{ if .Values.hasura.enable }} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ .Values.general.projectId }}-hasura | ||
labels: | ||
app: hasura | ||
spec: | ||
{{ if not .Values.hasura.hpa.enable }} | ||
replicas: {{ .Values.hasura.replicaCount | default 1 }} | ||
{{ end }} | ||
selector: | ||
matchLabels: | ||
app: hasura | ||
template: | ||
metadata: | ||
labels: | ||
app: hasura | ||
spec: | ||
{{ if .Values.general.imagePullSecrets }} | ||
imagePullSecrets: | ||
- name: {{ .Values.general.imagePullSecrets }} | ||
{{ end }} | ||
containers: | ||
- name: hasura | ||
{{ if .Values.hasura.image.digest }} | ||
image: {{ .Values.hasura.image.repository | default "hasura/graphql-engine" }}@{{ .Values.hasura.image.digest }} | ||
{{ else }} | ||
image: {{ .Values.hasura.image.repository | default "hasura/graphql-engine" }}:{{ .Values.hasura.image.tag }} | ||
{{ end }} | ||
{{ if .Values.hasura.env }} | ||
envFrom: | ||
- secretRef: | ||
name: {{ .Values.general.projectId }}-hasura-envvars | ||
{{ end }} | ||
resources: | ||
{{ if .Values.hasura.resources }} | ||
{{ with .Values.hasura.resources }} | ||
{{ toYaml . | nindent 12 }} | ||
{{ end }} | ||
{{ else }} | ||
limits: | ||
cpu: 600m | ||
memory: 1G | ||
requests: | ||
cpu: 100m | ||
memory: 0.8G | ||
{{ end }} | ||
ports: | ||
- containerPort: 8080 | ||
protocol: TCP | ||
|
||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{{ if .Values.hasura.enable }} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ .Values.general.projectId }}-hasura-svc | ||
spec: | ||
type: {{ .Values.hasura.serviceType | default "ClusterIP" }} | ||
ports: | ||
- port: {{ .Values.hasura.port | default 80 }} | ||
targetPort: {{ .Values.hasura.targetPort | default 8080 }} | ||
protocol: TCP | ||
name: http | ||
selector: | ||
app: hasura | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{- if .Values.dataAPI.enable -}} | ||
apiVersion: v1 | ||
kind: Secret | ||
type: Opaque | ||
metadata: | ||
name: {{ .Values.general.projectId }}-data-api-envvars | ||
{{- with .Values.dataAPI.env }} | ||
stringData: | ||
{{- toYaml . | nindent 2 }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{- if .Values.hasura.enable -}} | ||
apiVersion: v1 | ||
kind: Secret | ||
type: Opaque | ||
metadata: | ||
name: {{ .Values.general.projectId }}-hasura-envvars | ||
{{- with .Values.hasura.env }} | ||
stringData: | ||
{{- toYaml . | nindent 2 }} | ||
{{- end }} | ||
{{- end }} |