build: add NFS provisioner RBAC to generated artifacts

Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
Niels de Vos 2024-01-26 17:02:05 +01:00 committed by mergify[bot]
parent 6b13352c9b
commit a6466fb1ca
3 changed files with 27 additions and 16 deletions

View File

@ -19,6 +19,7 @@ all: \
cephfs/kubernetes/csi-config-map.yaml \ cephfs/kubernetes/csi-config-map.yaml \
nfs/kubernetes/csidriver.yaml \ nfs/kubernetes/csidriver.yaml \
nfs/kubernetes/csi-config-map.yaml \ nfs/kubernetes/csi-config-map.yaml \
nfs/kubernetes/csi-provisioner-rbac.yaml \
rbd/kubernetes/csidriver.yaml \ rbd/kubernetes/csidriver.yaml \
rbd/kubernetes/csi-config-map.yaml rbd/kubernetes/csi-config-map.yaml
@ -37,6 +38,9 @@ nfs/kubernetes/csidriver.yaml: ../api/deploy/kubernetes/nfs/csidriver.yaml ../ap
nfs/kubernetes/csi-config-map.yaml: ../api/deploy/kubernetes/nfs/csi-config-map.* nfs/kubernetes/csi-config-map.yaml: ../api/deploy/kubernetes/nfs/csi-config-map.*
$(MAKE) -C ../tools generate-deploy $(MAKE) -C ../tools generate-deploy
nfs/kubernetes/csi-provisioner-rbac.yaml: ../api/deploy/kubernetes/nfs/csi-provisioner-rbac*
$(MAKE) -C ../tools generate-deploy
rbd/kubernetes/csidriver.yaml: ../api/deploy/kubernetes/rbd/csidriver.yaml ../api/deploy/kubernetes/rbd/csidriver.go rbd/kubernetes/csidriver.yaml: ../api/deploy/kubernetes/rbd/csidriver.yaml ../api/deploy/kubernetes/rbd/csidriver.go
$(MAKE) -C ../tools generate-deploy $(MAKE) -C ../tools generate-deploy

View File

@ -1,8 +1,10 @@
--- #
apiVersion: v1 # /!\ DO NOT MODIFY THIS FILE
kind: ServiceAccount #
metadata: # This file has been automatically generated by Ceph-CSI yamlgen.
name: nfs-csi-provisioner # The source for the contents can be found in the api/deploy directory, make
# your modifications there.
#
--- ---
kind: ClusterRole kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
@ -51,25 +53,26 @@ rules:
- apiGroups: ["snapshot.storage.k8s.io"] - apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshots"] resources: ["volumesnapshots"]
verbs: ["get", "list"] verbs: ["get", "list"]
--- ---
kind: ClusterRoleBinding kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
metadata: metadata:
name: nfs-csi-provisioner-role name: "nfs-csi-provisioner-role"
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: nfs-csi-provisioner name: "nfs-csi-provisioner"
namespace: default namespace: "default"
roleRef: roleRef:
kind: ClusterRole kind: ClusterRole
name: nfs-external-provisioner-runner name: nfs-external-provisioner-runner
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
--- ---
kind: Role kind: Role
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
metadata: metadata:
# replace with non-default namespace name namespace: "default"
namespace: default
name: nfs-external-provisioner-cfg name: nfs-external-provisioner-cfg
rules: rules:
# remove this once we stop supporting v1.0.0 # remove this once we stop supporting v1.0.0
@ -79,18 +82,17 @@ rules:
- apiGroups: ["coordination.k8s.io"] - apiGroups: ["coordination.k8s.io"]
resources: ["leases"] resources: ["leases"]
verbs: ["get", "watch", "list", "delete", "update", "create"] verbs: ["get", "watch", "list", "delete", "update", "create"]
--- ---
kind: RoleBinding kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
metadata: metadata:
name: nfs-csi-provisioner-role-cfg name: "nfs-csi-provisioner-role-cfg"
# replace with non-default namespace name namespace: "default"
namespace: default
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: nfs-csi-provisioner name: "nfs-csi-provisioner"
# replace with non-default namespace name namespace: "default"
namespace: default
roleRef: roleRef:
kind: Role kind: Role
name: nfs-external-provisioner-cfg name: nfs-external-provisioner-cfg

View File

@ -69,6 +69,11 @@ var yamlArtifacts = []deploymentArtifact{
reflect.ValueOf(nfs.NewCSIConfigMapYAML), reflect.ValueOf(nfs.NewCSIConfigMapYAML),
reflect.ValueOf(nfs.CSIConfigMapDefaults), reflect.ValueOf(nfs.CSIConfigMapDefaults),
}, },
{
"../deploy/nfs/kubernetes/csi-provisioner-rbac.yaml",
reflect.ValueOf(nfs.NewCSIProvisionerRBACYAML),
reflect.ValueOf(nfs.CSIProvisionerRBACDefaults),
},
{ {
"../deploy/rbd/kubernetes/csidriver.yaml", "../deploy/rbd/kubernetes/csidriver.yaml",
reflect.ValueOf(rbd.NewCSIDriverYAML), reflect.ValueOf(rbd.NewCSIDriverYAML),