CI/CD with Kubernetes
Hart Hoover

@hhoover
The opinions expressed in this talk are my own
and not necessarily those of my employer
https://coreos.com/tectonic/
Agenda: The Hero’s Journey
• The Ordinary World: You, before this meetup.

• The Call to Adventure: Your invite to k8s SATX

• Refusal of the Call: Meh, traffic. IDK if I want to go.
Will there be food?

• Meeting with the Mentor: Hi, that’s me. You are
here.
• Crossing the Threshold: You decide to stay, in spite
of my slides.
The Hero’s Journey, cont.
• Challenges and Temptations: I’ll say some
controversial things, and discuss your
options for CI/CD. Sort out your alliances
and enemies here. What works for you?

• The Ordeal: A LIVE DEMO!

• The Reward: You overcome all doubts and
gain knowledge on CI/CD
The Hero’s Journey, cont.
• The Road Back: You take this knowledge
back to your job/team.

• The Resurrection: Your team will not want
to change their ways, which may require
some sacrifice, by you. By your action, the
polarities in conflict at the beginning will be
resolved.

• The Master of Two Worlds: You now have
the power to transform your company with
your knowledge, as you yourself have been
transformed.
A QUICK NOTE ON
HOW BUSINESS
WORKS
ALL CI/CD IS BASICALLY THE SAME
CI/CD IS NOT “DEVOPS”
Code
The “Unit of Deployment”?
Code
You have two jobs
manifests
Code
Your CI/CD system has two jobs
manifests
Some opinions on
Services vs. Self-Hosted
– Unknown
“DevOps is YAML over SSH”
Some Options: Services
Cloud Provider Services
.vsts-ci.yml
Visual Studio Team Services CodeBuild

CodePipeline

Lambda(?)
Google Cloud

Container Builder
cloudbuild.yml
AWS re:Invent - Nov 27
https://semaphoreci.com/community/tutorials/continuous-deployment-with-google-container-engine-and-kubernetes
CUSTOM YAML FILES
https://semaphoreci.com/docs/adding-custom-
configuration-files.html
codeship-steps.yml
https://documentation.codeship.com/pro/builds-
and-configuration/steps/
http://docs.shippable.com/ci/yml-structure/
http://docs.shippable.com/platform/integration/
kubernetes/
shippable.yml
.travis.yml
https://docs.travis-ci.com/user/getting-started/
NO OFFICIAL SUPPORT FOR KUBERNETES
(OpenShift doesn’t count)
.circleci/config.yml 
https://circleci.com/docs/2.0/sample-config/
NO OFFICIAL SUPPORT FOR KUBERNETES
(GKE doesn’t count)
Some Options: Self-Hosted
 ¯_(ツ)_/¯
DEPLOYMENT ONLY
Depends on TravisCI or Jenkins for testing
DEPLOYMENT ONLY
Only Kubernetes Manifests
https://draft.sh/
FOR , NOT CI/CD
https://confluence.atlassian.com/bitbucket/
deploy-to-kubernetes-892623297.html
bitbucket-pipelines.yml
DEMO TIME
Appendix: Multi-Stage Builds
FROM golang:1.7.3 as builder
WORKDIR /go/src/github.com/alexellis/href-counter/
RUN go get -d -v golang.org/x/net/html
COPY app.go .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /go/src/github.com/alexellis/href-counter/app .
CMD ["./app"]
TINY IMAGES FTW
Hart Hoover
@hhoover

CI/CD with Kubernetes