Slide 1

Slide 1 text

Docker image journey – How to shrink a docker image | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz Continuous Delivery to Kubernetes Deployment Interfaces DevOps Pro Europe 2019 2019-03-20 pic: © Moovel Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz

Slide 2

Slide 2 text

pic: © Moovel Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz

Slide 3

Slide 3 text

Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz Engineering Manager github.com/lotharschulz @lothar_schulz lotharschulz.info speakerdeck.com/lothar Me

Slide 4

Slide 4 text

Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz Starting Point CI / CD

Slide 5

Slide 5 text

Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz Deployment Format

Slide 6

Slide 6 text

Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz Deployment descriptor & Repository integration ghe-backup-deploy $ filetree README.md delivery.yaml deploy | - deploy apply | --- apply kube|secret.yaml statefulset.yaml

Slide 7

Slide 7 text

Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz Dependency $ cat Dockerfile # “latest” will be used when --build-arg is omitted ARG BASE_IMAGE_VERSION=latest FROM registry/stups/python ${BASE_IMAGE_VERSION}

Slide 8

Slide 8 text

Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz SCM integration

Slide 9

Slide 9 text

Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz Trigger

Slide 10

Slide 10 text

Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz Compliance In general, compliance means conforming to a rule, such as a specification, policy, standard or law. https://en.wikipedia.org/wiki/Regulatory_compliance

Slide 11

Slide 11 text

Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz Tests $ cat delivery.yaml version: "2017-09-20" ..... - desc: "run tests" cmd: | nosetests -w python

Slide 12

Slide 12 text

Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz Credentials $ cat delivery.yaml version: "2017-09-20" - desc: "build and push docker images" cmd: | PIERONE_NAMESPACE=pierone.stups.zalan.do/machinery BASE_IMAGE=$PIERONE_NAMESPACE/ghe-backup IMAGE=$BASE_IMAGE:cdp-${CDP_BUILD_VERSION} CACHE_IMAGE=$BASE_IMAGE:latest docker build --cache-from $CACHE_IMAGE -t $CACHE_IMAGE -t $IMAGE -f Dockerfile . if [ -z "$CDP_PULL_REQUEST_NUMBER" ]; then docker push $IMAGE echo "$IMAGE pushed" else ... fi

Slide 13

Slide 13 text

Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz Credentials & Setup https://speakerdeck.com/lothar/cd-at-zalando

Slide 14

Slide 14 text

Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz Credentials & Setup

Slide 15

Slide 15 text

Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz Git Branches & Pull Requests Builds

Slide 16

Slide 16 text

Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz Git Branches & Pull Requests Builds Poll PR until mergeable is true https://developer.github.com/v3/pulls/#response-1 https://developer.github.com/v3/git/#checking-mergeability-of-pull-requests

Slide 17

Slide 17 text

Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz Git Branches & Pull Requests Builds reference is not a tree reference ?

Slide 18

Slide 18 text

Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz Git Branches & Pull Requests Builds commits without reference can’t be accessed https://developer.github.com/v3/git/refs/#create-a-reference

Slide 19

Slide 19 text

Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz Git Branches & Pull Requests Builds merge A & B in worker VMs/nodes

Slide 20

Slide 20 text

Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz Hands off operations $ zkubectl get po | grep cdp-controller cdp-controller-7985fd799f-4jpbz cdp-controller-7985fd799f-rgpf8

Slide 21

Slide 21 text

Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz polling must die Don’t call us, we notify you.

Slide 22

Slide 22 text

Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz object store AWS S3 control access via IAM roles provision roles in AWS accounts change request cache control headers

Slide 23

Slide 23 text

Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz Support

Slide 24

Slide 24 text

Continuous Delivery to Kubernetes - Deployment Interfaces | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz Culture

Slide 25

Slide 25 text

Docker image journey – How to shrink a docker image | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz https://www.flickr.com/photos/eyecatcherfotosde/25418973420/ - build https://github.com/zalando/ghe-backup - delivery.yaml - deploy to k8s with Github Enterprise feedback - delivery.yaml - (init Container) I’m sure you have questions lotharschulz.info pic: https://www.flickr.com/photos/eyecatcherfotosde/25397937985 Docker image journey – How to shrink a docker image | Engineering | Lothar Schulz | 2019-03-20 Slido.com #devops2019 | @lothar_schulz