Skip to content

Instantly share code, notes, and snippets.

@jodykpw
Created August 11, 2020 23:48
Show Gist options
  • Save jodykpw/18e8a300d89da51f7271ee7d7f9110e8 to your computer and use it in GitHub Desktop.
Save jodykpw/18e8a300d89da51f7271ee7d7f9110e8 to your computer and use it in GitHub Desktop.
Simple nginx load balancer example
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: nginx
spec:
selector:
matchLabels:
app: nginx
replicas: 2
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1
ports:
- name: http
containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: nginx
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: 80
selector:
app: nginx
type: LoadBalancer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment