Skip to content

Instantly share code, notes, and snippets.

@74th
Created August 9, 2019 01:33
Show Gist options
  • Save 74th/8bb1b1a1ef5e7879f1708695baa67253 to your computer and use it in GitHub Desktop.
Save 74th/8bb1b1a1ef5e7879f1708695baa67253 to your computer and use it in GitHub Desktop.
Kubernetes Readonly filesystem nginx example
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: readonly-fs-test
spec:
replicas: 1
template:
metadata:
labels:
name: readonly-fs-test
spec:
containers:
- name: nginx
image: nginx:1.17.2
securityContext:
readOnlyRootFilesystem: true
volumeMounts:
- name: run
mountPath: /var/run
- name: log
mountPath: /var/log/nginx
- name: cache
mountPath: /var/cache/nginx
volumes:
- name: run
emptyDir:
medium: ""
- name: log
emptyDir:
medium: ""
- name: cache
emptyDir:
medium: ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment