Last active
April 4, 2019 22:07
-
-
Save elnygren/5ea8814a35559e3838fa32564458455e to your computer and use it in GitHub Desktop.
Hasura Kubernetes setup with version-controlled changes and CI/CD
This file contains hidden or 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
#!/bin/bash | |
kubectl delete -n staging configmap hasura-configmap | |
kubectl create -n staging configmap hasura-configmap --from-file=metadata.json |
This file contains hidden or 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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
labels: | |
app: hasura | |
name: hasura | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: hasura | |
template: | |
metadata: | |
labels: | |
app: hasura | |
spec: | |
containers: | |
- image: hasura/graphql-engine:v1.0.0-alpha41.cli-migrations | |
imagePullPolicy: IfNotPresent | |
name: hasura | |
env: | |
- name: HASURA_GRAPHQL_DATABASE_URL | |
value: postgres://username:password@hostname:port/dbname | |
- name: HASURA_GRAPHQL_ENABLE_CONSOLE | |
value: "true" | |
ports: | |
- containerPort: 8080 | |
protocol: TCP | |
resources: {} | |
volumeMounts: | |
- name: metadata-volume | |
mountPath: /hasura-migrations | |
subPath: metadata.json | |
volumes: | |
- name: metadata-volume | |
configMap: | |
name: hasura-configmap |
This file contains hidden or 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
apiVersion: v1 | |
kind: Service | |
metadata: | |
labels: | |
app: hasura | |
name: hasura | |
spec: | |
ports: | |
- protocol: TCP | |
port: 8080 | |
targetPort: 8080 | |
selector: | |
app: hasura | |
type: ClusterIP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment