Skip to content

Multi-cluster with kubebuilder #2729

Closed Answered by camilamacedo86
HamzaZo asked this question in Support
Discussion options

You must be logged in to vote

Hi @HamzaZo,

I think you might able to achieve this by setting up a combined kubeconfig with contexts for each of the clusters such as follows:

  • Combine kubeconfigs:

First, ensure that your kubeconfig has contexts set up for both the clusters. This usually involves merging multiple kubeconfig files or manually adding cluster, user, and context entries.

  • Initialize Controller Manager:
    Set up a single controller-runtime Manager.
var mgr, err = ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
   Scheme:             scheme,
   MetricsBindAddress: metricsAddr,
   Port:               9443,
   // other necessary configurations
})
  • Context-Specific Clients:
    When you want your reconciler to …

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@HamzaZo
Comment options

@camilamacedo86
Comment options

@HamzaZo
Comment options

@camilamacedo86
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by camilamacedo86
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Support
Labels
None yet
3 participants