Microservices divide your application’s functions into chunks that are independently deployable. Microservices are becoming an increasingly utilized tool in DevOps and CI/CD, and it is a popular subject at All Day DevOps. Kubernetes is an open-source platform to manage microservices. It is deployable on the cloud provider of your choice. AWS, Azure, and Google Cloud all provide managed instances of Kubernetes, and you can use kubespray to deploy Kubernetes in your datacenter. It helps you focus on the architecture rather than the infrastructure-level operations.
Huseyin begins talking about architecture at the high level. Most organizations need development, staging, and production environments, at a minimum. You can organize these in clusters in isolation, as you probably already do.
Or he suggests a better way - namespace-level isolation, along with this pro-tip, “Do not put all things in the default namespace, as it will be very hard to manage them in the future.”
Once your system is setup, you need to make sure you monitor everything. Prometheus is a tool you can use, and Huseyin walks through several of its capabilities and mentions an open-source tool to handle k8s-specific metrics automatically.
When you are ready to expose your application to the outside world, there are several options, such as a load balancer. However, creating a load balancer for each instance will be hard to manage and costly, so he recommends Nginx Ingress to automatically create a load balancer.
Of course, deploying Kubernetes, load balancing, and monitoring doesn’t mean you have implemented microservices. You need to have a solid architecture using best practices. Part of this is making sure the microservices can communicate well. Huseyin recommends striving to achieve the glory of REST.
Huseyin also covers using secrets, deployment scripts, project file structure, basic CI/CD with Kubernetes, distributed configuration, client code generation, and logging. Additionally, he recommends a couple tools for daily Kubernetes management: kubectx for managing your Kubernetes context and kubens for managing your Kubernetes namespace, both provided by Ahmet Alp Balkan.
Watch his whole presentation here.