Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lrepolho/5cc217eeebf822c2e57705c57873fe5d to your computer and use it in GitHub Desktop.
Save lrepolho/5cc217eeebf822c2e57705c57873fe5d to your computer and use it in GitHub Desktop.
Simple Kubernetes Service and Deployment
apiVersion: v1
kind: Service
metadata:
labels:
app: rev
name: rev
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: 80
selector:
app: rev
tier: frontend
type: LoadBalancer
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: rev
name: rev
spec:
replicas: 1
selector:
matchLabels:
app: rev
tier: frontend
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: rev
tier: frontend
spec:
containers:
- image: nginx
imagePullPolicy: IfNotPresent
name: nginx
ports:
- containerPort: 80
name: nginx
protocol: TCP
restartPolicy: Always
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment