In this video, we're going to show you how to deploy Flask with Docker and Kubernetes.
If you're looking for a quick and easy way to deploy Flask with Docker and Kubernetes, then this video is for you! We'll show you how to set up the environment and deploy Flask using Docker and Kubernetes, and you won't believe the results!
⭐⭐
docker build -t hello-world-flask .
docker run -p 8080:8080 hello-world-flask
curl localhost:8080/
docker tag hello-world-flask rezacomplete/hello-world-flask
docker login
docker push rezacomplete/hello-world-flask
kubectl apply -f deployment.yml
kubectl get deployments
curl localhost/
⭐⭐
deployment.yml:
⭐⭐
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-world-flask
labels:
app: hello-world-flask
spec:
replicas: 1
selector:
matchLabels:
app: hello-world-flask
template:
metadata:
labels:
app: hello-world-flask
spec:
containers:
name: hello-world-flask
image: rezacomplete/hello-world-flask
ports:
containerPort: 8080
env:
name: FLASK_ENV
value: "production"
---
apiVersion: v1
kind: Service
metadata:
name: hello-world-flask-service
labels:
app: hello-world-flask
spec:
selector:
app: hello-world-flask
ports:
name: http
protocol: TCP
port: 80
targetPort: 8080
type: LoadBalancer
⭐⭐
⭐⭐ What I am reading these days:
⭐⭐ Python Crash Course, 3rd Edition - amzn.to/440pVwx ⭐⭐
Негізгі бет Discover How to Deploy Flask with Docker & Kubernetes - You Won't Believe the Results!
Пікірлер: 13