Skip to content

Commit 750dbbc

Browse files
authored
Fix metrics and prometheus tests (#816)
1 parent 8f1a68d commit 750dbbc

File tree

16 files changed

+101
-62
lines changed

16 files changed

+101
-62
lines changed

Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,17 +1552,14 @@ e2e-helm-test: $(BUILD_PROPS) $(BUILD_HELM)/coherence-operator-$(VERSION).tgz un
15521552

15531553
# ----------------------------------------------------------------------------------------------------------------------
15541554
# Executes the Go end-to-end tests that require Prometheus in the k8s cluster
1555-
# using a LOCAL operator instance (i.e. the operator is not deployed to k8s).
1556-
#
1557-
# This target DOES NOT install Prometheus, use the e2e-prometheus-test target
1558-
# to fully reset the test namespace.
15591555
#
15601556
# These tests will use whichever k8s cluster the local environment
15611557
# is pointing to.
15621558
# ----------------------------------------------------------------------------------------------------------------------
15631559
.PHONY: e2e-prometheus-test
15641560
e2e-prometheus-test: export MF = $(MAKEFLAGS)
15651561
e2e-prometheus-test: reset-namespace install-prometheus create-ssl-secrets ensure-pull-secret deploy-and-wait ## Run the Operator metrics/Prometheus end-to-end functional tests
1562+
sleep 10
15661563
$(MAKE) run-prometheus-test $${MF} \
15671564
; rc=$$? \
15681565
; $(MAKE) uninstall-prometheus $${MF} \
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
name: crd-webhook-install-role
5+
$patch: delete
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# --------------------------------------------------------------------
2+
# This is the Cluster Role binding required by the Coherence Operator
3+
# to self-manage its CRDs and Web-Hooks.
4+
# --------------------------------------------------------------------
5+
apiVersion: rbac.authorization.k8s.io/v1
6+
kind: ClusterRoleBinding
7+
metadata:
8+
name: crd-webhook-install-rolebinding
9+
$patch: delete

config/components/restricted/kustomization.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ patches:
88
name: controller-manager
99
- path: node-viewer-role.yaml
1010
- path: node_viewer_role_binding.yaml
11+
- path: cluster_role.yaml
12+
- path: cluster_role_binding.yaml

config/default/manager_metrics_patch.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

config/default/metrics_service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v1
22
kind: Service
33
metadata:
44
name: metrics-service
5-
namespace: system
5+
namespace: default
66
spec:
77
ports:
88
- name: https

config/network-policy/allow-metrics-traffic.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ metadata:
1111
app.kubernetes.io/version: "3.5.6"
1212
app.kubernetes.io/part-of: coherence-operator
1313
name: allow-metrics-traffic
14-
namespace: system
14+
namespace: default
1515
spec:
1616
podSelector:
1717
matchLabels:

config/prometheus/monitor.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99
app.kubernetes.io/version: "3.5.6"
1010
app.kubernetes.io/part-of: coherence-operator
1111
name: controller-manager-metrics-monitor
12-
namespace: system
12+
namespace: default
1313
spec:
1414
endpoints:
1515
- path: /metrics

config/rbac/cluster_role.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# -------------------------------------------------------------
22
# This is the Cluster Roles required by the Coherence Operator
33
# to self-manage its CRDs and Web-Hooks.
4+
#
5+
# The Operator no longer installs its own CRDs so this role
6+
# is now only used by the operator to ensure any existing
7+
# webhook config gets removed when the operator starts.
8+
#
9+
# If the operator has never been installed with web hooks
10+
# enabled, or the web hook config has been manually removed,
11+
# then this role is not required.
412
# -------------------------------------------------------------
513
apiVersion: rbac.authorization.k8s.io/v1
614
kind: ClusterRole

config/rbac/kustomization.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ resources:
99
- role_binding.yaml
1010
- node_viewer_role.yaml
1111
- node_viewer_role_binding.yaml
12+
- cluster_role.yaml
13+
- cluster_role_binding.yaml
1214
- leader_election_role.yaml
1315
- leader_election_role_binding.yaml
1416
# The following RBAC configurations are used to protect

0 commit comments

Comments
 (0)