Dynamic management of kubernetes
-
Upload
martin-podval -
Category
Software
-
view
226 -
download
2
Transcript of Dynamic management of kubernetes
Dynamic management of Kubernetes
MartinPodval
Usualy you have some expectation ...
… which are simply doable
… w/ autoscaling
Unpredictable, isolated customers?
Separate them. It’s simple!
Why?
To simplify complicated things● Scale different customers in different way● Divide and do not affect multiple environments● Different image versions for different customers● Specific customizations for specific customer● Cannary but “full-environment”● Allows to deploy complex changes● Easy management by labels
Kubernetes allows a lot of fun
Kube API is REST● create your own `pods`, `rc` and `svc`● deploy them● manage them
… during the runtime!
You can create own k8s management
Management pod?
● Just another docker container● With access to KubeAPI● Java & SpringBoot● Your `Rc`s and `Svc`s described in the code● REST calls and long-polling watches - by etcd● Auto-scaling by k8s or according to KubeAPI calls
How in Java? Use Fabric8 K8s client
K8s API and Fabric8 Client
● Described in Swagger● Documentation, examples● Full-fledged● Fluent API● Builders● Auto-generated
… it just works!
What was tricky?
Port management● K8s does not allows to change ports● Static tcp load balancer, nginx● TCP connection failures on KubeProxy
What was tricky? Contd.
● Complicated testing - KubeApi required● Everything is async - container creation takes minutes● Watching resource versions● Orphaned containers
Q & A