Created
January 14, 2020 18:10
-
-
Save alexeldeib/91bf51e45587c179e7c079fc44ca2a8d to your computer and use it in GitHub Desktop.
privileged pod with access to host modules
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 debug | |
labels: | |
app: *name | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: *name | |
template: | |
metadata: | |
labels: | |
app: *name | |
spec: | |
# nodeSelector: | |
# node-role.kubernetes.io/master: '' | |
# tolerations: | |
# - key: "node-role.kubernetes.io/master" # useful to run on masters to investigate etcd latency | |
# operator: "Exists" | |
# | |
# # above OR below needed ONLY, not both | |
# # | |
# affinity: | |
# nodeAffinity: | |
# requiredDuringSchedulingIgnoredDuringExecution: | |
# nodeSelectorTerms: | |
# - matchExpressions: | |
# - key: node-role.kubernetes.io/master | |
# operator: Exists | |
# affinity: | |
# podAffinity: | |
# requiredDuringSchedulingIgnoredDuringExecution: | |
# - labelSelector: | |
# matchExpressions: | |
# - key: app | |
# operator: In | |
# values: | |
# - draft-oms | |
# topologyKey: "kubernetes.io/hostname" | |
# certain iotop and bpftrace/bcc tools require hostNetowkr and hostPID | |
hostNetwork: true | |
hostPID: true | |
containers: | |
- image: ubuntu:18.04 | |
name: ubuntu | |
command: ["sleep", "infinity"] | |
resources: {} | |
securityContext: | |
privileged: true | |
volumeMounts: | |
- mountPath: /lib/modules | |
name: mod | |
- mountPath: /usr/src | |
name: src | |
- mountPath: /sys | |
name: sys | |
volumes: | |
- hostPath: | |
path: /lib/modules | |
type: "" | |
name: mod | |
- hostPath: | |
path: /usr/src | |
type: "" | |
name: src | |
- hostPath: | |
path: /sys | |
type: "" | |
name: sys |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment