Last active
November 8, 2024 19:13
-
-
Save alexeldeib/01f2d3efc8fe17cca7625ecb7c1ec707 to your computer and use it in GitHub Desktop.
Privileged pod with hostNetwork and hostPid
This file contains hidden or 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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: &name debug2 | |
labels: | |
app: *name | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: *name | |
template: | |
metadata: | |
labels: | |
app: *name | |
spec: | |
# nodeSelector: | |
# cloud.google.com/gke-accelerator: nvidia-tesla-a100 | |
# tolerations: | |
# - key: "node-role.kubernetes.io/master" | |
# operator: "Exists" | |
# | |
# # above OR below needed ONLY, not both | |
# # | |
# affinity: | |
# nodeAffinity: | |
# requiredDuringSchedulingIgnoredDuringExecution: | |
# nodeSelectorTerms: | |
# - matchExpressions: | |
# - key: node-role.kubernetes.io/master | |
# operator: Exists | |
hostNetwork: true | |
hostPID: true | |
containers: | |
- image: docker.io/library/ubuntu:18.04 | |
name: debug | |
command: ["sleep", "infinity"] | |
env: | |
- name: NVIDIA_VISIBLE_DEVICES | |
value: all | |
resources: | |
requests: | |
nvidia.com/gpu: 1 | |
limits: | |
nvidia.com/gpu: 1 | |
securityContext: | |
privileged: true | |
capabilities: | |
add: ["SYS_PTRACE", "SYS_RAWIO"] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage: