Create/Build a Docker Image and push it to their Docker Hub repository.
Docker images are loaded from the container registry into Kubernetes pods. Access to the pods are exposed to consumers through a service.
3. Deployment
The manual deployment needs a YAML file that will describe things like number of replicas, deployment strategy, Docker image name, and port on which the application can be accessed.
kubectl apply -f deployment.yml
# It will show the message as :
# deployment.apps/simple-flask-deployment created
3. Other useful commands are:
# Verify the deployment
kubectl get deployments
# Check the rollout status
kubectl rollout status deployment/simple-flask-deployment
# Show the pods in the cluster
kubectl get pods
# Show the services in the cluster
kubectl describe services
# Display information about the cluster
kubectl cluster-info
4. Troubleshoot:
If your pods do not show up as "Ready" while running the kubectl get nodes1 command, use the following troubleshooting tips:
# List all namespaces, all pods
kubectl get all -A
# Show all events
kubectl get events -w
# Show component status
kubectl get componentstatuses
5. Clean up
Let's delete the deployment as well the Kubernetes cluster:
# Delete your deployment
kubectl delete deployments/simple-flask-deployment
# Tear down your cluster
eksctl delete cluster eksctl-demo --profile <profile-name>