Portainer icon

Portainer

Interact with Portainer via API

Actions190

Kubernetes → Get Kubernetes Config

AI-generated

Overview

The "Get Kubernetes Config" operation in this node is designed to retrieve Kubernetes configuration data from a Portainer-managed environment. This allows users to programmatically access the kubeconfig details for one or more Kubernetes clusters managed within Portainer. Such functionality is useful for automating cluster management tasks, integrating Kubernetes credentials into CI/CD pipelines, or dynamically configuring Kubernetes clients.

For example, a user might want to fetch the kubeconfig of specific Kubernetes environments to deploy applications or monitor cluster status without manually exporting configurations from the Portainer UI.

Properties

Name Meaning
Additional Fields A collection of optional parameters to filter which Kubernetes environments' configs to get. Includes:
- Ids: JSON array specifying exact environment IDs to include.
- Exclude Ids: JSON array specifying environment IDs to exclude from the results.

Output

The output json field contains the Kubernetes configuration(s) retrieved from Portainer for the specified environments. This typically includes cluster connection details such as API server URLs, certificates, tokens, and context information necessary to authenticate and interact with the Kubernetes clusters.

No binary data output is indicated by the source code or properties.

Dependencies

  • Requires an API key credential for authenticating with the Portainer API.
  • The node depends on the Portainer service being accessible via its REST API endpoint.
  • The base URL for the Portainer API must be configured in the node credentials.
  • No other external dependencies are indicated.

Troubleshooting

  • Common Issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Specifying invalid environment IDs in the "Ids" or "Exclude Ids" fields may result in empty or partial responses.
    • Network connectivity issues to the Portainer API endpoint can prevent retrieval of Kubernetes configs.
  • Error Messages:

    • Authentication errors typically indicate incorrect or expired API keys; verify and update credentials.
    • "Not Found" or similar errors may mean the specified environment IDs do not exist or are inaccessible.
    • Timeout or connection errors suggest network problems or incorrect API URL configuration.

Links and References

Discussion