Skip to content

Commit

Permalink
Add federate to rbac proxy
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Fernandez <mariofer@redhat.com>
  • Loading branch information
marioferh committed Apr 11, 2023
1 parent eb426eb commit 96085b5
Show file tree
Hide file tree
Showing 17 changed files with 79 additions and 3 deletions.
Expand Up @@ -15,4 +15,9 @@ stringData:
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
- "path": "/federate"
"resourceRequest": false
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
type: Opaque
5 changes: 5 additions & 0 deletions assets/alertmanager/kube-rbac-proxy-metric-secret.yaml
Expand Up @@ -15,4 +15,9 @@ stringData:
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
- "path": "/federate"
"resourceRequest": false
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
type: Opaque
5 changes: 5 additions & 0 deletions assets/kube-state-metrics/kube-rbac-proxy-secret.yaml
Expand Up @@ -15,4 +15,9 @@ stringData:
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
- "path": "/federate"
"resourceRequest": false
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
type: Opaque
5 changes: 5 additions & 0 deletions assets/node-exporter/kube-rbac-proxy-secret.yaml
Expand Up @@ -15,4 +15,9 @@ stringData:
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
- "path": "/federate"
"resourceRequest": false
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
type: Opaque
5 changes: 5 additions & 0 deletions assets/openshift-state-metrics/kube-rbac-proxy-secret.yaml
Expand Up @@ -15,4 +15,9 @@ stringData:
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
- "path": "/federate"
"resourceRequest": false
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
type: Opaque
5 changes: 5 additions & 0 deletions assets/prometheus-k8s/kube-rbac-proxy-secret.yaml
Expand Up @@ -15,4 +15,9 @@ stringData:
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
- "path": "/federate"
"resourceRequest": false
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
type: Opaque
3 changes: 2 additions & 1 deletion assets/prometheus-k8s/prometheus.yaml
Expand Up @@ -82,13 +82,14 @@ spec:
- args:
- --secure-listen-address=0.0.0.0:9092
- --upstream=http://127.0.0.1:9090
- --allow-paths=/metrics
- --allow-paths=/metrics,/federate
- --config-file=/etc/kube-rbac-proxy/config.yaml
- --tls-cert-file=/etc/tls/private/tls.crt
- --tls-private-key-file=/etc/tls/private/tls.key
- --client-ca-file=/etc/tls/client/client-ca.crt
- --tls-cipher-suites=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305
- --logtostderr=true
- --v=10
image: quay.io/brancz/kube-rbac-proxy:v0.14.0
name: kube-rbac-proxy
ports:
Expand Down
Expand Up @@ -15,4 +15,9 @@ stringData:
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
- "path": "/federate"
"resourceRequest": false
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
type: Opaque
5 changes: 5 additions & 0 deletions assets/prometheus-operator/kube-rbac-proxy-secret.yaml
Expand Up @@ -15,4 +15,9 @@ stringData:
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
- "path": "/federate"
"resourceRequest": false
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
type: Opaque
Expand Up @@ -15,4 +15,9 @@ stringData:
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
- "path": "/federate"
"resourceRequest": false
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
type: Opaque
6 changes: 6 additions & 0 deletions assets/telemeter-client/deployment.yaml
Expand Up @@ -67,6 +67,12 @@ spec:
- mountPath: /etc/telemeter
name: secret-telemeter-client
readOnly: false
- mountPath: /etc/tls/private
name: telemeter-client-tls
readOnly: false
- mountPath: /etc/tls/client
name: metrics-client-ca
readOnly: true
- args:
- --reload-url=http://localhost:8080/-/reload
- --watched-dir=/etc/serving-certs-ca-bundle
Expand Down
5 changes: 5 additions & 0 deletions assets/telemeter-client/kube-rbac-proxy-secret.yaml
Expand Up @@ -15,4 +15,9 @@ stringData:
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
- "path": "/federate"
"resourceRequest": false
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
type: Opaque
5 changes: 5 additions & 0 deletions assets/thanos-querier/kube-rbac-proxy-metric-secret.yaml
Expand Up @@ -15,4 +15,9 @@ stringData:
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
- "path": "/federate"
"resourceRequest": false
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
type: Opaque
5 changes: 5 additions & 0 deletions assets/thanos-ruler/kube-rbac-proxy-metrics-secret.yaml
Expand Up @@ -15,4 +15,9 @@ stringData:
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
- "path": "/federate"
"resourceRequest": false
"user":
"name": "system:serviceaccount:openshift-monitoring:prometheus-k8s"
"verb": "get"
type: Opaque
3 changes: 2 additions & 1 deletion jsonnet/components/prometheus.libsonnet
Expand Up @@ -397,13 +397,14 @@ function(params)
args: [
'--secure-listen-address=0.0.0.0:9092',
'--upstream=http://127.0.0.1:9090',
'--allow-paths=/metrics',
'--allow-paths=/metrics,/federate',
'--config-file=/etc/kube-rbac-proxy/config.yaml',
'--tls-cert-file=/etc/tls/private/tls.crt',
'--tls-private-key-file=/etc/tls/private/tls.key',
'--client-ca-file=/etc/tls/client/client-ca.crt',
'--tls-cipher-suites=' + cfg.tlsCipherSuites,
'--logtostderr=true',
'--v=10',
],
terminationMessagePolicy: 'FallbackToLogsOnError',
volumeMounts: [
Expand Down
2 changes: 1 addition & 1 deletion jsonnet/components/telemeter-client.libsonnet
Expand Up @@ -82,7 +82,7 @@ function(params) {
},
{
mountPath: '/etc/tls/client',
name: 'metrics-client-ca',
name: 'metrics-client-cafeo',
readOnly: true,
},
],
Expand Down
8 changes: 8 additions & 0 deletions jsonnet/utils/generate-secret.libsonnet
Expand Up @@ -21,6 +21,14 @@
path: '/metrics',
resourceRequest: false,
},
{
user: {
name: 'system:serviceaccount:openshift-monitoring:prometheus-k8s',
},
verb: 'get',
path: '/federate',
resourceRequest: false,
},
],
},
},),
Expand Down

0 comments on commit 96085b5

Please sign in to comment.