Skip to content

Instantly share code, notes, and snippets.

@oscerd
Last active September 29, 2023 13:36
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 oscerd/83cf740a82b20626c20d1be1bc65927e to your computer and use it in GitHub Desktop.
Save oscerd/83cf740a82b20626c20d1be1bc65927e to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: Pod
metadata:
name: security-context-demo
spec:
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
volumes:
- name: sec-ctx-vol
emptyDir: {}
containers:
- name: sec-ctx-demo
image: busybox:1.28
command: [ "sh", "-c", "sleep 1h" ]
volumeMounts:
- name: sec-ctx-vol
mountPath: /data/demo
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment