Home Explore Blog CI



kubernetes

3rd chunk of `content/en/blog/_posts/2016-07-00-Automation-Platform-At-Wercker-With-Kubernetes.md`
7dcc97e5f1115dd11612ecb9ce21056ec88f2e167af97bf60000000100000a9e





Patrician nodes are where the bulk of our infrastructure runs. These nodes have appropriate network interfaces to communicate with our backend services as well as be routable by various load balancers. This is where our logging is aggregated and sent off to logging services, our many microservices for reporting and processing the results of job runs, and our many microservices for handling API calls.



On the other end of the spectrum are the Peasant nodes where the public jobs are run. Public jobs consist of worker pods reading from a job queue and dynamically generating new runner pods to handle execution of the job. The job itself is an incarnation of our open source [CLI tool](http://github.com/wercker/wercker), the same one you can run on your laptop with Docker installed. These nodes have very limited access to the rest of the infrastructure and the containers the jobs themselves run in are even further isolated.



Controllers are controllers, I bet ours look exactly the same as yours.



**Dynamic Pods**

Our heaviest use of the Kubernetes API is definitely our system of creating dynamic pods to serve as the runtime environment for our actual job execution. After pulling job descriptions from the queue we define a new pod containing all the relevant environment for checking out code, managing a cache, executing a job and uploading artifacts. We launch the pod, monitor its progress, and destroy it when the job is done.



**Ingresses**

In order to provide a backend for HTTP API calls and allow self-registration of handlers we make use of the Ingress system in Kubernetes. It wasn't the clearest thing to set up, but reading through enough of the [nginx example](https://kubernetes.io/blog/2016/03/kubernetes-1-2-and-simplifying-advanced-networking-with-ingress/) eventually got us to a good spot where it is easy to connect services to the frontend.



**Upcoming Features in 1.3**



While we generally treat all of our pods and containers as ephemeral and expect rapid restarts on failures, we are looking forward to Pet Sets and Init Containers as ways to optimize some of our processes. We are also pleased with official support for [Minikube](https://github.com/kubernetes/minikube) coming along as it improves our local testing and development. 



**Conclusion**



Kubernetes saves us the non-trivial task of managing many, many containers across many nodes. It provides a robust API and tooling for introspecting these containers, and it includes much built in support for logging, metrics, monitoring and debugging. Service discovery and networking alone saves us so much time and speeds development immensely.

Cheers to you Kubernetes, keep up the good work :)

Title: Wercker's Kubernetes Implementation: Peasant Nodes, Dynamic Pods, Ingresses, and Future Plans
Summary
Wercker utilizes 'Peasant' nodes for running public jobs in isolated containers. The system dynamically creates pods to execute jobs, leveraging the Kubernetes API to manage the runtime environment. Ingresses are used for HTTP API calls and self-registration of handlers. Wercker plans to explore Pet Sets and Init Containers in Kubernetes 1.3 for optimization. Kubernetes simplifies container management, offering a robust API, logging, metrics, service discovery and networking.