Skip to content

Commit

Permalink
Adjust Alertmanager SAR to be more specific
Browse files Browse the repository at this point in the history
  • Loading branch information
csibbitt committed Dec 12, 2023
1 parent b29d023 commit 0f94fd5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
18 changes: 12 additions & 6 deletions roles/servicetelemetry/tasks/component_prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@
- subjectaccessreviews
verbs:
- create
- apiGroups:
- ""
resources:
- namespaces
verbs:
- get

- name: Setup ClusterRoleBinding for Prometheus
block:
Expand Down Expand Up @@ -123,6 +117,18 @@
- securitycontextconstraints
verbs:
- use
- apiGroups:
- '{{ prometheus_operator_api_string | replace("/v1","") }}'
resources:
- alertmanagers
verbs:
- get
- apiGroups:
- smartgateway.infra.watch
resources:
- smartgateways
verbs:
- get

- name: Setup RoleBinding for Prometheus
block:
Expand Down
4 changes: 2 additions & 2 deletions roles/servicetelemetry/templates/manifest_alertmanager.j2
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ spec:
- -upstream=http://localhost:9093/
- -cookie-secret-file=/etc/proxy/secrets/session_secret
- -openshift-service-account=alertmanager-stf
- '-openshift-sar={"resource": "namespaces", "verb": "get"}'
- '-openshift-delegate-urls={"/": {"resource": "namespaces", "verb": "get"}}'
- '-openshift-sar={"namespace":"{{ ansible_operator_meta.namespace }}", "resource": "alertmanagers", "group":"{{ prometheus_operator_api_string | replace("/v1","") }}", "verb":"get"}'
- '-openshift-delegate-urls={"/": {"namespace":"{{ ansible_operator_meta.namespace }}", "resource": "alertmanagers", "group":"{{ prometheus_operator_api_string | replace("/v1","") }}", "verb":"get"}}'
ports:
- containerPort: 9095
name: https
Expand Down

0 comments on commit 0f94fd5

Please sign in to comment.