Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Stretch Cluster] Support parsing remote Kubernetes cluster credentials from env #11335

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

aswinayyolath
Copy link
Contributor

Type of change

Select the type of your PR

  • Bugfix
  • Enhancement / new feature
  • Refactoring
  • Documentation

Description

Please describe your pull request

Checklist

Please go through this checklist and make sure all applicable tasks have been done

  • Write tests
  • Make sure all tests pass
  • Update documentation
  • Check RBAC rights for Kubernetes / OpenShift roles
  • Try your changes from Pod inside your Kubernetes and OpenShift cluster, not just locally
  • Reference relevant issue(s) and close them after merging
  • Update CHANGELOG.md
  • Supply screenshots for visual changes, such as Grafana dashboards

…onment variable

- Introduced `STRIMZI_REMOTE_KUBE_CONFIG` env var to define remote clusters.
- Parsed configuration into a map of cluster ID to `ClusterInfo` (API URL + Secret).
- Added validation to handle invalid or malformed input.
- Added unit tests to cover valid, empty, missing, and invalid configurations.

Signed-off-by: Aswin A <[email protected]>
Addressed review comments

Signed-off-by: Aswin A <[email protected]>
Refactored code

Signed-off-by: Aswin A <[email protected]>
Addressed review comments

Signed-off-by: Aswin A <[email protected]>
@aswinayyolath aswinayyolath marked this pull request as draft April 9, 2025 06:08
@aswinayyolath aswinayyolath changed the title Define k8s cluster creds Stretch Cluster] Support parsing remote Kubernetes cluster credentials from env Apr 9, 2025
@aswinayyolath
Copy link
Contributor Author

@ppatierno @katheris @fvaleri

This PR introduces support for parsing remote Kubernetes cluster credentials from the STRIMZI_REMOTE_KUBE_CONFIG environment variable as part of the ongoing Stretch Cluster work.

The main purpose of this change is to allow the Cluster Operator to discover and connect to multiple remote Kubernetes clusters using their respective API server URLs and Secrets. The credentials are provided in a simple key-value format, and the parsing logic ensures each cluster entry includes both a valid URL and a Secret reference.

Example format:

cluster-1.url=https://<api-url-1>
cluster-1.secret=<secret-name-1>
cluster-2.url=https://<api-url-2>
cluster-2.secret=<secret-name-2>

This enables future functionality such as deploying Kafka pods across multiple clusters, starting with cluster credential awareness.

I’d really appreciate your time in reviewing this! Please let me know if there’s anything you’d like me to update or clarify

@aswinayyolath aswinayyolath changed the title Stretch Cluster] Support parsing remote Kubernetes cluster credentials from env [Stretch Cluster] Support parsing remote Kubernetes cluster credentials from env Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant