Skip to content

Multi k8s kubernetes cluster commands#3319

Open
Santwana Verma (vsantwana) wants to merge 3 commits intomainfrom
multi-k8s-kubernetes-cluster-commands
Open

Multi k8s kubernetes cluster commands#3319
Santwana Verma (vsantwana) wants to merge 3 commits intomainfrom
multi-k8s-kubernetes-cluster-commands

Conversation

@vsantwana
Copy link
Copy Markdown
Member

@vsantwana Santwana Verma (vsantwana) commented Apr 14, 2026

Release Notes

Breaking Changes

  • None

New Features

  • Add confluent flink kubernetes-cluster list command to list Kubernetes clusters registered with CMF
  • Add confluent flink kubernetes-cluster describe command to describe a registered Kubernetes cluster
  • Add confluent flink kubernetes-cluster update --lifecycle-state command to update cluster lifecycle state (ACTIVE or DECOMMISSIONED)
  • Add --kubernetes-cluster-name flag to confluent flink environment create to bind an environment to a specific Kubernetes cluster in multi-cluster deployments
  • Show Kubernetes cluster name in confluent flink environment list and confluent flink environment describe output

Bug Fixes

  • None

Checklist

  • I have successfully built and used a custom CLI binary, without linter issues from this PR.

  • I have clearly specified in the What section below whether this PR applies to Confluent Cloud, Confluent Platform, or both.

  • I have verified this PR in Confluent Cloud pre-prod or production environment, if applicable.

  • I have verified this PR in Confluent Platform on-premises environment, if applicable.

  • I have attached manual CLI verification results or screenshots in the Test & Review section below.

  • I have added appropriate CLI integration or unit tests for any new or updated commands and functionality.

  • I confirm that this PR introduces no breaking changes or backward compatibility issues.

  • I have indicated the potential customer impact if something goes wrong in the Blast Radius section below.

  • I have put checkmarks below confirming that the feature associated with this PR is enabled in:

    • Confluent Cloud prod

    • Confluent Cloud stag

    • Confluent Platform

    • Check this box if the feature is enabled for certain organizations only

    • I have successfully built and used a custom CLI binary, without linter issues from this PR.

    • I have clearly specified in the What section below whether this PR applies to Confluent Cloud, Confluent Platform, or both.

    • I have verified this PR in Confluent Cloud pre-prod or production environment, if applicable.

    • I have verified this PR in Confluent Platform on-premises environment, if applicable.

    • I have attached manual CLI verification results or screenshots in the Test & Review section below.

    • I have added appropriate CLI integration or unit tests for any new or updated commands and functionality.

    • I confirm that this PR introduces no breaking changes or backward compatibility issues.

    • I have indicated the potential customer impact if something goes wrong in the Blast Radius section below.

    • I have put checkmarks below confirming that the feature associated with this PR is enabled in:

      • Confluent Cloud prod
      • Confluent Cloud stag
      • Confluent Platform
      • Check this box if the feature is enabled for certain organizations only

    What

    Confluent Platform only.

    Adds CLI support for the multi-Kubernetes cluster feature in Confluent Manager for Apache Flink (CMF):

    1. New kubernetes-cluster command group — list, describe, and update subcommands for managing Kubernetes clusters registered with CMF.
    2. Updated environment create — new optional --kubernetes-cluster-name flag to bind an environment to a specific cluster.
    3. Updated environment list / describe — now displays the Kubernetes cluster name in output.
    4. SDK upgrade (v0.0.5 → v0.0.6) — picks up the new KubernetesClustersApi, generated mocks, and KubernetesClusterName field on environments. Includes compatibility fixes
      for SDK type changes (PostEnvironment.Name becoming *string, ComputePool.Status type regression).

Blast Radius

Low. New kubernetes-cluster commands are on-prem-only behind RequireCloudLogout. The --kubernetes-cluster-name flag on environment create is optional and defaults to the
existing single-cluster behavior when omitted. SDK compatibility changes to existing environment and compute pool commands are minimal accessor changes that preserve
the same runtime behavior. All existing tests pass.

References

  • cmf-sdk-go v0.0.6: adds KubernetesClusters API, mocks, and kubernetesClusterName on environments

Test & Review

  • go build ./... passes cleanly
  • go test ./internal/flink/... passes
  • All subcommands verified via --help:
    • confluent flink kubernetes-cluster list
    • confluent flink kubernetes-cluster describe
    • confluent flink kubernetes-cluster update --lifecycle-state
    • confluent flink environment create --kubernetes-cluster-name

Implement `confluent flink kubernetes-cluster` commands for managing
Kubernetes clusters registered with Confluent Manager for Apache Flink
(CMF) on-prem. Also upgrades cmf-sdk-go from v0.0.5 to v0.0.6.

Commands added:
- `flink kubernetes-cluster list`            List all registered clusters
- `flink kubernetes-cluster describe <name>` Describe a cluster
- `flink kubernetes-cluster update <name> --lifecycle-state <state>`
  Update lifecycle state (ACTIVE or DECOMMISSIONED)

