Hitchhiker's Guide to Microservices, Containers, and Kubernetes
Talk provides a high-level journey through the lifecycle of microservices development. We will create a microservice, create a container, and deploy it to a Kubernetes cluster.
focused the responsibilities of our microservices are. • Low Coupling –The measure of how strongly one microservice is connected to, has knowledge of, or relies on other microservices. KEY TENETS OF MICROSERVICES
everything needed to run an application: • Code • Runtime • System tools • System libraries • Settings • Runs quickly and reliably from one environment to another WHAT IS A CONTAINER?
(CPU, memory, network bandwidth, etc.) • Allow complete isolation of an application's view of the operating environment, including process trees, networking, user IDs and mounted file systems. Process isolation Resource management WHAT DOES A CONTAINER PROVIDE?
Shared area from the host OS which performs key operating tasks such as running processes, managing I/O, etc. Small, writable layer for temporary changes to the container. “Base” image which creates the foundation for the container. MICROSERVICES TO CONTAINERS
CONFIG_SERVER ${CONFIG_SERVER:-http://localhost:8280} RUN adduser -D -h /home/app -u 1000 app USER 1000 COPY target/${JAR} /app/app.jar EXPOSE 8080 ENTRYPOINT ["java", "-jar", "/app/app.jar", "--server.port=8080” ß Image to build from ß Declare command-line args ß Declare environment variables ß Create new user and switch to it. *** Avoid root! *** ß Copy Java artifact to image and expose HTTP port ß Start application BUILDING AN IMAGE: THE DOCKERFILE
• A Pod models an application-specific "logical host" and can contain different application containers which are relatively tightly coupled. CONTAINERS à PODS
Naming and discovery Load balancing Rolling updates Resource monitoring Logging Automatic bin packing Authentication/Authorization WHAT DOES KUBERNETES ORCHESTRATE?
answer. • Evaluate your needs and account for the added complexity and organizational challenges you may face. • Don’t be afraid to evaluate, reassess, and possibly abandon microservices if they end up not being a good fit. • Don’t use microservice just to build distributed monoliths.