Skip to content

Instantly share code, notes, and snippets.

@cwilkers
Created November 19, 2020 15:16
Show Gist options
  • Save cwilkers/568a1f6b758c92b468574cffce409332 to your computer and use it in GitHub Desktop.
Save cwilkers/568a1f6b758c92b468574cffce409332 to your computer and use it in GitHub Desktop.
---
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
name: 50-set-selinux-for-hostpath-provisioner
labels:
machineconfiguration.openshift.io/role: worker
spec:
config:
ignition:
version: 2.2.0
systemd:
units:
- contents: |
[Unit]
Description=Set SELinux chcon for hostpath provisioner
Before=kubelet.service
[Service]
Type=oneshot
ExecStartPre=/usr/bin/mkdir -p /var/hostpath
ExecStart=/usr/bin/chcon -Rt container_file_t /var/hostpath
[Install]
WantedBy=multi-user.target
enabled: true
name: hostpath-provisioner.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment