From ce2fb582f087e92c2d147ad84d67396c58badfd3 Mon Sep 17 00:00:00 2001 From: Periklis Tsirakidis Date: Thu, 7 Nov 2024 13:52:15 +0100 Subject: [PATCH 1/2] fix(operator): Fix operator release pipeline warnings --- .../loki-operator.clusterserviceversion.yaml | 14 ++++++++++---- .../loki-operator.clusterserviceversion.yaml | 14 ++++++++++---- .../loki-operator.clusterserviceversion.yaml | 4 ++-- .../community-openshift/kustomization.yaml | 1 + .../manager_related_image_patch.yaml | 9 +++++++++ .../manager_resource_reqs_patch.yaml | 18 ++++++++++++++++++ .../overlays/community/kustomization.yaml | 1 + .../community/manager_auth_proxy_patch.yaml | 4 ++++ .../community/manager_resource_reqs_patch.yaml | 18 ++++++++++++++++++ operator/config/rbac/role.yaml | 2 +- .../controller/loki/lokistack_controller.go | 2 +- 11 files changed, 75 insertions(+), 12 deletions(-) create mode 100644 operator/config/overlays/community-openshift/manager_resource_reqs_patch.yaml create mode 100644 operator/config/overlays/community/manager_resource_reqs_patch.yaml diff --git a/operator/bundle/community-openshift/manifests/loki-operator.clusterserviceversion.yaml b/operator/bundle/community-openshift/manifests/loki-operator.clusterserviceversion.yaml index dd97ce3d025f..88e32263e6ea 100644 --- a/operator/bundle/community-openshift/manifests/loki-operator.clusterserviceversion.yaml +++ b/operator/bundle/community-openshift/manifests/loki-operator.clusterserviceversion.yaml @@ -150,7 +150,7 @@ metadata: categories: OpenShift Optional, Logging & Tracing certified: "false" containerImage: docker.io/grafana/loki-operator:0.7.0 - createdAt: "2024-11-07T09:40:12Z" + createdAt: "2024-11-07T12:42:51Z" description: The Community Loki Operator provides Kubernetes native deployment and management of Loki and related logging components. features.operators.openshift.io/disconnected: "true" @@ -1771,7 +1771,7 @@ spec: - update - watch - apiGroups: - - policy + - policy/v1 resources: - poddisruptionbudgets verbs: @@ -1880,7 +1880,10 @@ spec: port: 8081 initialDelaySeconds: 5 periodSeconds: 10 - resources: {} + resources: + requests: + cpu: 200m + memory: 256Mi securityContext: allowPrivilegeEscalation: false capabilities: @@ -1904,7 +1907,10 @@ spec: ports: - containerPort: 8443 name: https - resources: {} + resources: + requests: + cpu: 200m + memory: 256Mi securityContext: allowPrivilegeEscalation: false capabilities: diff --git a/operator/bundle/community/manifests/loki-operator.clusterserviceversion.yaml b/operator/bundle/community/manifests/loki-operator.clusterserviceversion.yaml index 45b2e873884f..0ef7737c58a7 100644 --- a/operator/bundle/community/manifests/loki-operator.clusterserviceversion.yaml +++ b/operator/bundle/community/manifests/loki-operator.clusterserviceversion.yaml @@ -150,7 +150,7 @@ metadata: categories: OpenShift Optional, Logging & Tracing certified: "false" containerImage: docker.io/grafana/loki-operator:0.7.0 - createdAt: "2024-11-07T09:40:10Z" + createdAt: "2024-11-07T12:42:49Z" description: The Community Loki Operator provides Kubernetes native deployment and management of Loki and related logging components. operators.operatorframework.io/builder: operator-sdk-unknown @@ -1751,7 +1751,7 @@ spec: - update - watch - apiGroups: - - policy + - policy/v1 resources: - poddisruptionbudgets verbs: @@ -1860,7 +1860,10 @@ spec: port: 8081 initialDelaySeconds: 5 periodSeconds: 10 - resources: {} + resources: + requests: + cpu: 200m + memory: 256Mi volumeMounts: - mountPath: /tmp/k8s-webhook-server/serving-certs name: webhook-cert @@ -1878,7 +1881,10 @@ spec: ports: - containerPort: 8443 name: https - resources: {} + resources: + requests: + cpu: 200m + memory: 256Mi securityContext: allowPrivilegeEscalation: false capabilities: diff --git a/operator/bundle/openshift/manifests/loki-operator.clusterserviceversion.yaml b/operator/bundle/openshift/manifests/loki-operator.clusterserviceversion.yaml index 81a8eb114a60..bccd4ce36976 100644 --- a/operator/bundle/openshift/manifests/loki-operator.clusterserviceversion.yaml +++ b/operator/bundle/openshift/manifests/loki-operator.clusterserviceversion.yaml @@ -150,7 +150,7 @@ metadata: categories: OpenShift Optional, Logging & Tracing certified: "false" containerImage: quay.io/openshift-logging/loki-operator:0.1.0 - createdAt: "2024-11-07T09:40:14Z" + createdAt: "2024-11-07T12:42:53Z" description: | The Loki Operator for OCP provides a means for configuring and managing a Loki stack for cluster logging. ## Prerequisites and Requirements @@ -1756,7 +1756,7 @@ spec: - update - watch - apiGroups: - - policy + - policy/v1 resources: - poddisruptionbudgets verbs: diff --git a/operator/config/overlays/community-openshift/kustomization.yaml b/operator/config/overlays/community-openshift/kustomization.yaml index a808ecf86f4a..b0450642985f 100644 --- a/operator/config/overlays/community-openshift/kustomization.yaml +++ b/operator/config/overlays/community-openshift/kustomization.yaml @@ -31,4 +31,5 @@ images: patches: - path: manager_related_image_patch.yaml +- path: manager_resource_reqs_patch.yaml - path: prometheus_service_monitor_patch.yaml diff --git a/operator/config/overlays/community-openshift/manager_related_image_patch.yaml b/operator/config/overlays/community-openshift/manager_related_image_patch.yaml index 126a4f29c9de..8a40bbc6c999 100644 --- a/operator/config/overlays/community-openshift/manager_related_image_patch.yaml +++ b/operator/config/overlays/community-openshift/manager_related_image_patch.yaml @@ -14,3 +14,12 @@ spec: value: quay.io/observatorium/api:latest - name: RELATED_IMAGE_OPA value: quay.io/observatorium/opa-openshift:latest + resources: + requests: + cpu: 200m + memory: 256Mi + - name: kube-rbac-proxy + resources: + requests: + cpu: 200m + memory: 256Mi diff --git a/operator/config/overlays/community-openshift/manager_resource_reqs_patch.yaml b/operator/config/overlays/community-openshift/manager_resource_reqs_patch.yaml new file mode 100644 index 000000000000..2e332cd3ece1 --- /dev/null +++ b/operator/config/overlays/community-openshift/manager_resource_reqs_patch.yaml @@ -0,0 +1,18 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: controller-manager +spec: + template: + spec: + containers: + - name: manager + resources: + requests: + cpu: 200m + memory: 256Mi + - name: kube-rbac-proxy + resources: + requests: + cpu: 200m + memory: 256Mi diff --git a/operator/config/overlays/community/kustomization.yaml b/operator/config/overlays/community/kustomization.yaml index 40a739349330..90349a18070c 100644 --- a/operator/config/overlays/community/kustomization.yaml +++ b/operator/config/overlays/community/kustomization.yaml @@ -47,6 +47,7 @@ images: patches: - path: manager_auth_proxy_patch.yaml - path: manager_related_image_patch.yaml +- path: manager_resource_reqs_patch.yaml - path: manager_run_flags_patch.yaml - path: manager_webhook_patch.yaml - path: webhookcainjection_patch.yaml diff --git a/operator/config/overlays/community/manager_auth_proxy_patch.yaml b/operator/config/overlays/community/manager_auth_proxy_patch.yaml index b03a16b47b1d..5e25eeb03c57 100644 --- a/operator/config/overlays/community/manager_auth_proxy_patch.yaml +++ b/operator/config/overlays/community/manager_auth_proxy_patch.yaml @@ -16,6 +16,10 @@ spec: ports: - containerPort: 8443 name: https + resources: + requests: + cpu: 200m + memory: 256Mi securityContext: allowPrivilegeEscalation: false capabilities: diff --git a/operator/config/overlays/community/manager_resource_reqs_patch.yaml b/operator/config/overlays/community/manager_resource_reqs_patch.yaml new file mode 100644 index 000000000000..2e332cd3ece1 --- /dev/null +++ b/operator/config/overlays/community/manager_resource_reqs_patch.yaml @@ -0,0 +1,18 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: controller-manager +spec: + template: + spec: + containers: + - name: manager + resources: + requests: + cpu: 200m + memory: 256Mi + - name: kube-rbac-proxy + resources: + requests: + cpu: 200m + memory: 256Mi diff --git a/operator/config/rbac/role.yaml b/operator/config/rbac/role.yaml index 59ca248171ae..136cf2e250ce 100644 --- a/operator/config/rbac/role.yaml +++ b/operator/config/rbac/role.yaml @@ -146,7 +146,7 @@ rules: - update - watch - apiGroups: - - policy + - policy/v1 resources: - poddisruptionbudgets verbs: diff --git a/operator/internal/controller/loki/lokistack_controller.go b/operator/internal/controller/loki/lokistack_controller.go index 5c7c376d3bd0..a9ccfba019e5 100644 --- a/operator/internal/controller/loki/lokistack_controller.go +++ b/operator/internal/controller/loki/lokistack_controller.go @@ -125,7 +125,7 @@ type LokiStackReconciler struct { // +kubebuilder:rbac:urls=/api/v2/alerts,verbs=create // +kubebuilder:rbac:groups=coordination.k8s.io,resources=leases,verbs=get;create;update // +kubebuilder:rbac:groups=networking.k8s.io,resources=ingresses,verbs=get;list;watch;create;update -// +kubebuilder:rbac:groups=policy,resources=poddisruptionbudgets,verbs=get;list;watch;create;update +// +kubebuilder:rbac:groups=policy/v1,resources=poddisruptionbudgets,verbs=get;list;watch;create;update // +kubebuilder:rbac:groups=config.openshift.io,resources=dnses;apiservers;proxies,verbs=get;list;watch // +kubebuilder:rbac:groups=route.openshift.io,resources=routes,verbs=get;list;watch;create;update;delete // +kubebuilder:rbac:groups=cloudcredential.openshift.io,resources=credentialsrequests,verbs=get;list;watch;create;update;delete From 5dbfa5ab03abaf0a849af385539e1eaed18ddf23 Mon Sep 17 00:00:00 2001 From: Periklis Tsirakidis Date: Thu, 7 Nov 2024 15:19:23 +0100 Subject: [PATCH 2/2] Upgrade docs --- operator/docs/operator/compatibility.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operator/docs/operator/compatibility.md b/operator/docs/operator/compatibility.md index 04e26b50de67..0a76f40d13e6 100644 --- a/operator/docs/operator/compatibility.md +++ b/operator/docs/operator/compatibility.md @@ -21,7 +21,7 @@ The Loki Operator uses client-go to communicate with Kubernetes clusters. The su Due to the use of CustomResourceDefinitions Kubernetes >= v1.7.0 is required. -Due to the use of apiextensions.k8s.io/v1 CustomResourceDefinitions, requires Kubernetes >= v1.16.0. +Due to the use of apiextensions.k8s.io/v1 CustomResourceDefinitions, requires Kubernetes >= v1.21.0. ## Loki