You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by as...@apache.org on 2021/04/15 11:54:12 UTC
[camel-k] 04/05: chore(rbac): RBAC for PodMonitor instead of
ServiceMonitor
This is an automated email from the ASF dual-hosted git repository.
astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit fdccc12ab58f2a78b73b69bcc78f663ca34c8787
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Wed Apr 14 10:35:38 2021 +0200
chore(rbac): RBAC for PodMonitor instead of ServiceMonitor
---
config/rbac/kustomization.yaml | 4 ++--
...icemonitors.yaml => operator-role-binding-podmonitors.yaml} | 4 ++--
...ole-servicemonitors.yaml => operator-role-podmonitors.yaml} | 4 ++--
.../camel-k.v1.4.0-snapshot.clusterserviceversion.yaml | 10 +++++-----
helm/camel-k/templates/operator-role.yaml | 2 +-
pkg/install/operator.go | 10 +++++-----
6 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/config/rbac/kustomization.yaml b/config/rbac/kustomization.yaml
index b776c2b..861e8cc 100644
--- a/config/rbac/kustomization.yaml
+++ b/config/rbac/kustomization.yaml
@@ -22,14 +22,14 @@ resources:
- operator-role-leases.yaml
- operator-role-openshift.yaml
- operator-role-service-binding.yaml
-- operator-role-servicemonitors.yaml
+- operator-role-podmonitors.yaml
- operator-role-strimzi.yaml
- operator-role-binding-events.yaml
- operator-role-binding-knative.yaml
- operator-role-binding-leases.yaml
- operator-role-binding-openshift.yaml
- operator-role-binding-service-binding.yaml
-- operator-role-binding-servicemonitors.yaml
+- operator-role-binding-podmonitors.yaml
- operator-role-binding-strimzi.yaml
- operator-role-binding.yaml
- operator-cluster-role-openshift.yaml
diff --git a/config/rbac/operator-role-binding-servicemonitors.yaml b/config/rbac/operator-role-binding-podmonitors.yaml
similarity index 93%
rename from config/rbac/operator-role-binding-servicemonitors.yaml
rename to config/rbac/operator-role-binding-podmonitors.yaml
index 120e83e..26b6d9c 100644
--- a/config/rbac/operator-role-binding-servicemonitors.yaml
+++ b/config/rbac/operator-role-binding-podmonitors.yaml
@@ -18,7 +18,7 @@
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
- name: camel-k-operator-servicemonitors
+ name: camel-k-operator-podmonitors
labels:
app: "camel-k"
subjects:
@@ -26,5 +26,5 @@ subjects:
name: camel-k-operator
roleRef:
kind: Role
- name: camel-k-operator-servicemonitors
+ name: camel-k-operator-podmonitors
apiGroup: rbac.authorization.k8s.io
diff --git a/config/rbac/operator-role-servicemonitors.yaml b/config/rbac/operator-role-podmonitors.yaml
similarity index 95%
rename from config/rbac/operator-role-servicemonitors.yaml
rename to config/rbac/operator-role-podmonitors.yaml
index 98b2061..7a3fe05 100644
--- a/config/rbac/operator-role-servicemonitors.yaml
+++ b/config/rbac/operator-role-podmonitors.yaml
@@ -18,14 +18,14 @@
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
- name: camel-k-operator-servicemonitors
+ name: camel-k-operator-podmonitors
labels:
app: "camel-k"
rules:
- apiGroups:
- monitoring.coreos.com
resources:
- - servicemonitors
+ - podmonitors
verbs:
- create
- delete
diff --git a/deploy/olm-catalog/camel-k-dev/1.4.0-snapshot/camel-k.v1.4.0-snapshot.clusterserviceversion.yaml b/deploy/olm-catalog/camel-k-dev/1.4.0-snapshot/camel-k.v1.4.0-snapshot.clusterserviceversion.yaml
index d6b26d4..c0e0486 100644
--- a/deploy/olm-catalog/camel-k-dev/1.4.0-snapshot/camel-k.v1.4.0-snapshot.clusterserviceversion.yaml
+++ b/deploy/olm-catalog/camel-k-dev/1.4.0-snapshot/camel-k.v1.4.0-snapshot.clusterserviceversion.yaml
@@ -163,7 +163,7 @@ metadata:
categories: Integration & Delivery
certified: "false"
containerImage: docker.io/apache/camel-k:1.3.0-SNAPSHOT
- createdAt: "2021-04-07T08:20:51Z"
+ createdAt: "2021-04-14T08:35:55Z"
description: Apache Camel K is a lightweight integration platform, born on Kubernetes, with serverless superpowers.
operators.operatorframework.io/builder: operator-sdk-v1.3.0
operators.operatorframework.io/internal-objects: '["builds.camel.apache.org","integrationkits.camel.apache.org","camelcatalogs.camel.apache.org"]'
@@ -546,9 +546,9 @@ spec:
verbs:
- create
- apiGroups:
- - binding.operators.coreos.com
+ - monitoring.coreos.com
resources:
- - servicebindings
+ - podmonitors
verbs:
- create
- delete
@@ -559,9 +559,9 @@ spec:
- update
- watch
- apiGroups:
- - monitoring.coreos.com
+ - binding.operators.coreos.com
resources:
- - servicemonitors
+ - servicebindings
verbs:
- create
- delete
diff --git a/helm/camel-k/templates/operator-role.yaml b/helm/camel-k/templates/operator-role.yaml
index 80db2a1..fda8c95 100644
--- a/helm/camel-k/templates/operator-role.yaml
+++ b/helm/camel-k/templates/operator-role.yaml
@@ -238,7 +238,7 @@ rules:
- apiGroups:
- monitoring.coreos.com
resources:
- - servicemonitors
+ - podmonitors
verbs:
- create
- delete
diff --git a/pkg/install/operator.go b/pkg/install/operator.go
index f8487b4..54dc2df 100644
--- a/pkg/install/operator.go
+++ b/pkg/install/operator.go
@@ -235,11 +235,11 @@ func OperatorOrCollect(ctx context.Context, c client.Client, cfg OperatorConfigu
fmt.Println("Warning: the operator will not be able to publish Kubernetes events. Try installing as cluster-admin to allow it to generate events.")
}
- if errmtr := installServiceMonitors(ctx, c, cfg.Namespace, customizer, collection, force); errmtr != nil {
+ if errmtr := installPodMonitors(ctx, c, cfg.Namespace, customizer, collection, force); errmtr != nil {
if k8serrors.IsAlreadyExists(errmtr) {
return errmtr
}
- fmt.Println("Warning: the operator will not be able to create servicemonitors for metrics. Try installing as cluster-admin to allow the creation of servicemonitors.")
+ fmt.Println("Warning: the operator will not be able to create PodMonitor resources. Try installing as cluster-admin.")
}
if errmtr := installStrimziBindings(ctx, c, cfg.Namespace, customizer, collection, force); errmtr != nil {
@@ -373,10 +373,10 @@ func installEvents(ctx context.Context, c client.Client, namespace string, custo
)
}
-func installServiceMonitors(ctx context.Context, c client.Client, namespace string, customizer ResourceCustomizer, collection *kubernetes.Collection, force bool) error {
+func installPodMonitors(ctx context.Context, c client.Client, namespace string, customizer ResourceCustomizer, collection *kubernetes.Collection, force bool) error {
return ResourcesOrCollect(ctx, c, namespace, collection, force, customizer,
- "/rbac/operator-role-servicemonitors.yaml",
- "/rbac/operator-role-binding-servicemonitors.yaml",
+ "/rbac/operator-role-podmonitors.yaml",
+ "/rbac/operator-role-binding-podmonitors.yaml",
)
}