Created
September 4, 2018 21:34
-
-
Save mattfarina/73c6b52cb0afb3296dd854be4255eaa3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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