clusters_credentials
Creates, updates, deletes, gets or lists a clusters_credentials
resource.
Overview
Name | clusters_credentials |
Type | Resource |
Id | digitalocean.kubernetes.clusters_credentials |
Fields
Name | Datatype | Description |
---|---|---|
certificate_authority_data | string | A base64 encoding of bytes representing the certificate authority data for accessing the cluster. |
client_certificate_data | string | A base64 encoding of bytes representing the x509 client certificate data for access the cluster. This is only returned for clusters without support for token-based authentication. Newly created Kubernetes clusters do not return credentials using certificate-based authentication. For additional information, see here. |
client_key_data | string | A base64 encoding of bytes representing the x509 client key data for access the cluster. This is only returned for clusters without support for token-based authentication. Newly created Kubernetes clusters do not return credentials using certificate-based authentication. For additional information, see here. |
expires_at | string | A time value given in ISO8601 combined date and time format that represents when the access token expires. |
server | string | The URL used to access the cluster API server. |
token | string | An access token used to authenticate with the cluster. This is only returned for clusters with support for token-based authentication. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
kubernetes_get_credentials | SELECT | cluster_id | This endpoint returns a JSON object . It can be used to programmatically construct Kubernetes clients which cannot parse kubeconfig files. The resulting JSON object contains token-based authentication for clusters supporting it, and certificate-based authentication otherwise. For a list of supported versions and more information, see "How to Connect to a DigitalOcean Kubernetes Cluster". To retrieve credentials for accessing a Kubernetes cluster, send a GET request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/credentials . Clusters supporting token-based authentication may define an expiration by passing a duration in seconds as a query parameter to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/credentials?expiry_seconds=$DURATION_IN_SECONDS . If not set or 0, then the token will have a 7 day expiry. The query parameter has no impact in certificate-based authentication. |
SELECT
examples
This endpoint returns a JSON object . It can be used to programmatically construct Kubernetes clients which cannot parse kubeconfig files. The resulting JSON object contains token-based authentication for clusters supporting it, and certificate-based authentication otherwise. For a list of supported versions and more information, see "How to Connect to a DigitalOcean Kubernetes Cluster". To retrieve credentials for accessing a Kubernetes cluster, send a GET request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/credentials
. Clusters supporting token-based authentication may define an expiration by passing a duration in seconds as a query parameter to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/credentials?expiry_seconds=$DURATION_IN_SECONDS
. If not set or 0, then the token will have a 7 day expiry. The query parameter has no impact in certificate-based authentication.
SELECT
certificate_authority_data,
client_certificate_data,
client_key_data,
expires_at,
server,
token
FROM digitalocean.kubernetes.clusters_credentials
WHERE cluster_id = '{{ cluster_id }}';