Home > Back-end >  How to provide basic_auth in prometheus using helm?
How to provide basic_auth in prometheus using helm?

Time:07-27

I use helm to install Prometheus on my GKE cluster but i can't add my endpoint with my credetionals. There are no fields in values.yaml where i can add it. I add my endpoint to additionalServiceMonitors: but there are no field to add credetionals.

CodePudding user response:

I assume from prometheus you mean the prometheus server itself. I see in the documentation for prometheus helm charts that you can see all the configurable options for your charts with:

helm show values <name of chart>

This will help you find the right value to change to mention your authentication endpoint, perhaps.

Otherwise, you might be required to use ServiceAccount based configuration, where your authentication Secret will be used by the ServiceAccount for authentication.

CodePudding user response:

Check here: https://artifacthub.io/packages/helm/prometheus-community/prometheus You should get the configuration file as shown here: https://prometheus.io/docs/prometheus/latest/configuration/configuration/ Under scrape_confg section you can specify:

# Configures the protocol scheme used for requests.
[ scheme: <scheme> | default = http ]

# Optional HTTP URL parameters.
params:
  [ <string>: [<string>, ...] ]

# Sets the `Authorization` header on every scrape request with the
# configured username and password.
# password and password_file are mutually exclusive.
#HERE YOU SET CREDENTIALS
 basic_auth:
  [ username: <string> ]
  [ password: <secret> ]
  [ password_file: <string> ]

# Sets the `Authorization` header on every scrape request with
# the configured credentials.
authorization:
  # Sets the authentication type of the request.
  [ type: <string> | default: Bearer ]
  # Sets the credentials of the request. It is mutually exclusive with
  # `credentials_file`.
  [ credentials: <secret> ]
  # Sets the credentials of the request with the credentials read from the
  # configured file. It is mutually exclusive with `credentials`.
  [ credentials_file: <filename> ]

# Optional OAuth 2.0 configuration.
# Cannot be used at the same time as basic_auth or authorization.
oauth2:
  [ <oauth2> ]
  • Related