Skip to content

Instantly share code, notes, and snippets.

@mr-pascal
Created March 5, 2022 06:30
Show Gist options
  • Save mr-pascal/ed92182fcf2b94c5b44aad40ad9a755c to your computer and use it in GitHub Desktop.
Save mr-pascal/ed92182fcf2b94c5b44aad40ad9a755c to your computer and use it in GitHub Desktop.
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
labels:
name: nginx
spec:
selector:
matchLabels:
name: nginx
template:
metadata:
labels:
name: nginx
spec:
containers:
- name: nginx
image: nginx:1.21.6-alpine
ports:
- containerPort: 80
###### Mount the config map
volumeMounts:
- name: mnt
mountPath: /usr/share/nginx/html/index.html
subPath: file-from-cfgmap
volumes:
- name: mnt
configMap:
name: nginx-cfgmap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment