diff --git a/Makefile b/Makefile index cd23c13..af5b507 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ help: ## Display this help. .PHONY: manifests manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects. - $(CONTROLLER_GEN) rbac:roleName=non-admin-manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases + $(CONTROLLER_GEN) rbac:roleName=non-admin-controller-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases .PHONY: generate generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index 5fe9fe6..c460dde 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -6,7 +6,7 @@ namespace: openshift-adp-system # "wordpress" becomes "alices-wordpress". # Note that it should also match with the prefix (text before '-') of the namespace # field above. -namePrefix: openshift-adp- +namePrefix: # Labels to add to all resources and selectors. #labels: diff --git a/config/default/manager_oadp_patch.yaml b/config/default/manager_oadp_patch.yaml index 531ff68..159e8ad 100644 --- a/config/default/manager_oadp_patch.yaml +++ b/config/default/manager_oadp_patch.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: non-admin-controller-manager + name: non-admin-controller namespace: system spec: template: @@ -9,7 +9,7 @@ spec: annotations: spec: containers: - - name: non-admin-manager + - name: non-admin-controller imagePullPolicy: Always args: command: diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index e6381ef..0ae1339 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Namespace metadata: labels: - control-plane: non-admin-controller-manager + control-plane: non-admin-controller app.kubernetes.io/name: namespace app.kubernetes.io/instance: system app.kubernetes.io/component: manager @@ -14,12 +14,12 @@ metadata: apiVersion: apps/v1 kind: Deployment metadata: - name: non-admin-controller-manager + name: non-admin-controller namespace: system labels: - control-plane: non-admin-controller-manager + control-plane: non-admin-controller app.kubernetes.io/name: deployment - app.kubernetes.io/instance: non-admin-controller-manager + app.kubernetes.io/instance: non-admin-controller app.kubernetes.io/component: manager app.kubernetes.io/created-by: oadp-operator app.kubernetes.io/part-of: oadp-operator @@ -27,14 +27,14 @@ metadata: spec: selector: matchLabels: - control-plane: non-admin-controller-manager + control-plane: non-admin-controller replicas: 1 template: metadata: annotations: kubectl.kubernetes.io/default-container: manager labels: - control-plane: non-admin-controller-manager + control-plane: non-admin-controller spec: # TODO(user): Uncomment the following code to configure the nodeAffinity expression # according to the platforms which are supported by your solution. @@ -71,7 +71,7 @@ spec: args: - --leader-elect image: controller:latest - name: non-admin-manager + name: non-admin-controller securityContext: allowPrivilegeEscalation: false capabilities: @@ -98,5 +98,5 @@ spec: requests: cpu: 10m memory: 64Mi - serviceAccountName: non-admin-controller-manager + serviceAccountName: non-admin-controller terminationGracePeriodSeconds: 10 diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index aec99bc..3b3efad 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: non-admin-manager-role + name: non-admin-controller-role rules: - apiGroups: - nac.oadp.openshift.io diff --git a/config/rbac/role_binding.yaml b/config/rbac/role_binding.yaml index 1dc04a0..42f638a 100644 --- a/config/rbac/role_binding.yaml +++ b/config/rbac/role_binding.yaml @@ -3,17 +3,17 @@ kind: ClusterRoleBinding metadata: labels: app.kubernetes.io/name: clusterrolebinding - app.kubernetes.io/instance: non-admin-manager-rolebinding + app.kubernetes.io/instance: non-admin-controller-rolebinding app.kubernetes.io/component: rbac app.kubernetes.io/created-by: oadp-operator app.kubernetes.io/part-of: oadp-operator app.kubernetes.io/managed-by: kustomize - name: non-admin-manager-rolebinding + name: non-admin-controller-rolebinding roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: non-admin-manager-role + name: non-admin-controller-role subjects: - kind: ServiceAccount - name: non-admin-controller-manager + name: non-admin-controller namespace: system diff --git a/config/rbac/service_account.yaml b/config/rbac/service_account.yaml index b6da67d..09e0b66 100644 --- a/config/rbac/service_account.yaml +++ b/config/rbac/service_account.yaml @@ -3,10 +3,10 @@ kind: ServiceAccount metadata: labels: app.kubernetes.io/name: serviceaccount - app.kubernetes.io/instance: non-admin-controller-manager-sa + app.kubernetes.io/instance: non-admin-controller-sa app.kubernetes.io/component: rbac app.kubernetes.io/created-by: oadp-operator app.kubernetes.io/part-of: oadp-operator app.kubernetes.io/managed-by: kustomize - name: non-admin-controller-manager + name: non-admin-controller namespace: system diff --git a/docs/architecture.md b/docs/architecture.md index 29bc155..c549f1a 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -2,7 +2,7 @@ ## OADP integration -Normally, to ship a controller to users, the project would present the file created by `make build-installer` command (which include various Kubernetes objects, like Namespace, ServiceAccount, Deployment, etc), to user to install the controller. But since NAC needs OADP operator to properly work, those Kubernetes objects are shipped within OADP operator (and also Kubernetes objects in `config/samples/` folder). Because of this restriction, generated Kubernetes objects names and labels in `config/` folder, may need to be updated to match OADP operator standards (and avoid duplications, by adding `non-admin-` prefix to Kubernetes object names). +Normally, to ship a controller to users, the project would present the file created by `make build-installer` command (which include various Kubernetes objects, like Namespace, ServiceAccount, Deployment, etc), to user to install the controller. But since NAC needs OADP operator to properly work, those Kubernetes objects are shipped within OADP operator (and also Kubernetes objects in `config/samples/` folder). Because of this restriction, generated Kubernetes objects names and labels in `config/` folder, may need to be updated to match OADP operator standards (for example, `oadp-nac` values are changed to `oadp-operator`) and avoid duplications, by changing Kubernetes object names to `non-admin-controller`, or adding it as a prefix. > **NOTE:** If needed, you can test NAC alone by running `make build-installer` and `oc apply -f ./dist/install.yaml`. You may want to customize namespace (`openshift-adp-system`) and container image (`quay.io/konveyor/oadp-non-admin:latest`) in that file prior to deploying it to your cluster.