Getting started fast
Development infrastructure, CI, and test deployment
via a Kubernetes cluster on AWS
Jörg Müller (@joergm) and Andreas Krüger, September 2017
Slide 2
Slide 2 text
2 / 47
Typical client situation
Pipelines
Scheduling
Monitoring
Pipelines
Pipelines
Service
discovery
I want a microservice
architecture!
Slide 3
Slide 3 text
3 / 47
Typical client situation
Pipelines
Scheduling
Monitoring
Pipelines
Pipelines
Service
discovery
I want a microservice
architecture!
What about your
infrastructure?
Slide 4
Slide 4 text
4 / 47
Typical client situation
I want a microservice
architecture!
What about your
infrastructure?
Pipelines
Scheduling Monitoring
Service discovery
Slide 5
Slide 5 text
5 / 47
Typical client situation
Pipelines
Scheduling
Monitoring
Pipelines
Pipelines
Service
discovery
That will take
a while...
Slide 6
Slide 6 text
6 / 47
Quick Start
●
start development soon
●
stay closer to later production
●
cover most steps
from Git push to monitoring
●
remain adaptable
Slide 7
Slide 7 text
7 / 47
Non Goals
●
high availability
●
multi-datacenter
●
autoscaling
●
complex security model
Slide 8
Slide 8 text
8 / 47
Main components
Slide 9
Slide 9 text
9 / 47
AWS
Slide 10
Slide 10 text
10 / 47
AWS
customer innoQ
On my account
under my control. What I need
when I need it.
Slide 11
Slide 11 text
11 / 47
Kubernetes
Slide 12
Slide 12 text
12 / 47
Kubernetes
●
decides which Docker container
to run on which node
●
container health check
●
restart container after container
or node failure
Slide 13
Slide 13 text
13 / 47
Kubernetes
●
in-cluster service discovery
●
in-cluster load balancing
●
make load balancer available
on external network
Slide 14
Slide 14 text
14 / 47
Kubernetes
●
secret management
●
manage persistent storage (EBS)
●
group several containers into “POD”,
can access same persistent storage
Slide 15
Slide 15 text
15 / 47
Kubernetes
●
runs on AWS
●
runs on other clouds
●
runs on bare metal
Slide 16
Slide 16 text
16 / 47
Kubernetes
customer innoQ
Fits my plans.
Prevents
lock-in.
Our devs know +
like it.
Slide 17
Slide 17 text
17 / 47
kops
Slide 18
Slide 18 text
18 / 47
kops
Kubernetes
kops
AWS
Slide 19
Slide 19 text
19 / 47
kops
●
install Kubernetes on AWS
●
makes (some) AWS services
available to Kubernetes cluster
●
helps to scale the cluster
Slide 20
Slide 20 text
20 / 47
kops
Installing a Kubernetes cluster on AWS
takes about 7 minutes
Slide 21
Slide 21 text
21 / 47
kops
Installing a Kubernetes cluster on AWS
takes about 7 minutes
after AWS account and route 53 DNS subdomain are both set up,
and if the AWS availability zone can provide the nodes you need.
Slide 22
Slide 22 text
22 / 47
Helm
Slide 23
Slide 23 text
23 / 47
Helm
Kubernetes package- and dependency management
Slide 24
Slide 24 text
24 / 47
Helm
Helm chart
POD
Docker
container
POD
Docker
container
POD
Docker
container
Docker
container
POD
Docker
container
Helm chart
Slide 25
Slide 25 text
25 / 47
Helm
●
adds depth and recursion to Kubernetes
●
provides templating as basis for configuration
●
configuration possible at any level,
top-level overriding deep configuration
28 / 47
Helm
Many Helm charts exist,
ready to be used!
https://kubeapps.com/
Slide 29
Slide 29 text
29 / 47
automatic https
Slide 30
Slide 30 text
30 / 47
Add some annotations
dns.alpha.kubernetes.io/external: subdomain.example.com
kubernetes.io/tls-acme: 'true'
Slide 31
Slide 31 text
31 / 47
Lots of background-action
Slide 32
Slide 32 text
32 / 47
Controller in general
Slide 33
Slide 33 text
33 / 47
Gitlab
Slide 34
Slide 34 text
34 / 47
Gitlab as SCM
●
place to keep your git repos
●
provides issue system
●
wiki
●
pull request process
Slide 35
Slide 35 text
35 / 47
Gitlab as CI/CD
●
Gitlab CI
●
private Docker registry
●
support for deploying into cluster
Slide 36
Slide 36 text
36 / 47
Gitlab on Kubernetes
●
Helm Charts for Core and CI Runners
●
charts include all dependencies (Dbs …)
●
Backup to S3
Slide 37
Slide 37 text
37 / 47
notable stuf
of our own
Slide 38
Slide 38 text
38 / 47
notable stuf
of our own
●
Setup Docker container
●
Helm charts
Slide 39
Slide 39 text
39 / 47
“setup” Docker container
Slide 40
Slide 40 text
40 / 47
“setup” Docker container
●
All the CLIs installed ready to use
(Kops, Kubernetes, Helm, AWS).
●
A few scripts to automate things.
Slide 41
Slide 41 text
41 / 47
“setup” Docker container
●
Can be used by developer on dev PC.
●
Can be used by Gitlab-CI build.
Slide 42
Slide 42 text
42 / 47
“setup” Docker container
A Python script for our developers' PCs
saves them from having to remember + type
complicated docker command lines
(and saves us from having to document them in detail).
Slide 43
Slide 43 text
43 / 47
Helm charts
Slide 44
Slide 44 text
44 / 47
Helm charts
●
for infrastructure
such as monitoring, logging, Gitlab
●
sample Helm chart
to copy and use for a new microservice
(there is also sample Gitlab-CI code)
Slide 45
Slide 45 text
45 / 47
Our overall experience
Slide 46
Slide 46 text
46 / 47
Our overall experience
Having fun building
with big bricks.