Chapter 66: Docker and Kubernetes Together: Dockerfile to Registry to Cluster, Jenkins and Kompose
Take one app: write a Dockerfile, build the image, push it to a registry and deploy it on Kubernetes. Then automate that flow in a Jenkins pipeline and convert a docker-compose file to Kubernetes YAML with Kompose. This chapter makes Docker and Kubernetes work together clear.
एक app घेऊ: Dockerfile लिहायचे, image build करायचे, registry मध्ये push करायचे आणि Kubernetes वर deploy करायचे. नंतर हे सगळे Jenkins pipeline मध्ये automatic करायचे आणि docker-compose file Kompose ने Kubernetes YAML मध्ये बदलायची. Docker आणि Kubernetes एकत्र कसे चालतात ते इथे स्पष्ट होईल.
एक app लें: Dockerfile लिखें, image build करें, registry में push करें और Kubernetes पर deploy करें. फिर ये सब Jenkins pipeline में automatic करें और docker-compose file को Kompose से Kubernetes YAML में बदलें. Docker और Kubernetes साथ कैसे चलते हैं, यहाँ साफ़ होगा.
What you will learn in this chapter
- Write a production-ready multi-stage Dockerfile for one real app
- Tag images with versions and digests and push them to a local registry, Docker Hub and Amazon ECR
- Pull private images in Kubernetes with imagePullSecrets and load images into kind
- Deploy the image with a Deployment, Service, ConfigMap, Secret and probes
- Automate build, test, push and deploy with a Jenkins pipeline
- Convert a docker-compose file to Kubernetes manifests with Kompose and fix what it misses
Concepts in this chapter
- 66.1The app and its Dockerfile: from source code to a small, safe image
- 66.2Tag and push: local registry, Docker Hub and Amazon ECR
- 66.3Deploy the image to Kubernetes: config, secrets, probes and pull secrets
- 66.4Jenkins pipeline: build, test, push and deploy to Kubernetes
- 66.5Kompose: convert docker-compose.yml to Kubernetes and fix what it misses
The chapter recap is at the end of the last concept page.