Documentation
¶
Index ¶
Constants ¶
View Source
const (
DefaultPrometheusTokenDuration = 1 * time.Hour
)
Variables ¶
This section is empty.
Functions ¶
func GetPrometheusToken ¶
GetPrometheusToken retrieves a token for the prometheus-k8s service account using TokenRequest API. It uses DefaultPrometheusTokenDuration for the token lifetime. For a custom lifetime, use GetPrometheusTokenWithDuration.
This follows openshift/library-go/test/library/metrics/query.go and is the recommended approach for Kubernetes 1.24+.
func GetPrometheusTokenWithDuration ¶
func GetPrometheusTokenWithDuration(ctx context.Context, client *openshift.Client, duration time.Duration) (string, error)
GetPrometheusTokenWithDuration retrieves a token for the prometheus-k8s service account using TokenRequest API, with the requested token lifetime. duration must be at least one second.
Types ¶
Click to show internal directories.
Click to hide internal directories.