forked from OCP-on-NERC/nerc-ocp-config
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add hostpath provisioner cluster-scoped resources
This adds the cluster-scoped resources required for the hostpath provisioner [1]. The hostpath provisioner lets us allocate host-local storage using PersistentVolumeClaims. [1]: https://github.com/kubevirt/hostpath-provisioner Part of: nerc-project/operations#49
- Loading branch information
Showing
13 changed files
with
141 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
cluster-scope/base/core/namespaces/kubevirt-hostpath-provisioner/kustomization.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- namespace.yaml |
4 changes: 4 additions & 0 deletions
4
cluster-scope/base/core/namespaces/kubevirt-hostpath-provisioner/namespace.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: kubevirt-hostpath-provisioner |
4 changes: 4 additions & 0 deletions
4
...configuration.openshift.io/machineconfigs/hostpath-provisioner-selinux/kustomization.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- machineconfig.yaml |
24 changes: 24 additions & 0 deletions
24
...configuration.openshift.io/machineconfigs/hostpath-provisioner-selinux/machineconfig.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: machineconfiguration.openshift.io/v1 | ||
kind: MachineConfig | ||
metadata: | ||
labels: | ||
machineconfiguration.openshift.io/role: worker | ||
name: hostpath-provisioner-selinux | ||
spec: | ||
config: | ||
ignition: | ||
version: 3.2.0 | ||
systemd: | ||
units: | ||
- name: hostpath-provisioner-selinux.service | ||
enabled: true | ||
contents: | | ||
[Unit] | ||
Description=Set SELinux chcon for hostpath-provisioner | ||
Before=kubelet.service | ||
[Service] | ||
ExecStart=/usr/bin/chcon -Rt container_file_t /var/hpvolumes | ||
[Install] | ||
WantedBy=multi-user.target |
12 changes: 12 additions & 0 deletions
12
...rization.k8s.io/clusterrolebindings/kubevirt-hostpath-provisioner/clusterrolebinding.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: kubevirt-hostpath-provisioner | ||
subjects: | ||
- kind: ServiceAccount | ||
name: kubevirt-hostpath-provisioner-admin | ||
namespace: kubevirt-hostpath-provisioner | ||
roleRef: | ||
kind: ClusterRole | ||
name: kubevirt-hostpath-provisioner | ||
apiGroup: rbac.authorization.k8s.io |
4 changes: 4 additions & 0 deletions
4
...authorization.k8s.io/clusterrolebindings/kubevirt-hostpath-provisioner/kustomization.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- clusterrolebinding.yaml |
28 changes: 28 additions & 0 deletions
28
...ase/rbac.authorization.k8s.io/clusterroles/kubevirt-hostpath-provisioner/clusterrole.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
kind: ClusterRole | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: kubevirt-hostpath-provisioner | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["nodes"] | ||
verbs: ["get"] | ||
- apiGroups: [""] | ||
resources: ["persistentvolumes"] | ||
verbs: ["get", "list", "watch", "create", "delete"] | ||
- apiGroups: [""] | ||
resources: ["persistentvolumeclaims"] | ||
verbs: ["get", "list", "watch", "update"] | ||
- apiGroups: ["storage.k8s.io"] | ||
resources: ["storageclasses"] | ||
verbs: ["get", "list", "watch"] | ||
- apiGroups: [""] | ||
resources: ["events"] | ||
verbs: ["list", "watch", "create", "update", "patch"] | ||
- apiGroups: | ||
- security.openshift.io | ||
resources: | ||
- securitycontextconstraints | ||
resourceNames: | ||
- hostpath-provisioner | ||
verbs: | ||
- use |
4 changes: 4 additions & 0 deletions
4
...e/rbac.authorization.k8s.io/clusterroles/kubevirt-hostpath-provisioner/kustomization.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- clusterrole.yaml |
4 changes: 4 additions & 0 deletions
4
.../security.openshift.io/securitycontextconstraints/hostpath-provisioner/kustomization.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- securitycontextconstraints.yaml |
30 changes: 30 additions & 0 deletions
30
...nshift.io/securitycontextconstraints/hostpath-provisioner/securitycontextconstraints.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
kind: SecurityContextConstraints | ||
apiVersion: security.openshift.io/v1 | ||
metadata: | ||
name: hostpath-provisioner | ||
requiredDropCapabilities: | ||
- KILL | ||
- MKNOD | ||
- SETUID | ||
- SETGID | ||
runAsUser: | ||
type: RunAsAny | ||
seLinuxContext: | ||
type: RunAsAny | ||
fsGroup: | ||
type: RunAsAny | ||
supplementalGroups: | ||
type: RunAsAny | ||
allowHostDirVolumePlugin: true | ||
allowHostIPC: false | ||
allowHostNetwork: false | ||
allowHostPID: false | ||
allowHostPorts: false | ||
allowPrivilegedContainer: true | ||
readOnlyRootFilesystem: false | ||
users: | ||
- system:serviceaccount:kubevirt-hostpath-provisioner:kubevirt-hostpath-provisioner | ||
volumes: | ||
- hostPath | ||
- downwardAPI | ||
- projected |
4 changes: 4 additions & 0 deletions
4
...scope/base/storage.k8s.io/storageclasses/kubevirt-hostpath-provisioner/kustomization.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- storageclass.yaml |
7 changes: 7 additions & 0 deletions
7
...-scope/base/storage.k8s.io/storageclasses/kubevirt-hostpath-provisioner/storageclass.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: storage.k8s.io/v1 | ||
kind: StorageClass | ||
metadata: | ||
name: kubevirt-hostpath-provisioner | ||
provisioner: kubevirt.io/hostpath-provisioner | ||
reclaimPolicy: Delete | ||
volumeBindingMode: WaitForFirstConsumer |
12 changes: 12 additions & 0 deletions
12
cluster-scope/bundles/hostpath-provisioner/kustomization.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
commonLabels: | ||
nerc.mghpcc.org/bundle: hostpath-provisioner | ||
|
||
resources: | ||
- ../../base/core/namespaces/kubevirt-hostpath-provisioner | ||
- ../../base/rbac.authorization.k8s.io/clusterrolebindings/kubevirt-hostpath-provisioner | ||
- ../../base/storage.k8s.io/storageclasses/kubevirt-hostpath-provisioner | ||
- ../../base/security.openshift.io/securitycontextconstraints/hostpath-provisioner | ||
- ../../base/rbac.authorization.k8s.io/clusterroles/kubevirt-hostpath-provisioner | ||
- ../../base/machineconfiguration.openshift.io/machineconfigs/hostpath-provisioner-selinux |