Skip to content

Instantly share code, notes, and snippets.

@mattfarina
Created September 4, 2018 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattfarina/73c6b52cb0afb3296dd854be4255eaa3 to your computer and use it in GitHub Desktop.
Save mattfarina/73c6b52cb0afb3296dd854be4255eaa3 to your computer and use it in GitHub Desktop.
# This is a deployment with an init container to get the source for nginx
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-app
labels:
app: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.15.3
ports:
- containerPort: 80
volumeMounts:
- name: content
mountPath: /usr/share/nginx/html
initContainers:
- name: content
image: mattfarina/example-slim-app-sds:0.0.2
imagePullPolicy: Always
command:
# Coppies the content from this container to the volume shared with other
# container before going away
- cp
- "-R"
- "/app/index.html"
- "/tmp/content"
volumeMounts:
- name: content
mountPath: "/tmp/content"
dnsPolicy: Default
volumes:
- name: content
emptyDir: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment