Migrate from Kubernetes credentials API to Settings API
The Kubernetes credentials API has been deprecated with Dynatrace version 1.288. It is replaced by the Settings API
with the Kubernetes connection settings (builtin:cloud.kubernetes
) and
the Kubernetes Platform Monitoring settings (builtin:cloud.kubernetes.monitoring
)
schemas. We recommend that you migrate to the new API at your earliest convenience.
The migration affects endpoint URLs, query parameters, and response/request body parameters, as well as the scope of the token for the request.
Base URL
/api/v2/settings
/config/v1/kubernetes/credentials
Authentication token scope
settings.read
)Write settings (
settings.write
)ReadConfig
)Write configuration (
WriteConfig
)Parameters
To learn about new query/body parameters, see the documentation of individual requests in the Settings API.
In the Settings 2.0 framework, Kubernetes Platform Monitoring is configured via settings objects. A settings object contains some metadata (like the scope or creation timestamp) and the configuration itself, encapsulated in the value object.
For configuring Kubernetes cluster monitoring, two settings schemas are important:
- Kubernetes connection settings (
builtin:cloud.kubernetes
) for configuring how the ActiveGate accesses the Kubernetes cluster, and - Kubernetes Platform Monitoring settings (
builtin:cloud.kubernetes.monitoring
) for configuring what the ActiveGate should monitor.
This is in contrast to the Kubernetes credentials API, where one credentials object held information about both the connection and the monitoring features.
The advantage of having these settings separated is that you can define default Kubernetes Platform Monitoring settings on the environment level, which configure monitoring for all Kubernetes clusters, unless specifically overridden on cluster level. Learn more about monitoring settings on environment level and cluster level and how you can make use of settings hierarchies and overrides here: Global default monitoring settings for Kubernetes/OpenShift.
To learn about the parameters of Kubernetes connection settings, query the Kubernetes (builtin:cloud.kubernetes
) schema with
the GET a schema request.
To learn about the parameters of Kubernetes Platform Monitoring settings, query the Kubernetes Platform Monitoring (builtin:cloud.kubernetes.monitoring
) schema with the GET a schema request.
eventAnalysisAndAlertingEnabled
(deprecated)endpointStatus
endpointStatusInfo
metadata
id
Check the examples below to see the differences between using the Kubernetes credentials API and the Settings API.
Examples
Here are some examples of differences in API usage.
List all Kubernetes connection settings
Details for a specific Kubernetes connection
Validate creation of a Kubernetes connection
In this example, we validate if the request for creating a new Kubernetes connection would be successful.
Create a Kubernetes connection
In this example, we create a Kubernetes connection. Keep in mind that the recommended way is to use the Dynatrace Operator as explained here: Deployment
Edit a Kubernetes connection
In this example, we modify the Kubernetes connection created in the previous example. We change the name to old-test-cluster
.
Delete a Kubernetes connection
In this example, we delete the previously created Kubernetes connection again.