-
Notifications
You must be signed in to change notification settings - Fork 486
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
db97808
commit 5c72fa9
Showing
2 changed files
with
192 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
tests/e2e-targetallocator/targetallocator-prometheuscr/03-assert.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: prometheus-cr-collector | ||
status: | ||
readyReplicas: 1 | ||
replicas: 1 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: prometheus-cr-targetallocator | ||
status: | ||
observedGeneration: 1 | ||
readyReplicas: 1 | ||
replicas: 1 | ||
--- | ||
apiVersion: v1 | ||
data: | ||
targetallocator.yaml: | ||
( contains(@, join(':', ['service_monitor_namespace_selector', ' {}'])) ): true | ||
( contains(@, join(':', ['pod_monitor_namespace_selector', ' {}'])) ): true | ||
( contains(@, join(':', ['probe_namespace_selector', ' {}'])) ): true | ||
( contains(@, join(':', ['scrape_config_namespace_selector', '{}'])) ): true | ||
kind: ConfigMap | ||
metadata: | ||
name: prometheus-cr-v1beta1-targetallocator | ||
--- |
164 changes: 164 additions & 0 deletions
164
tests/e2e-targetallocator/targetallocator-prometheuscr/03-install.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
apiVersion: v1 | ||
automountServiceAccountToken: true | ||
kind: ServiceAccount | ||
metadata: | ||
name: ta | ||
--- | ||
apiVersion: v1 | ||
automountServiceAccountToken: true | ||
kind: ServiceAccount | ||
metadata: | ||
name: collector | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: targetallocator-prometheuscr | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
- nodes | ||
- services | ||
- endpoints | ||
- configmaps | ||
- secrets | ||
- namespaces | ||
verbs: | ||
- get | ||
- watch | ||
- list | ||
- apiGroups: | ||
- apps | ||
resources: | ||
- statefulsets | ||
- services | ||
- endpoints | ||
verbs: | ||
- get | ||
- watch | ||
- list | ||
- apiGroups: | ||
- discovery.k8s.io | ||
resources: | ||
- endpointslices | ||
verbs: | ||
- get | ||
- watch | ||
- list | ||
- apiGroups: | ||
- networking.k8s.io | ||
resources: | ||
- ingresses | ||
verbs: | ||
- get | ||
- watch | ||
- list | ||
- apiGroups: | ||
- monitoring.coreos.com | ||
resources: | ||
- servicemonitors | ||
- podmonitors | ||
- scrapeconfigs | ||
- probes | ||
verbs: | ||
- get | ||
- watch | ||
- list | ||
- nonResourceURLs: | ||
- /metrics | ||
verbs: | ||
- get | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: collector-prometheuscr | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
- nodes | ||
- nodes/metrics | ||
- services | ||
- endpoints | ||
- namespaces | ||
verbs: | ||
- get | ||
- watch | ||
- list | ||
- apiGroups: | ||
- networking.k8s.io | ||
resources: | ||
- ingresses | ||
verbs: | ||
- get | ||
- watch | ||
- list | ||
- nonResourceURLs: | ||
- /metrics | ||
- /metrics/cadvisor | ||
verbs: | ||
- get | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: (join('-', ['ta', $namespace])) | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: targetallocator-prometheuscr | ||
subjects: | ||
- kind: ServiceAccount | ||
name: ta | ||
namespace: ($namespace) | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: (join('-', ['collector', $namespace])) | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: collector-prometheuscr | ||
subjects: | ||
- kind: ServiceAccount | ||
name: collector | ||
namespace: ($namespace) | ||
--- | ||
apiVersion: opentelemetry.io/v1alpha1 | ||
kind: OpenTelemetryCollector | ||
metadata: | ||
name: prometheus-cr | ||
spec: | ||
config: | | ||
receivers: | ||
prometheus: | ||
config: | ||
scrape_configs: [] | ||
processors: | ||
exporters: | ||
prometheus: | ||
endpoint: 0.0.0.0:9090 | ||
service: | ||
pipelines: | ||
metrics: | ||
receivers: [prometheus] | ||
exporters: [prometheus] | ||
mode: statefulset | ||
serviceAccount: collector | ||
targetAllocator: | ||
enabled: true | ||
prometheusCR: | ||
enabled: true | ||
scrapeInterval: 1s | ||
podMonitorNamespaceSelector: {} | ||
serviceMonitorNamespaceSelector: {} | ||
scrapeConfigNamespaceSelector: {} | ||
probeNamespaceSelector: {} | ||
serviceAccount: ta |