From 44993b3682bae5b968f8c7fff802c0fd84f0c1c1 Mon Sep 17 00:00:00 2001 From: stoneshi-yunify Date: Tue, 10 Sep 2024 10:08:24 +0800 Subject: [PATCH] fix yamls Signed-off-by: stoneshi-yunify --- Makefile | 2 +- config/crd/kustomization.yaml | 3 +++ config/manager/kustomization.yaml | 6 ++++++ config/manager/manager.yaml | 2 +- config/rbac/role.yaml | 36 +++++++++++++++++++++++++------ 5 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 config/crd/kustomization.yaml diff --git a/Makefile b/Makefile index 25787b4..2dc4b4b 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # Image URL to use all building/pushing image targets -IMG ?= controller:latest +IMG ?= kubesphere/nfs-pv-static-provisioner:latest # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. ENVTEST_K8S_VERSION = 1.31.0 diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml new file mode 100644 index 0000000..419dcad --- /dev/null +++ b/config/crd/kustomization.yaml @@ -0,0 +1,3 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: [] \ No newline at end of file diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 5c5f0b8..a787e6e 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -1,2 +1,8 @@ resources: - manager.yaml +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +images: +- name: controller + newName: kubesphere/nfs-pv-static-provisioner + newTag: latest diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 67551b6..7a284f9 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -63,7 +63,7 @@ spec: args: - --leader-elect - --health-probe-bind-address=:8081 - image: kubesphere/nfs-pv-static-provisioner:latest + image: controller:latest name: manager securityContext: allowPrivilegeEscalation: false diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 43635c0..0122b7c 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -1,11 +1,35 @@ +--- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - labels: - app.kubernetes.io/name: nfs-pv-static-provisioner - app.kubernetes.io/managed-by: kustomize name: manager-role rules: -- apiGroups: [""] - resources: ["pods"] - verbs: ["get", "list", "watch"] +- apiGroups: + - "" + resources: + - persistentvolumeclaims + - persistentvolumes + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - "" + resources: + - persistentvolumeclaims/finalizers + - persistentvolumes/finalizers + verbs: + - update +- apiGroups: + - "" + resources: + - persistentvolumeclaims/status + - persistentvolumes/status + verbs: + - get + - patch + - update