• Home
  • Dynatrace API
  • Configuration
  • Kubernetes credentials
  • POST new credentials

Kubernetes credentials API - POST new credentials

Creates a new Kubernetes credentials configuration.

The body must not provide an ID. The Dynatrace server automatically assigns an ID.

The request consumes and produces an application/json payload.

Early Adopter

This request is an Early Adopter release and may be changed in non-compatible way.

POSTManaged https://{your-domain}/e/{your-environment-id}/api/config/v1/kubernetes/credentials
SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/kubernetes/credentials
Environment ActiveGate https://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/kubernetes/credentials

Authentication

To execute this request, you need an access token with Write configuration (WriteConfig) scope. To learn how to obtain and use it, see Tokens and authentication.

Parameters

ParameterTypeDescriptionInRequired
bodyKubernetesCredentials

The JSON body of the request. Contains parameters of the new Kubernetes credentials configuration.

bodyoptional

Request body objects

The KubernetesCredentials object

Configuration for specific Kubernetes credentials.

ElementTypeDescription
metadataConfigurationMetadata

Metadata useful for debugging

Can be null.

idstring

The ID of the given credentials configuration.

Can be null.

activeboolean

The monitoring is enabled (true) or disabled (false) for given credentials configuration.

If not set on creation, the true value is used.

If the field is omitted during an update, the old value remains unaffected.

Can be null.

endpointStatusstring

The status of the configured endpoint.

ASSIGNED: The credentials are assigned to an ActiveGate which is responsible for processing. UNASSIGNED: The credentials are not yet assigned to an ActiveGate so there is currently no processing. DISABLED: The credentials have been disabled by the user. FASTCHECK_AUTH_ERROR: The credentials are invalid. FASTCHECK_TLS_ERROR: The endpoint TLS certificate is invalid. FASTCHECK_NO_RESPONSE: The endpoint did not return a result until the timeout was reached. FASTCHECK_INVALID_ENDPOINT: The endpoint URL was invalid. FASTCHECK_AUTH_LOCKED: The credentials seem to be locked. UNKNOWN: An unknown error occured.

The element can hold these values
  • ASSIGNED
  • DISABLED
  • FASTCHECK_AUTH_ERROR
  • FASTCHECK_AUTH_LOCKED
  • FASTCHECK_INVALID_ENDPOINT
  • FASTCHECK_LOW_MEMORY_ERROR
  • FASTCHECK_NO_RESPONSE
  • FASTCHECK_TLS_ERROR
  • UNASSIGNED
  • UNKNOWN

Can be null.

endpointStatusInfostring

The detailed status info of the configured endpoint.

Can be null.

labelstring

The name of the Kubernetes credentials configuration.

Allowed characters are letters, numbers, whitespaces, and the following characters: .+-_. Leading or trailing whitespace is not allowed.

endpointUrlstring

The URL of the Kubernetes API server.

It must be unique within a Dynatrace environment.

The URL must valid according to RFC 2396. Leading or trailing whitespaces are not allowed.

authTokenstring

The service account bearer token for the Kubernetes API server.

Submit your token on creation or update of the configuration. For security reasons, GET requests return this field as null.

If the field is omitted during an update, the old value remains unaffected.

Can be null.

activeGateGroupstring

Active Gate group to filter active gates for this credentials.

Can be null.

eventsIntegrationEnabledboolean

The monitoring of events is enabled (true) or disabled (false) for the Kubernetes cluster. Event monitoring depends on the active state of this configuration to be true.

If not set on creation, the false value is used.

If the field is omitted during an update, the old value remains unaffected.

Can be null.

eventAnalysisAndAlertingEnabledboolean

[Deprecated] With 1.240 the EA events monitoring has been deprecated and replaced by the events GA version which obsoletes this property.

Corresponds to the value of eventsIntegrationEnabled.

The field is ignored during an update, the old value remains unaffected.

Can be null.

workloadIntegrationEnabledboolean

Workload and cloud application processing is enabled (true) or disabled (false) for the Kubernetes cluster. If the field is omitted during an update, the old value remains unaffected.

