Less than 1 minute
apiVersion: apps/v1
kind: Deployment
metadata:
name: python-http-serv
spec:
selector:
matchLabels:
app: http
template:
metadata:
labels:
app: http
spec:
containers:
- name: http-container
image: python:3.9-alpine
command: [ "python3", "-mhttp.server", "8080" ]
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: python-http-serv
spec:
type: NodePort
selector:
app: http
ports:
- port: 80
targetPort: 8080
nodePort: 30080