Skip to content

Instantly share code, notes, and snippets.

@berryp
Created November 28, 2017 08:06
Show Gist options
  • Save berryp/40da7ffd380d1146dbdbac74d4d75e6a to your computer and use it in GitHub Desktop.
Save berryp/40da7ffd380d1146dbdbac74d4d75e6a to your computer and use it in GitHub Desktop.
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: myapp-frontend
spec:
replicas: 1
revisionHistoryLimit: 3
strategy:
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
template:
metadata:
labels:
name: myapp-frontend
spec:
containers:
- name: myapp-frontend
image: index.docker.io/myaccount/myapp
imagePullPolicy: Always
ports:
- containerPort: 80
protocol: TCP
name: http
workingDir: /opt/wwc/myapp/frontend
resources:
limits:
cpu: 100m
memory: 250Mi
requests:
cpu: 100m
memory: 250Mi
readinessProbe:
httpGet:
path: /
port: 80
httpHeaders:
- name: Host
value: mydomain.com
periodSeconds: 15
successThreshold: 1
failureThreshold: 4
timeoutSeconds: 14
livenessProbe:
httpGet:
path: /
port: 80
httpHeaders:
- name: Host
value: mydomain.com
periodSeconds: 60
successThreshold: 1
failureThreshold: 4
timeoutSeconds: 60
initialDelaySeconds: 120
imagePullSecrets:
- name: hub
---
apiVersion: v1
kind: Service
metadata:
name: myapp-frontend
spec:
ports:
- port: 80
targetPort: 80
selector:
name: myapp-frontend
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: myapp-frontend
spec:
rules:
- host: myapp.mydomain.com
http:
paths:
- path: /
backend:
serviceName: myapp-frontend
servicePort: 80
- path: /blog-signup-success
backend:
serviceName: myapp-frontend
servicePort: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment