Kubernetes is hard! Lessons learned taking our apps to Kubernetes
Slide 2
Why? Environment flexibility Developer, QA, Support, Product, Solution… anyone!
Per branch CI/CD Save money and resources Dogfooding @jbaruch
#DevDialogue
#k8S
Ribbit with us: #swampUP http://jfrog.com/shownotes
Slide 3
The end Take it easy Your app is not ready Limits are good (my mom said that) Probes Observability Community @jbaruch
#DevDialogue
#k8S
Ribbit with us: #swampUP http://jfrog.com/shownotes
Your app is not ready.
@jbaruch
#DevDialogue
#k8S
http://jfrog.com/shownotes
Slide 13
From any “logging best practices” talk or article:
@jbaruch
#DevDialogue
#k8S
Ribbit with us: #swampUP http://jfrog.com/shownotes
Slide 14
Your app is not ready Data Persistency You need it. Or do you?
@jbaruch
#DevDialogue
#k8S
Ribbit with us: #swampUP http://jfrog.com/shownotes
Slide 15
Slide 16
Your app is not ready High availibility If you did HA before K8S, you are going to rewrite it
Scaling
Up and down
Updates and downgrades Some pods will be newer than others (or older) @jbaruch
#DevDialogue
#k8S
Ribbit with us: #swampUP http://jfrog.com/shownotes
Slide 17
Slide 18
Now let’s look at kubernetes
@jbaruch
#DevDialogue
#k8S
http://jfrog.com/shownotes
Take care of the health It’s always a good idea, mandatory with K8S readinessProbe When the app is ready to serve
livenessProbe Is this thing alive?
Probe types Exec - returns 0 Http - returns < 400
… readinessProbe: httpGet: path: /api/system/health port: 8080 … livenessProbe: exec: command: - mongo - —eval - “db.adminCommand(‘ping’)” … livenessProbe: tcpSocket: port: 5672 …
Tcp - did we manage to open a port
If needed, write an exec script @jbaruch
#DevDialogue
#k8S
Ribbit with us: #swampUP http://jfrog.com/shownotes
Slide 21
More than one container in a pod Initialization (before your container is up) Preheat your cache Run config scripts
Sidecar design pattern Log collector Monitoring Network proxy (e.g. Istio) @jbaruch
#DevDialogue
#k8S
Ribbit with us: #swampUP http://jfrog.com/shownotes
Slide 22
How to deploy anything to k8s Copy YAML Paste YAML Fix indents Repeat @jbaruch
#DevDialogue
#k8S
http://jfrog.com/shownotes
Values: # Default values for docker-app. # This is a YAML-formatted file. # Declare name/value pairs to be passed into your templates. image: repository: docker.artifactory/docker-app tag: 1.1 secretName: regsecret pullPolicy: Always
@jbaruch
#DevDialogue
#k8S
http://jfrog.com/shownotes
Chart <-> image relationship Using templates we can reuse charts for multiple image versions Chart versions != Image versions
@jbaruch
#DevDialogue
#k8S
http://jfrog.com/shownotes
Slide 34
Slide 35
Helm repositories Official repository - kubeapps.com Get a local one! Option 1: Create your own: Run an http server with index.yaml Run helm repo index to generate one the index Option 2: Use JFrog Artifactory Universal Artifact Repository which supports Docker, Helm and everything else @jbaruch
#DevDialogue
#k8S
http://jfrog.com/shownotes
Slide 36
observability No more ssh and grep in logs No need for production access for everybody (unless you pretend you’re Netflix) Observability tools: Log aggregation (Sumo Logic, Splunk, Log Entries) APM (New Relic, AppDynamics) Monitoring (DataDog, SignalFX)
Cloud-Native tools @jbaruch
#DevDialogue
#k8S
Ribbit with us: #swampUP http://jfrog.com/shownotes
We’re big on those pipelines and promotions concepts If quality requirments are hit
CI SERVER
1
If quality requirments are hit
2
Integration
If quality requirments are hit
3
System Testing
4
Staging
Production
*
Integration with CI servers
@jbaruch
#DevDialogue
#k8S
Ribbit with us: #swampUP http://jfrog.com/shownotes
Slide 41
Jfrog and k8s GoCenter.io Distribution Development, testing
@jbaruch
#DevDialogue
#k8S
Ribbit with us: #swampUP http://jfrog.com/shownotes
Slide 42
Community Probably someone had this problem before CNCF Ambassadors Project maintainers and commiters Kudos RabbitMQ HA MongoDB (Bitnami)
@jbaruch
#DevDialogue
#k8S
Ribbit with us: #swampUP http://jfrog.com/shownotes
Slide 43
The end Take it easy Your app is not ready Limits are good (my mom said that) Probes Observability Community @jbaruch
#DevDialogue
#k8S
Ribbit with us: #swampUP http://jfrog.com/shownotes
Slide 44
Twitter ads and Q&A http://jfrog.com/shownotes @jbaruch #DevDialogue #k8S
Ribbit with us: #swampUP
Slide 45
Happy sailing!
@jbaruch
#DevDialogue
#k8S
Ribbit with us: #swampUP http://jfrog.com/shownotes