-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(RHTAPWATCH-568): Add authentication to Service and ServiceMonitor
Signed-off-by: Kousalya Lakshmanan <[email protected]>
- Loading branch information
1 parent
94972fb
commit cc72cbe
Showing
2 changed files
with
115 additions
and
2 deletions.
There are no files selected for viewing
112 changes: 112 additions & 0 deletions
112
config/exporters/monitoring/grafana/base/prometheus-dsexporter-service.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,112 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: appstudio-grafana-datasource-exporter | ||
spec: {} | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: availability-exporter-sa | ||
namespace: appstudio-grafana-datasource-exporter | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: availability-exporter-sa | ||
namespace: appstudio-grafana-datasource-exporter | ||
annotations: | ||
kubernetes.io/service-account.name: availability-exporter-sa | ||
type: kubernetes.io/service-account-token | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: availability-exporter-cluster-role | ||
rules: | ||
- nonResourceURLs: | ||
- /metrics | ||
verbs: | ||
- get | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: availability-exporter-cluster-role-binding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: availability-exporter-cluster-role | ||
subjects: | ||
- kind: ServiceAccount | ||
name: availability-exporter-sa | ||
namespace: appstudio-grafana-datasource-exporter | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: availability-exporter-service | ||
namespace: appstudio-grafana-datasource-exporter | ||
labels: | ||
app: grafana-datasource-exporter | ||
spec: | ||
ports: | ||
- name: https | ||
port: 8443 | ||
targetPort: https | ||
selector: | ||
app: grafana-datasource-exporter | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: availability-exporter-service-deployment | ||
namespace: appstudio-grafana-datasource-exporter | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: grafana-datasource-exporter | ||
template: | ||
metadata: | ||
labels: | ||
app: grafana-datasource-exporter | ||
spec: | ||
name: availability-exporter-sa | ||
containers: | ||
- name: grafana-datasource-exporter | ||
image: exporter:latest | ||
image: quay.io/redhat-appstudio/o11y-prometheus-exporters:v0.1 | ||
ports: | ||
- containerPort: 8443 | ||
name: https | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 100Mi | ||
requests: | ||
cpu: 100m | ||
memory: 10Mi | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
readOnlyRootFilesystem: true | ||
runAsNonRoot: true | ||
--- | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: availability-metrics-reader | ||
namespace: appstudio-grafana-datasource-exporter | ||
spec: | ||
endpoints: | ||
- path: /metrics | ||
port: web | ||
scheme: https | ||
bearerTokenSecret: | ||
name: "availability-exporter-sa" | ||
key: token | ||
tlsConfig: | ||
insecureSkipVerify: true | ||
selector: | ||
matchLabels: | ||
app: grafana-datasource-exporter |
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