SDK upgrade (v0.0.5 → v0.0.6):
- Picks up the new KubernetesClusters API and generated mocks
- Fixes PostEnvironment.Name (*string): use SetName()/GetName()
- Works around ComputePool.Status type regression in v0.0.6 caused by
  additionalProperties: true in the spec generating an incorrect
  *map[string]map[string]interface{} type; adds computePoolPhase()
  helper to preserve Phase output in tests until fixed upstream

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vsantwana Santwana Verma (vsantwana) requested a review from a team as a code owner April 14, 2026 09:56
Copilot AI review requested due to automatic review settings April 14, 2026 09:56
@confluent-cla-assistant
Copy link
Copy Markdown

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds CMF (on-prem Flink) support for managing registered Kubernetes clusters via new CLI commands, alongside an SDK bump and related compatibility updates.

Changes:

  • Introduces flink kubernetes-cluster command group with list, describe, and update subcommands.
  • Upgrades github.com/confluentinc/cmf-sdk-go to v0.0.6 and updates environment/create+update call sites to use SDK getters/setters.
  • Adapts compute pool phase handling to the SDK’s updated ComputePool.Status shape and updates the on-prem test server accordingly.

Reviewed changes

Copilot reviewed 27 out of 28 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/flink/command.go Registers the new kubernetes-cluster command group under flink.
internal/flink/command_kubernetes_cluster.go Adds command group + output model + SDK→local conversion helper.
internal/flink/command_kubernetes_cluster_list.go Implements listing Kubernetes clusters from CMF with human/serialized output.
internal/flink/command_kubernetes_cluster_describe.go Implements describing a single Kubernetes cluster.
internal/flink/command_kubernetes_cluster_update.go Implements updating cluster lifecycle state.
pkg/flink/cmf_rest_client.go Adds CMF REST client methods for Kubernetes cluster list/describe/update; updates env name getter usage.
internal/flink/local_types.go Adds local serialized types for Kubernetes cluster output.
internal/flink/command_environment_create.go Switches to PostEnvironment.SetName() for SDK v0.0.6.
internal/flink/command_environment_update.go Switches to PostEnvironment.SetName() for SDK v0.0.6.
internal/flink/command_compute_pool.go Adds computePoolPhase() workaround for SDK status type change.
internal/flink/command_compute_pool_list_onprem.go Uses computePoolPhase() for phase rendering.
internal/flink/command_compute_pool_describe_onprem.go Uses computePoolPhase() for phase rendering.
internal/flink/command_compute_pool_create_onprem.go Uses computePoolPhase() for phase rendering.
test/test-server/flink_onprem_handler.go Adjusts test server compute pool status JSON to match new SDK status shape; uses env getters.
pkg/flink/test/mock/*.go Regenerates several gomock mocks (notably changing gomock import path).
go.mod / go.sum Bumps cmf-sdk-go to v0.0.6 and adds github.com/golang/mock.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread go.mod
github.com/go-jose/go-jose/v3 v3.0.5
github.com/gobuffalo/flect v1.0.2
github.com/gogo/protobuf v1.3.2
github.com/golang/mock v1.6.0
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repo already depends on go.uber.org/mock (and many tests import go.uber.org/mock/gomock), but this PR adds github.com/golang/mock and regenerates several mocks against that package. Mixing these two gomock packages will break compilation because the Controller/Call types are not interchangeable. Please standardize on one gomock implementation (either switch all tests + remaining mocks to github.com/golang/mock/gomock, or revert these regenerated mocks and the new dependency back to go.uber.org/mock/gomock) and regenerate consistently.

Suggested change
github.com/golang/mock v1.6.0

Copilot uses AI. Check for mistakes.

types "github.com/confluentinc/cli/v4/pkg/flink/types"
gomock "go.uber.org/mock/gomock"
gomock "github.com/golang/mock/gomock"
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This generated mock now imports github.com/golang/mock/gomock, but other mocks/tests in the repo still use go.uber.org/mock/gomock. As a result, callers that create a *go.uber.org/mock/gomock.Controller cannot pass it into mocks generated against github.com/golang/mock/gomock (type mismatch). Please regenerate all mocks and update all tests to use a single gomock package consistently.

Suggested change
gomock "github.com/golang/mock/gomock"
gomock "go.uber.org/mock/gomock"

Copilot uses AI. Check for mistakes.
Comment thread internal/flink/command.go
Comment on lines 41 to 44
cmd.AddCommand(c.newDetachedSavepointCommand())
cmd.AddCommand(c.newEnvironmentCommand())
cmd.AddCommand(c.newKubernetesClusterCommand())
cmd.AddCommand(c.newSavepointCommand())
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description's release notes and checklist are still placeholders/unchecked, but this PR adds a new user-facing CLI command group (flink kubernetes-cluster). Please update the PR description to include real release notes entries and complete the checklist (or remove irrelevant sections) so reviewers can assess breaking changes, customer impact, and verification steps.

Copilot uses AI. Check for mistakes.
- Add integration tests for kubernetes-cluster list, describe, update
  commands with human, JSON, and YAML output formats
- Add test server handlers for kubernetes-clusters endpoints
- Add --kubernetes-cluster-name flag to environment create command
- Show kubernetes cluster name in environment list and describe output
- Update environment golden files for new cluster name field

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

2 participants