diff --git a/bundle/manifests/susql-operator-controller-manager-metrics-monitor_monitoring.coreos.com_v1_servicemonitor.yaml b/bundle/manifests/susql-operator-susql-controller-manager-metrics-monitor_monitoring.coreos.com_v1_servicemonitor.yaml similarity index 61% rename from bundle/manifests/susql-operator-controller-manager-metrics-monitor_monitoring.coreos.com_v1_servicemonitor.yaml rename to bundle/manifests/susql-operator-susql-controller-manager-metrics-monitor_monitoring.coreos.com_v1_servicemonitor.yaml index 860cf58..7e18273 100644 --- a/bundle/manifests/susql-operator-controller-manager-metrics-monitor_monitoring.coreos.com_v1_servicemonitor.yaml +++ b/bundle/manifests/susql-operator-susql-controller-manager-metrics-monitor_monitoring.coreos.com_v1_servicemonitor.yaml @@ -4,15 +4,15 @@ metadata: labels: app.kubernetes.io/component: metrics app.kubernetes.io/created-by: susql-operator - app.kubernetes.io/instance: controller-manager-metrics-monitor + app.kubernetes.io/instance: susql-controller-manager-metrics-monitor app.kubernetes.io/managed-by: kustomize app.kubernetes.io/name: servicemonitor app.kubernetes.io/part-of: susql-operator - name: susql-operator-controller-manager-metrics-monitor + control-plane: susql-controller-manager + name: susql-operator-susql-controller-manager-metrics-monitor spec: endpoints: - port: metrics selector: matchLabels: - app.kubernetes.io/name: service - app.kubernetes.io/part-of: susql-operator + control-plane: susql-controller-manager diff --git a/bundle/manifests/susql-operator-controller-manager-metrics-service_v1_service.yaml b/bundle/manifests/susql-operator-susql-controller-manager-metrics-service_v1_service.yaml similarity index 65% rename from bundle/manifests/susql-operator-controller-manager-metrics-service_v1_service.yaml rename to bundle/manifests/susql-operator-susql-controller-manager-metrics-service_v1_service.yaml index 193a5fb..67c24f8 100644 --- a/bundle/manifests/susql-operator-controller-manager-metrics-service_v1_service.yaml +++ b/bundle/manifests/susql-operator-susql-controller-manager-metrics-service_v1_service.yaml @@ -5,11 +5,12 @@ metadata: labels: app.kubernetes.io/component: kube-rbac-proxy app.kubernetes.io/created-by: susql-operator - app.kubernetes.io/instance: controller-manager-metrics-service + app.kubernetes.io/instance: susql-controller-manager-metrics-service app.kubernetes.io/managed-by: kustomize app.kubernetes.io/name: service app.kubernetes.io/part-of: susql-operator - name: susql-operator-controller-manager-metrics-service + control-plane: susql-controller-manager + name: susql-operator-susql-controller-manager-metrics-service spec: ports: - name: metrics @@ -17,7 +18,6 @@ spec: protocol: TCP targetPort: metrics selector: - app.kubernetes.io/component: manager - app.kubernetes.io/instance: controller-manager + control-plane: susql-controller-manager status: loadBalancer: {} diff --git a/bundle/manifests/susql-operator.clusterserviceversion.yaml b/bundle/manifests/susql-operator.clusterserviceversion.yaml index 40d22cf..f0c9fa8 100644 --- a/bundle/manifests/susql-operator.clusterserviceversion.yaml +++ b/bundle/manifests/susql-operator.clusterserviceversion.yaml @@ -23,7 +23,7 @@ metadata: capabilities: Basic Install categories: Monitoring containerImage: quay.io/sustainable_computing_io/susql_operator:0.0.15 - createdAt: "2024-05-14T16:24:18Z" + createdAt: "2024-05-21T14:53:53Z" description: 'Aggregates energy data from pods tagged with SusQL labels ' operators.operatorframework.io/builder: operator-sdk-v1.34.1 operators.operatorframework.io/project_layout: go.kubebuilder.io/v4 @@ -147,30 +147,28 @@ spec: - get - list - watch - serviceAccountName: susql-operator-controller-manager + serviceAccountName: susql-operator-susql-controller-manager deployments: - label: app.kubernetes.io/component: manager - app.kubernetes.io/instance: controller-manager + app.kubernetes.io/created-by: susql-operator + app.kubernetes.io/instance: susql-controller-manager + app.kubernetes.io/managed-by: kustomize app.kubernetes.io/name: deployment app.kubernetes.io/part-of: susql-operator - name: susql-operator-controller + name: susql-operator-susql-controller-manager spec: replicas: 1 selector: matchLabels: - app.kubernetes.io/component: manager - app.kubernetes.io/instance: controller-manager - app.kubernetes.io/part-of: susql-operator + control-plane: susql-controller-manager strategy: {} template: metadata: annotations: kubectl.kubernetes.io/default-container: manager labels: - app.kubernetes.io/component: manager - app.kubernetes.io/instance: controller-manager - app.kubernetes.io/part-of: susql-operator + control-plane: susql-controller-manager spec: affinity: nodeAffinity: @@ -244,7 +242,7 @@ spec: - ALL securityContext: runAsNonRoot: true - serviceAccountName: susql-operator-controller-manager + serviceAccountName: susql-operator-susql-controller-manager terminationGracePeriodSeconds: 10 permissions: - rules: @@ -279,7 +277,7 @@ spec: verbs: - create - patch - serviceAccountName: susql-operator-controller-manager + serviceAccountName: susql-operator-susql-controller-manager strategy: deployment installModes: - supported: true diff --git a/config/default/manager_auth_proxy_patch.yaml b/config/default/manager_auth_proxy_patch.yaml index da9c1ce..dcfd05f 100644 --- a/config/default/manager_auth_proxy_patch.yaml +++ b/config/default/manager_auth_proxy_patch.yaml @@ -3,11 +3,27 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: controller-manager + name: susql-controller-manager namespace: system spec: template: spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/arch + operator: In + values: + - amd64 + - arm64 + - ppc64le + - s390x + - key: kubernetes.io/os + operator: In + values: + - linux containers: - name: kube-rbac-proxy securityContext: diff --git a/config/default/manager_config_patch.yaml b/config/default/manager_config_patch.yaml index f6f5891..ff124ea 100644 --- a/config/default/manager_config_patch.yaml +++ b/config/default/manager_config_patch.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: controller-manager + name: susql-controller-manager namespace: system spec: template: diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index fcb12fc..4301f37 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: Namespace metadata: labels: + control-plane: susql-controller-manager app.kubernetes.io/name: namespace app.kubernetes.io/instance: system app.kubernetes.io/component: manager @@ -13,28 +14,26 @@ metadata: apiVersion: apps/v1 kind: Deployment metadata: - name: controller + name: susql-controller-manager namespace: system labels: app.kubernetes.io/name: deployment - app.kubernetes.io/instance: controller-manager + app.kubernetes.io/instance: susql-controller-manager app.kubernetes.io/component: manager app.kubernetes.io/part-of: susql-operator + app.kubernetes.io/created-by: susql-operator + app.kubernetes.io/managed-by: kustomize spec: selector: matchLabels: - app.kubernetes.io/instance: controller-manager - app.kubernetes.io/component: manager - app.kubernetes.io/part-of: susql-operator + control-plane: susql-controller-manager replicas: 1 template: metadata: annotations: kubectl.kubernetes.io/default-container: manager labels: - app.kubernetes.io/instance: controller-manager - app.kubernetes.io/component: manager - app.kubernetes.io/part-of: susql-operator + control-plane: susql-controller-manager spec: # TODO(user): Uncomment the following code to configure the nodeAffinity expression # according to the platforms which are supported by your solution. @@ -123,5 +122,5 @@ spec: - containerPort: 8082 protocol: TCP name: metrics - serviceAccountName: controller-manager + serviceAccountName: susql-controller-manager terminationGracePeriodSeconds: 10 diff --git a/config/manifests/bases/susql-operator.clusterserviceversion.yaml b/config/manifests/bases/susql-operator.clusterserviceversion.yaml index c587461..07c8ca6 100644 --- a/config/manifests/bases/susql-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/susql-operator.clusterserviceversion.yaml @@ -78,158 +78,8 @@ spec: mediatype: image/png install: spec: - deployments: - - label: - app.kubernetes.io/component: manager - app.kubernetes.io/instance: controller-manager - app.kubernetes.io/name: deployment - app.kubernetes.io/part-of: susql-operator - name: susql-operator-controller - spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/component: manager - app.kubernetes.io/instance: controller-manager - app.kubernetes.io/part-of: susql-operator - strategy: {} - template: - metadata: - annotations: - kubectl.kubernetes.io/default-container: manager - labels: - app.kubernetes.io/component: manager - app.kubernetes.io/instance: controller-manager - app.kubernetes.io/part-of: susql-operator - spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/arch - operator: In - values: - - amd64 - - arm64 - - ppc64le - - s390x - - key: kubernetes.io/os - operator: In - values: - - linux - containers: - - args: - - --secure-listen-address=0.0.0.0:8443 - - --upstream=http://127.0.0.1:8082/ - - --logtostderr=true - - --v=0 - image: gcr.io/kubebuilder/kube-rbac-proxy:v0.14.1 - name: kube-rbac-proxy - ports: - - containerPort: 8443 - name: https - protocol: TCP - resources: - limits: - cpu: 500m - memory: 128Mi - requests: - cpu: 5m - memory: 64Mi - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL - - args: - - --leader-elect - - --kepler-prometheus-url=$(KEPLER-PROMETHEUS-URL) - - --kepler-metric-name=$(KEPLER-METRIC-NAME) - - --susql-prometheus-database-url=$(SUSQL-PROMETHEUS-DATABASE-URL) - - --susql-prometheus-metrics-url=$(SUSQL-PROMETHEUS-METRICS-URL) - - --sampling-rate=$(SAMPLING-RATE) - - --health-probe-bind-address=:8081 - - --metrics-bind-address=127.0.0.1:8082 - command: - - /manager - env: - - name: KEPLER-PROMETHEUS-URL - value: https://thanos-querier.openshift-monitoring.svc.cluster.local:9091 - - name: KEPLER-METRIC-NAME - value: kepler_container_joules_total - - name: SUSQL-PROMETHEUS-DATABASE-URL - value: https://thanos-querier.openshift-monitoring.svc.cluster.local:9091 - - name: SUSQL-PROMETHEUS-METRICS-URL - value: http://0.0.0.0:8082 - - name: SAMPLING-RATE - value: "2" - image: - imagePullPolicy: Always - livenessProbe: - httpGet: - path: /healthz - port: 8081 - initialDelaySeconds: 15 - periodSeconds: 20 - name: manager - readinessProbe: - httpGet: - path: /readyz - port: 8081 - initialDelaySeconds: 5 - periodSeconds: 10 - resources: - limits: - cpu: 500m - memory: 128Mi - requests: - cpu: 10m - memory: 64Mi - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL - securityContext: - runAsNonRoot: true - serviceAccountName: susql-operator-controller-manager - terminationGracePeriodSeconds: 10 - permissions: - - rules: - - apiGroups: - - "" - resources: - - configmaps - verbs: - - get - - list - - watch - - create - - update - - patch - - delete - - apiGroups: - - coordination.k8s.io - resources: - - leases - verbs: - - get - - list - - watch - - create - - update - - patch - - delete - - apiGroups: - - "" - resources: - - events - verbs: - - create - - patch - serviceAccountName: susql-operator-controller-manager - strategy: deployment + deployments: null + strategy: "" installModes: - supported: true type: OwnNamespace diff --git a/config/manifests/kustomization.yaml b/config/manifests/kustomization.yaml index 5c3f1bc..82fe12c 100644 --- a/config/manifests/kustomization.yaml +++ b/config/manifests/kustomization.yaml @@ -9,19 +9,19 @@ resources: # [WEBHOOK] To enable webhooks, uncomment all the sections with [WEBHOOK] prefix. # Do NOT uncomment sections with prefix [CERTMANAGER], as OLM does not support cert-manager. # These patches remove the unnecessary "cert" volume and its manager container volumeMount. -patchesJson6902: -- target: - group: apps - version: v1 - kind: Deployment - name: controller-manager - namespace: system - patch: |- - # Remove the manager container's "cert" volumeMount, since OLM will create and mount a set of certs. - # Update the indices in this path if adding or removing containers/volumeMounts in the manager's Deployment. - - op: remove - path: /spec/template/spec/containers/0/volumeMounts/0 - # Remove the "cert" volume, since OLM will create and mount a set of certs. - # Update the indices in this path if adding or removing volumes in the manager's Deployment. - - op: remove - path: /spec/template/spec/volumes/0 +# patchesJson6902: +# - target: +# group: apps +# version: v1 +# kind: Deployment +# name: susql-controller-manager +# namespace: system +# patch: |- +# # Remove the manager container's "cert" volumeMount, since OLM will create and mount a set of certs. +# # Update the indices in this path if adding or removing containers/volumeMounts in the manager's Deployment. +# - op: remove +# path: /spec/template/spec/containers/0/volumeMounts/0 +# # Remove the "cert" volume, since OLM will create and mount a set of certs. +# # Update the indices in this path if adding or removing volumes in the manager's Deployment. +# - op: remove +# path: /spec/template/spec/volumes/0 diff --git a/config/prometheus/monitor.yaml b/config/prometheus/monitor.yaml index 2aac024..3999758 100644 --- a/config/prometheus/monitor.yaml +++ b/config/prometheus/monitor.yaml @@ -4,18 +4,18 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: labels: + control-plane: susql-controller-manager app.kubernetes.io/name: servicemonitor - app.kubernetes.io/instance: controller-manager-metrics-monitor + app.kubernetes.io/instance: susql-controller-manager-metrics-monitor app.kubernetes.io/component: metrics app.kubernetes.io/created-by: susql-operator app.kubernetes.io/part-of: susql-operator app.kubernetes.io/managed-by: kustomize - name: controller-manager-metrics-monitor + name: susql-controller-manager-metrics-monitor namespace: system spec: endpoints: - port: metrics selector: matchLabels: - app.kubernetes.io/name: service - app.kubernetes.io/part-of: susql-operator + control-plane: susql-controller-manager diff --git a/config/rbac/auth_proxy_role_binding.yaml b/config/rbac/auth_proxy_role_binding.yaml index e808752..b9342f4 100644 --- a/config/rbac/auth_proxy_role_binding.yaml +++ b/config/rbac/auth_proxy_role_binding.yaml @@ -15,5 +15,5 @@ roleRef: name: proxy-role subjects: - kind: ServiceAccount - name: controller-manager + name: susql-controller-manager namespace: system diff --git a/config/rbac/auth_proxy_service.yaml b/config/rbac/auth_proxy_service.yaml index c51ab58..0f0a746 100644 --- a/config/rbac/auth_proxy_service.yaml +++ b/config/rbac/auth_proxy_service.yaml @@ -2,13 +2,14 @@ apiVersion: v1 kind: Service metadata: labels: + control-plane: susql-controller-manager app.kubernetes.io/name: service - app.kubernetes.io/instance: controller-manager-metrics-service + app.kubernetes.io/instance: susql-controller-manager-metrics-service app.kubernetes.io/component: kube-rbac-proxy app.kubernetes.io/created-by: susql-operator app.kubernetes.io/part-of: susql-operator app.kubernetes.io/managed-by: kustomize - name: controller-manager-metrics-service + name: susql-controller-manager-metrics-service namespace: system spec: ports: @@ -17,5 +18,4 @@ spec: protocol: TCP targetPort: metrics selector: - app.kubernetes.io/instance: controller-manager - app.kubernetes.io/component: manager + control-plane: susql-controller-manager diff --git a/config/rbac/leader_election_role_binding.yaml b/config/rbac/leader_election_role_binding.yaml index 07f3abc..0226e86 100644 --- a/config/rbac/leader_election_role_binding.yaml +++ b/config/rbac/leader_election_role_binding.yaml @@ -15,5 +15,5 @@ roleRef: name: leader-election-role subjects: - kind: ServiceAccount - name: controller-manager + name: susql-controller-manager namespace: system diff --git a/config/rbac/role_binding.yaml b/config/rbac/role_binding.yaml index f49d023..9d83e96 100644 --- a/config/rbac/role_binding.yaml +++ b/config/rbac/role_binding.yaml @@ -15,5 +15,5 @@ roleRef: name: manager-role subjects: - kind: ServiceAccount - name: controller-manager + name: susql-controller-manager namespace: system diff --git a/config/rbac/service_account.yaml b/config/rbac/service_account.yaml index 69e2830..9506110 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: controller-manager + app.kubernetes.io/instance: susql-controller-manager-sa app.kubernetes.io/component: rbac app.kubernetes.io/created-by: susql-operator app.kubernetes.io/part-of: susql-operator app.kubernetes.io/managed-by: kustomize - name: controller-manager + name: susql-controller-manager namespace: system