Portainer icon

Portainer

Interact with Portainer via API

Actions190

Kubernetes → Get Kubernetes Services

AI-generated

Overview

The "Get Kubernetes Services" operation in this node retrieves information about Kubernetes services within a specified environment. It is useful for users who want to programmatically access details of services running in their Kubernetes clusters, such as service names, types, and associated applications. This can help automate monitoring, auditing, or integration workflows involving Kubernetes services.

A practical example would be fetching all services in a particular Kubernetes environment to display them in a dashboard or to trigger further automation based on the services' status or metadata.

Properties

Name Meaning
Id The identifier of the Kubernetes environment from which to retrieve services.
Additional Fields Optional extra parameters to customize the request:
- With Applications Boolean flag indicating whether to include lookup of applications associated with each service (default: true).

Output

The node outputs JSON data representing the list of Kubernetes services retrieved from the specified environment. Each service object may include standard Kubernetes service details such as name, namespace, labels, and potentially associated applications if requested.

If binary data were involved (e.g., service manifests or logs), it would be summarized here, but this operation focuses on JSON service data only.

Dependencies

  • Requires an API key credential to authenticate against the Kubernetes environment or the intermediary API managing Kubernetes resources.
  • The node depends on connectivity to the Kubernetes API or a proxy API that exposes Kubernetes services.
  • No additional external libraries beyond those bundled with the node are required.

Troubleshooting

  • Common issues:
    • Invalid or missing environment identifier (Id property) will cause the request to fail.
    • Network connectivity problems to the Kubernetes API endpoint or proxy.
    • Insufficient permissions or invalid API credentials leading to authorization errors.
  • Error messages:
    • Authentication failures typically indicate incorrect or expired API keys; verify and update credentials.
    • "Resource not found" or similar errors suggest the environment ID does not correspond to a valid Kubernetes cluster.
    • Timeout or connection errors imply network issues; check firewall and endpoint accessibility.

Links and References

Discussion