-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auth to prometheus using token instead of basicauth
- Loading branch information
Showing
10 changed files
with
79 additions
and
67 deletions.
There are no files selected for viewing
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
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
54 changes: 54 additions & 0 deletions
54
roles/servicetelemetry/tasks/component_prometheus_reader.yml
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,54 @@ | ||
- name: Create ServiceAccount/stf-prometheus-reader | ||
k8s: | ||
definition: | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: stf-prometheus-reader | ||
namespace: '{{ ansible_operator_meta.namespace }}' | ||
|
||
- name: Create prometheus-reader Role | ||
k8s: | ||
definition: | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: prometheus-reader | ||
namespace: '{{ ansible_operator_meta.namespace }}' | ||
rules: | ||
- apiGroups: | ||
- '{{ prometheus_operator_api_string | replace("/v1","") }}' | ||
resources: | ||
- prometheus | ||
verbs: | ||
- get | ||
namespaces: | ||
- '{{ ansible_operator_meta.namespace }}' | ||
|
||
- name: Create prometheus-reader RoleBinding for stf-prometheus-reader | ||
k8s: | ||
definition: | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: stf-prometheus-reader | ||
namespace: '{{ ansible_operator_meta.namespace }}' | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: prometheus-reader | ||
subjects: | ||
- kind: ServiceAccount | ||
name: stf-prometheus-reader | ||
|
||
- name: Create an access token for stf-prometheus-reader | ||
k8s: | ||
definition: | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: stf-prometheus-reader-token | ||
namespace: '{{ ansible_operator_meta.namespace }}' | ||
annotations: | ||
kubernetes.io/service-account.name: stf-prometheus-reader | ||
type: kubernetes.io/service-account-token |
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
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
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
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
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
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
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