Skip to content

Instantly share code, notes, and snippets.

@NeoTech
Last active July 2, 2019 15:32
Show Gist options
  • Save NeoTech/40ae6888a0466f3f822a4398170e5130 to your computer and use it in GitHub Desktop.
Save NeoTech/40ae6888a0466f3f822a4398170e5130 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: Service
metadata:
name: nginx-nodeport
namespace: default
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
app: nginx
env: dev
type: NodePort
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 10
selector:
matchLabels:
app: nginx
env: dev
replicas: 1
template:
metadata:
labels:
app: nginx
env: dev
spec:
containers:
- name: nginx
image: nginx:latest
imagePullPolicy: Always
ports:
- containerPort: 80
volumeMounts:
- mountPath: /mnt
name: host-mount
readinessProbe:
exec: # note this is now how we do readiness.
command:
- ls
- /
initialDelaySeconds: 5
periodSeconds: 5
volumes:
- name: host-mount
hostPath:
# directory location on host
path: /Users/
# this field is optional
type: Directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment