Skip to content

Commit

Permalink
fix: nfs provisioner
Browse files Browse the repository at this point in the history
  • Loading branch information
codekow committed Aug 17, 2024
1 parent a2bf2ed commit f2c7113
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 10 deletions.
5 changes: 5 additions & 0 deletions components/app-configs/nfs-provisioner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

Quick Start

Modify the following values to match your environment

- `nfs-server.lan` - NFS server name / IP Address
- `nfs-data` - NFS export name

```sh
oc apply -k overlays/default
```
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace: nfs-provisioner
resources:
- https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner/deploy
- namespace.yaml
# - scc-houstmount-anyuid.yaml
# - scc-hostmount-anyuid.yaml
- scc-rolebinding.yaml

patches:
Expand All @@ -23,15 +23,15 @@ patches:
- name: PROVISIONER_NAME
value: k8s-sigs.io/nfs-subdir-external-provisioner
- name: NFS_SERVER
value: pi.hou
value: nfs-server.lan
- name: NFS_PATH
value: /nfs-data
- op: replace
path: /spec/template/spec/volumes
value:
- name: nfs-client-root
nfs:
server: pi.hou
server: nfs-server.lan
path: /nfs-data
target:
kind: Deployment
Expand Down
29 changes: 22 additions & 7 deletions components/app-configs/nfs-provisioner/base/scc-rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: nfs-client-provisioner-hostmount-anyuid
subjects:
- kind: ServiceAccount
name: nfs-client-provisioner
namespace: nfs-provisioner
name: nfs-provisioner-hostmount-anyuid
rules:
- apiGroups:
- security.openshift.io
resourceNames:
- hostmount-anyuid
# - nfs-provisioner-hostmount-anyuid
resources:
- securitycontextconstraints
verbs:
- use
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: nfs-provisioner-hostmount-anyuid
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: 'system:openshift:scc:hostmount-anyuid'
name: nfs-provisioner-hostmount-anyuid
subjects:
- kind: ServiceAccount
name: nfs-client-provisioner
namespace: nfs-provisioner
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../base

patches:
- target:
kind: Deployment
patch: |-
- op: replace
path: /spec/template/spec/containers/0/env
value:
- name: PROVISIONER_NAME
value: k8s-sigs.io/nfs-subdir-external-provisioner
- name: NFS_SERVER
value: 172.23.42.10
- name: NFS_PATH
value: /vol_wag1_dtn_octest
- op: replace
path: /spec/template/spec/volumes
value:
- name: nfs-client-root
nfs:
server: 172.23.42.10
path: /vol_wag1_dtn_octest

0 comments on commit f2c7113

Please sign in to comment.