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

Dynamic management of kubernetes

  • 1.
  • 2.
    Usualy you havesome expectation ...
  • 3.
    … which aresimply doable … w/ autoscaling
  • 4.
  • 5.
  • 6.
    Why? To simplify complicatedthings ● 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
  • 7.
    Kubernetes allows alot of fun Kube API is REST ● create your own `pods`, `rc` and `svc` ● deploy them ● manage them … during the runtime!
  • 8.
    You can createown k8s management
  • 9.
    Management pod? ● Justanother 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
  • 10.
    How in Java?Use Fabric8 K8s client
  • 11.
    K8s API andFabric8 Client ● Described in Swagger ● Documentation, examples ● Full-fledged ● Fluent API ● Builders ● Auto-generated … it just works!
  • 12.
    What was tricky? Portmanagement ● K8s does not allows to change ports ● Static tcp load balancer, nginx ● TCP connection failures on KubeProxy
  • 13.
    What was tricky?Contd. ● Complicated testing - KubeApi required ● Everything is async - container creation takes minutes ● Watching resource versions ● Orphaned containers
  • 14.