Skip to content

Instantly share code, notes, and snippets.

@TrongTan124
Created November 21, 2020 08:00
Show Gist options
  • Save TrongTan124/c078852b1e5984835101402f41020155 to your computer and use it in GitHub Desktop.
Save TrongTan124/c078852b1e5984835101402f41020155 to your computer and use it in GitHub Desktop.
lab2-kubernetes-deployment
apiVersion: apps/v1 #Older versions of k8s use apps/v1beta1
kind: Deployment
metadata:
name: nginx-deploy
spec:
replicas: 2
selector:
matchLabels:
app: nginx-dev
minReadySeconds: 10
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
maxSurge: 1
template:
metadata:
labels:
app: nginx-dev
spec:
containers:
- name: nginx-pod
image: nginx:1.15
ports:
- containerPort: 80
livenessProbe:
tcpSocket:
port: 80
initialDelaySeconds: 10
periodSeconds: 3
readinessProbe:
tcpSocket:
port: 80
initialDelaySeconds: 15
periodSeconds: 5
resources:
requests:
cpu: "50m"
memory: "64Mi"
limits:
cpu: "100m"
memory: "128Mi"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment