Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

Hasura We’re making it fast for developers to build their backends. 1. A fast, lightweight GraphQL engine on postgres 2. Easily deploy code on kubernetes with a git push

Slide 3

Slide 3 text

Shahidh K Muhammed @shahidh_k

Slide 4

Slide 4 text

Deploy docker based apps to Kubernetes

Slide 5

Slide 5 text

Sample app app ├── Dockerfile ├── k8s.yaml └── src ├── app.py ├── requirements.txt └── server.py

Slide 6

Slide 6 text

Typical dev/deployment workflow 1. Modify code 2. docker build -t “myapp:version” . 3. docker push “myapp:version” 4. kubectl --context=dev edit deployment myapp 5. Repeat

Slide 7

Slide 7 text

Typical dev/deployment workflow

Slide 8

Slide 8 text

Workflow with gitkube 1. Modify code 2. git commit -am “changes” 3. git push dev master 4. Repeat

Slide 9

Slide 9 text

git push dev master

Slide 10

Slide 10 text

Setup for “git push dev master” 1. Install gitkube on your kubernetes cluster 2. Create a remote called “dev” which is configured to build a docker image and update a deployment.

Slide 11

Slide 11 text

The dev remote apiVersion: gitkube.sh/v1alpha1 kind: Remote metadata: name: dev spec: authorizedKeys: - "ssh-rsa your-ssh-public-key" deployments: - name: app containers: - name: app path: app dockerfile: app/Dockerfile

Slide 12

Slide 12 text

The dev remote apiVersion: gitkube.sh/v1alpha1 kind: Remote metadata: name: dev spec: authorizedKeys: - "ssh-rsa your-ssh-public-key" deployments: - name: app containers: - name: app path: app dockerfile: app/Dockerfile

Slide 13

Slide 13 text

The dev remote apiVersion: gitkube.sh/v1alpha1 kind: Remote metadata: name: dev spec: authorizedKeys: - "ssh-rsa your-ssh-public-key" deployments: - name: app containers: - name: app path: app dockerfile: app/Dockerfile

Slide 14

Slide 14 text

The dev remote apiVersion: gitkube.sh/v1alpha1 kind: Remote metadata: name: dev spec: authorizedKeys: - "ssh-rsa your-ssh-public-key" deployments: - name: app containers: - name: app path: app dockerfile: app/Dockerfile app ├── Dockerfile ├── k8s.yaml └── src ├── app.py ├── requirements.txt └── server.py

Slide 15

Slide 15 text

The dev remote apiVersion: gitkube.sh/v1alpha1 kind: Remote metadata: name: dev spec: authorizedKeys: - "ssh-rsa your-ssh-public-key" deployments: - name: app containers: - name: app path: app dockerfile: app/Dockerfile

Slide 16

Slide 16 text

Architecture

Slide 17

Slide 17 text

Features 1. Update multiple deployments with a single remote 2. Configure multiple remotes with different permissions 3. Push images to a registry (required on multi node clusters) 4. Build and deploy based on webhook events (coming soon!) 5. Easy customisation of hooks - plugin your own steps (coming soon!)

Slide 18

Slide 18 text

gitkube vs .. 1. Git based tooling. Every developer is familiar with git. 2. Quick iteration time when used on dev/staging clusters 3. Simple permission system based on public keys 4. Very small surface area. Can easily be replaced with more sophisticated CI/CD pipelines when moving to production.

Slide 19

Slide 19 text

Demo ● Gitkube ● GitOps at Hasura: ○ Deploying applications ○ Changing subdomain ○ Add a new domain ○ Database migrations

Slide 20

Slide 20 text

Shahidh K Muhammed @shahidh_k Thanks for listening! Questions?

Slide 21

Slide 21 text

How do we build such a system?

Slide 22

Slide 22 text

Your computer (?) deployment git push kube master

Slide 23

Slide 23 text

Your computer gitkubed Exposed externally SSH-key based auth deployment git push kube master

Slide 24

Slide 24 text

Your computer gitkubed (deployment,svc) Exposed externally SSH-key based auth deployment git push kube master Remote (custom resource) Which deployments to update? Which authorized-keys? kubectl ... remote.yaml

Slide 25

Slide 25 text

Your computer gitkubed (deployment,svc) Exposed externally SSH-key based auth deployment git push kube master Remote (custom resource) Which deployments to update? Which authorized-keys? gitkube-controller (operator) Listen to changes, and transmit kubectl ... remote.yaml