Skip to content

Instantly share code, notes, and snippets.

@vishnuhd
Last active June 27, 2020 20:04
Show Gist options
  • Save vishnuhd/2b052bdcad5d82f7bddd75f86a91ead5 to your computer and use it in GitHub Desktop.
Save vishnuhd/2b052bdcad5d82f7bddd75f86a91ead5 to your computer and use it in GitHub Desktop.
Nginx sample kubernetes deployment and service
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-nginx
labels:
app: nginx
spec:
selector:
matchLabels:
run: my-nginx
replicas: 2
template:
metadata:
labels:
run: my-nginx
spec:
containers:
- name: my-nginx
image: nginx
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: my-nginx
labels:
run: my-nginx
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 80
protocol: TCP
name: http
selector:
run: my-nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment