Skip to content

Instantly share code, notes, and snippets.

@pichuang
Created June 7, 2022 04:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pichuang/0359105b959b04e50a98d685d884d2c5 to your computer and use it in GitHub Desktop.
Save pichuang/0359105b959b04e50a98d685d884d2c5 to your computer and use it in GitHub Desktop.
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: webserver-simple-deployment
spec:
replicas: 2
selector:
matchLabels:
app: webserver-simple-app
template:
metadata:
labels:
app: webserver-simple-app
spec:
containers:
- name: webserver-simple-container
image: python:3
command:
- python
- -m
- http.server
ports:
- containerPort: 8000
---
# https://kubernetes.io/docs/concepts/services-networking/service/
apiVersion: v1
kind: Service
metadata:
name: webserver-simple-service
spec:
selector:
app: webserver-simple-app
ports:
- protocol: TCP
port: 80
targetPort: 8000
type: LoadBalancer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment