-
Notifications
You must be signed in to change notification settings - Fork 0
/
30-hpp-setup.yaml
63 lines (57 loc) · 1.65 KB
/
30-hpp-setup.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
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=Create filesystem for hostpath provisioner
Before=kubelet.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/bash -c "[ -d /var/lib/hppvolumes ] || mkdir -p /var/lib/hppvolumes"
[Install]
WantedBy=multi-user.target
enabled: true
name: hostpath-provisioner-mkfs.service
- contents: |
[Unit]
Description=Set SELinux chcon for hostpath provisioner
Before=kubelet.service
After=hostpath-provisioner-mkfs.service
Requires=hostpath-provisioner-mkfs.service
[Service]
ExecStart=/usr/bin/chcon -Rt container_file_t /var/lib/hppvolumes
[Install]
WantedBy=multi-user.target
enabled: true
name: hostpath-provisioner.service
---
apiVersion: hostpathprovisioner.kubevirt.io/v1alpha1
kind: HostPathProvisioner
metadata:
name: hostpath-provisioner
namespace: openshift-cnv
spec:
imagePullPolicy: IfNotPresent
pathConfig:
path: "/var/lib/hppvolumes"
useNamingPrefix: "false"
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: hostpath-provisioner
namespace: openshift-cnv
provisioner: kubevirt.io/hostpath-provisioner
reclaimPolicy: Delete
volumeBindingMode: Immediate