diff --git a/Makefile b/Makefile index 8997213e6d6..12478fd96af 100644 --- a/Makefile +++ b/Makefile @@ -140,7 +140,7 @@ endef .PHONY: manifests manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects. - $(CONTROLLER_GEN) rbac:roleName=controller-manager-role crd:ignoreUnexportedFields=true webhook paths="./..." output:crd:artifacts:config=config/crd/bases + $(CONTROLLER_GEN) rbac:roleName=rhods-operator-role crd:ignoreUnexportedFields=true webhook paths="./..." output:crd:artifacts:config=config/crd/bases $(call fetch-external-crds,github.com/openshift/api,route/v1) $(call fetch-external-crds,github.com/openshift/api,user/v1) @@ -287,8 +287,7 @@ bundle: prepare operator-sdk ## Generate bundle manifests and metadata, then val $(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS) $(OPERATOR_SDK) bundle validate ./$(BUNDLE_DIR) mv bundle.Dockerfile Dockerfiles/ - rm -f bundle/manifests/redhat-ods-operator-webhook-service_v1_service.yaml - + rm -f bundle/manifests/webhook-service_v1_service.yaml bundle/manifests/controller-manager-metrics-service_v1_service.yaml .PHONY: bundle-build bundle-build: bundle $(IMAGE_BUILDER) build --no-cache -f Dockerfiles/bundle.Dockerfile -t $(BUNDLE_IMG) . diff --git a/bundle/manifests/redhat-ods-operator-controller-manager-metrics-service_v1_service.yaml b/bundle/manifests/redhat-ods-operator-controller-manager-metrics-service_v1_service.yaml deleted file mode 100644 index 839053d8167..00000000000 --- a/bundle/manifests/redhat-ods-operator-controller-manager-metrics-service_v1_service.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - creationTimestamp: null - labels: - name: rhods-operator - name: redhat-ods-operator-controller-manager-metrics-service -spec: - ports: - - name: http - port: 8443 - protocol: TCP - targetPort: http - selector: - name: rhods-operator -status: - loadBalancer: {} diff --git a/bundle/manifests/rhods-operator.clusterserviceversion.yaml b/bundle/manifests/rhods-operator.clusterserviceversion.yaml index 842116a302a..8ffd536b8aa 100644 --- a/bundle/manifests/rhods-operator.clusterserviceversion.yaml +++ b/bundle/manifests/rhods-operator.clusterserviceversion.yaml @@ -103,7 +103,7 @@ metadata: categories: AI/Machine Learning, Big Data certified: "False" containerImage: REPLACE_IMAGE:latest - createdAt: "2024-10-28T09:05:34Z" + createdAt: "2024-11-01T16:20:53Z" description: Operator for deployment and management of Red Hat OpenShift AI features.operators.openshift.io/disconnected: "true" features.operators.openshift.io/fips-compliant: "false" @@ -1137,20 +1137,20 @@ spec: serviceAccountName: redhat-ods-operator-controller-manager deployments: - label: - control-plane: controller-manager - name: redhat-ods-operator-controller-manager + name: rhods-operator + name: rhods-operator spec: replicas: 1 selector: matchLabels: - control-plane: controller-manager + name: rhods-operator strategy: {} template: metadata: annotations: - kubectl.kubernetes.io/default-container: manager + kubectl.kubernetes.io/default-container: rhods-operator labels: - control-plane: controller-manager + name: rhods-operator spec: containers: - args: @@ -1162,13 +1162,15 @@ spec: env: - name: DISABLE_DSC_CONFIG value: "false" + - name: OPERATOR_NAME + value: rhods-operator - name: OPERATOR_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace - name: DEFAULT_MANIFESTS_PATH value: /opt/manifests - image: quay.io/wenzhou/rhods-operator:2.16.0 + image: REPLACE_IMAGE:latest imagePullPolicy: Always livenessProbe: httpGet: @@ -1176,11 +1178,14 @@ spec: port: 8081 initialDelaySeconds: 15 periodSeconds: 20 - name: manager + name: rhods-operator ports: - containerPort: 9443 name: webhook-server protocol: TCP + - containerPort: 8080 + name: http + protocol: TCP readinessProbe: httpGet: path: /readyz @@ -1263,7 +1268,7 @@ spec: - admissionReviewVersions: - v1 containerPort: 443 - deploymentName: redhat-ods-operator-controller-manager + deploymentName: rhods-operator failurePolicy: Fail generateName: mutate.operator.opendatahub.io rules: @@ -1283,7 +1288,7 @@ spec: - admissionReviewVersions: - v1 containerPort: 443 - deploymentName: redhat-ods-operator-controller-manager + deploymentName: rhods-operator failurePolicy: Fail generateName: operator.opendatahub.io rules: diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index 1a7fe00e8c9..e128c98fba1 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -9,7 +9,7 @@ namespace: redhat-ods-operator # "wordpress" becomes "alices-wordpress". # Note that it should also match with the prefix (text before '-') of the namespace # field above. -namePrefix: redhat-ods-operator- +#namePrefix: redhat-ods-operator- # Labels to add to all resources and selectors. #labels: diff --git a/config/default/manager_auth_proxy_patch.yaml b/config/default/manager_auth_proxy_patch.yaml index 348b4430479..057055c6cd5 100644 --- a/config/default/manager_auth_proxy_patch.yaml +++ b/config/default/manager_auth_proxy_patch.yaml @@ -3,13 +3,13 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: controller-manager + name: rhods-operator namespace: system spec: template: spec: containers: - - name: manager + - name: rhods-operator args: - "--health-probe-bind-address=:8081" - "--metrics-bind-address=0.0.0.0:8080" diff --git a/config/default/manager_webhook_patch.yaml b/config/default/manager_webhook_patch.yaml index d76a0133d0d..04bf1b0c610 100644 --- a/config/default/manager_webhook_patch.yaml +++ b/config/default/manager_webhook_patch.yaml @@ -1,17 +1,20 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: controller-manager + name: rhods-operator namespace: system spec: template: spec: containers: - - name: manager + - name: rhods-operator ports: - containerPort: 9443 name: webhook-server protocol: TCP + - containerPort: 8080 + name: http + protocol: TCP volumeMounts: - mountPath: /tmp/k8s-webhook-server/serving-certs name: cert diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 6b91eefe175..c35b7f3daff 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -8,21 +8,21 @@ metadata: apiVersion: apps/v1 kind: Deployment metadata: - name: controller-manager + name: rhods-operator namespace: system labels: - control-plane: controller-manager + name: rhods-operator spec: selector: matchLabels: - control-plane: controller-manager + name: rhods-operator replicas: 1 template: metadata: annotations: - kubectl.kubernetes.io/default-container: manager + kubectl.kubernetes.io/default-container: rhods-operator labels: - control-plane: controller-manager + name: rhods-operator spec: securityContext: runAsNonRoot: true @@ -34,11 +34,14 @@ spec: # seccompProfile: # type: RuntimeDefault containers: - - command: + - name: rhods-operator + command: - /manager env: - name: DISABLE_DSC_CONFIG value: 'false' + - name: OPERATOR_NAME + value: rhods-operator - name: OPERATOR_NAMESPACE valueFrom: fieldRef: @@ -49,7 +52,6 @@ spec: # value: SelfManagedRHOAI image: controller:latest imagePullPolicy: Always - name: manager securityContext: allowPrivilegeEscalation: false capabilities: @@ -76,5 +78,5 @@ spec: requests: cpu: 500m memory: 256Mi - serviceAccountName: controller-manager + serviceAccountName: redhat-ods-operator-controller-manager terminationGracePeriodSeconds: 10 diff --git a/config/rbac/auth_proxy_client_clusterrole.yaml b/config/rbac/auth_proxy_client_clusterrole.yaml index 51a75db47a5..5828f6e0b31 100644 --- a/config/rbac/auth_proxy_client_clusterrole.yaml +++ b/config/rbac/auth_proxy_client_clusterrole.yaml @@ -1,7 +1,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: metrics-reader + name: redhat-ods-operator-metrics-reader rules: - nonResourceURLs: - "/metrics" diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 45bb45d40ba..a27e6ebdc5c 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: controller-manager-role + name: rhods-operator-role rules: - apiGroups: - '*' diff --git a/config/rbac/role_binding.yaml b/config/rbac/role_binding.yaml index 886c3b37e9c..774f83b3d96 100644 --- a/config/rbac/role_binding.yaml +++ b/config/rbac/role_binding.yaml @@ -1,12 +1,14 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: controller-manager-rolebinding + # name: controller-manager-rolebinding + name: rhods-operator-rolebinding roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: controller-manager-role + # name: controller-manager-role + name: rhods-operator-role subjects: - kind: ServiceAccount - name: controller-manager + name: redhat-ods-operator-controller-manager namespace: system diff --git a/config/rbac/service_account.yaml b/config/rbac/service_account.yaml index 7cd6025bfc4..169933c32f3 100644 --- a/config/rbac/service_account.yaml +++ b/config/rbac/service_account.yaml @@ -1,5 +1,5 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: controller-manager + name: redhat-ods-operator-controller-manager namespace: system diff --git a/config/webhook/service.yaml b/config/webhook/service.yaml index 72c652ddaae..ad0b2266613 100644 --- a/config/webhook/service.yaml +++ b/config/webhook/service.yaml @@ -19,4 +19,4 @@ spec: protocol: TCP targetPort: 9443 selector: - control-plane: controller-manager + name: rhods-operator