Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Kubernetes XFS support detector
apiVersion: apps/v1
kind: DaemonSet
metadata:
namespace: kube-system
name: xfs-detector
labels:
app: xfs-detector
spec:
selector:
matchLabels:
app: xfs-detector
template:
metadata:
labels:
app: xfs-detector
spec:
hostPID: true
volumes:
- name: tmp
emptyDir: {}
initContainers:
- name: detect
image: wardsco/nsenter
imagePullPolicy: IfNotPresent
command: ["sh", "-eo", "pipefail", "-c"]
args: ["nsenter -t 1 -m -u -i -n -p -- sh -c 'command -v xfs_mkfile' && touch /tmp/xfs_mkfile || true"]
securityContext:
privileged: true
volumeMounts:
- name: tmp
mountPath: /tmp/
- name: label
image: wardsco/kubectl:1.11
command: ["sh", "-eo", "pipefail", "-c"]
args: ["kubectl label node --overwrite $NODE_NAME fs.type/xfs=$(test -e /tmp/xfs_mkfile && echo 'true' || echo 'false'"]
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- name: tmp
mountPath: /tmp/
readOnly: true
containers:
- name: sleep
image: wardsco/sleep
imagePullPolicy: IfNotPresent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.