Can be null.

prometheusExportersIntegrationEnabledboolean

Prometheus exporters integration is enabled (true) or disabled (false) for the Kubernetes cluster. If the field is omitted during an update, the old value remains unaffected.

Can be null.

davisEventsIntegrationEnabledboolean

Inclusion of all Davis relevant events is enabled (true) or disabled (false) for the Kubernetes cluster. If the field is omitted during an update, the old value remains unaffected.

Can be null.

eventsFieldSelectorsKubernetesEventPattern[]

Kubernetes event filters based on field-selectors. If set to null on creation, no events field selectors are subscribed. If set to null on update, no change of stored events field selectors is applied. Set an empty list to clear all events field selectors.

Can be null.

certificateCheckEnabledboolean

The check of SSL certificates is enabled (true) or disabled (false) for the Kubernetes cluster.

If not set on creation, the true value is used.

If the field is omitted during an update, the old value remains unaffected.

Can be null.

The ConfigurationMetadata object

Metadata useful for debugging

ElementTypeDescription
configurationVersionsinteger[]

A sorted list of the version numbers of the configuration.

Can be null.

currentConfigurationVersionsstring[]

A sorted list of version numbers of the configuration.

Can be null.

clusterVersionstring

Dynatrace version.

Can be null.

The KubernetesEventPattern object

Represents a single Kubernetes events field selector (=event filter based on the K8s field selector).

ElementTypeDescription
labelstring

A label of the events field selector.

fieldSelectorstring

The field selector string (url decoding is applied) when storing it.

activeboolean

Whether subscription to this events field selector is enabled (value set to true). If disabled (value set to false), Dynatrace will stop fetching events from the Kubernetes API for this events field selector

Request body JSON model

This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.

json
{ "id": "KUBERNETES_CLUSTER-CC06304728FC9396", "label": "K8s credentials - REST example", "endpointUrl": "https://k8s-api.sample.org", "eventsFieldSelectors": [ { "label": "Node events", "fieldSelector": "involvedObject.kind=Node", "active": true } ], "workloadIntegrationEnabled": true, "eventsIntegrationEnabled": true, "eventAnalysisAndAlertingEnabled": true, "authToken": "abcd9876", "activeGateGroup": "group-1", "active": true, "certificateCheckEnabled": true, "hostnameVerificationEnabled": true, "prometheusExportersIntegrationEnabled": true, "davisEventsIntegrationEnabled": true }

Response

Response codes

CodeTypeDescription
201EntityShortRepresentation

Success. The new Kubernetes credentials configuration has been created. The response body contains the ID of the configuration.

400ErrorEnvelope

Failed. The input is invalid.

Response body objects

The EntityShortRepresentation object

The short representation of a Dynatrace entity.

ElementTypeDescription
idstring

The ID of the Dynatrace entity.

namestring

The name of the Dynatrace entity.

Can be null.

descriptionstring

A short description of the Dynatrace entity.

Can be null.

Response body JSON model

json
{ "id": "6a98d7bc-abb9-44f8-ae6a-73e68e71812a", "name": "Dynatrace entity", "description": "Dynatrace entity for the REST API example" }

Validate payload

We recommend that you validate the payload before submitting it with an actual request. A response code of 204 indicates a valid payload.

The request consumes an application/json payload.

Early Adopter

This request is an Early Adopter release and may be changed in non-compatible way.

POSTManaged https://{your-domain}/e/{your-environment-id}/api/config/v1/kubernetes/credentials/validator
SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/kubernetes/credentials/validator
Environment ActiveGate https://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/kubernetes/credentials/validator

Authentication

To execute this request, you need an access token with Write configuration (WriteConfig) scope. To learn how to obtain and use it, see Tokens and authentication.

Response

Response codes

CodeTypeDescription
204-

Validated. The submitted configuration is valid. The response doesn't have a body.

400ErrorEnvelope

Failed. The input is invalid.

Related topics
  • Set up Dynatrace on Kubernetes/OpenShift

    Ways to deploy and configure Dynatrace on Kubernetes/OpenShift