rpk k8s multicluster bootstrap
Bootstrap the TLS certificates and kubeconfig secrets that the multicluster operators of a Stretch Cluster need to communicate across Kubernetes clusters.
This command connects to each specified Kubernetes context, generates a shared CA certificate, and distributes per-cluster TLS certificates and kubeconfig secrets so that the multicluster operator can communicate across clusters.
If --kubeconfig is provided, all contexts in the file are used automatically
and --context flags are not required. If both are provided, only the specified
contexts from the kubeconfig file are used.
--loadbalancer provisions a standalone LoadBalancer Service on each cluster
before signing certificates, waits for the cloud provider to assign an
external address, and bakes that address into the cert SANs. This resolves
the deploy/redeploy cycle that otherwise forces a first helm install just
to learn each cluster’s external IP/hostname. The resulting peer list is
printed on success for pasting into helm values.
--output=yaml skips applying anything and writes manifests as YAML. No
cluster contact or kubeconfig is needed: cluster names are derived from
--context flags (LB mode) or --dns-override keys (bootstrap mode).
When --output-dir <dir> is set, one file per cluster is written into the
directory as <context>.yaml. This is required for the TLS bootstrap path
because each cluster’s tls.key is per-cluster identity material that
must not be applied to other clusters. The LoadBalancer-only step has
no secrets and additionally allows streaming to stdout (split on '---'
with comment headers).
Use this for GitOps pipelines that commit manifests and apply them via
Argo, Flux, or similar.
Two-step GitOps workflow:
-
bootstrap
--output=yaml--loadbalancer--context<ctx> … Emits only LoadBalancer Service manifests. Apply them, wait for the cloud provider to assign external addresses. -
bootstrap
--output=yaml--output-dir<dir>--dns-overridectx=<address> … Emits Namespace and TLS Secret manifests into<dir>/<ctx>.yamlwith the known addresses baked into the cert SANs.
When --loadbalancer is NOT set, --dns-override is required for every
cluster; cluster names are derived from the override keys.
ServiceAccount, SA token, and kubeconfig cache Secrets are not emitted
because the operator regenerates them at runtime.
Examples
This section provides examples of how to use rpk k8s multicluster bootstrap.
Bootstrap all clusters from a kubeconfig file:
rpk k8s multicluster bootstrap \
--kubeconfig /path/to/kubeconfig \
--namespace redpanda
Bootstrap specific contexts (uses default kubeconfig loading rules):
rpk k8s multicluster bootstrap \
--context cluster-a --context cluster-b --context cluster-c \
--namespace redpanda
Override the TLS secret prefix when Helm release names differ from context names:
rpk k8s multicluster bootstrap \
--context cluster-a --context cluster-b --context cluster-c \
--name-override cluster-a=redpanda-operator \
--name-override cluster-b=redpanda-operator \
--name-override cluster-c=redpanda-operator \
--namespace redpanda
Override DNS names for TLS SANs on specific clusters:
rpk k8s multicluster bootstrap \
--context cluster-a --context cluster-b \
--dns-override cluster-a=cluster-a.example.com \
--dns-override cluster-b=cluster-b.example.com \
--namespace redpanda
Provision LoadBalancer Services and use their addresses for certificate SANs:
rpk k8s multicluster bootstrap \
--kubeconfig /path/to/kubeconfig \
--namespace redpanda \
--loadbalancer
Bootstrap only TLS certificates:
rpk k8s multicluster bootstrap \
--kubeconfig /path/to/kubeconfig \
--namespace redpanda \
--tls --kubeconfigs=false
GitOps step 1, emit LoadBalancer Service manifests (no kubeconfig needed):
rpk k8s multicluster bootstrap \
--context cluster-a --context cluster-b \
--namespace redpanda \
--loadbalancer \
--output=yaml > multicluster-services.yaml
GitOps step 2, emit Namespace and TLS Secret manifests (no kubeconfig needed):
rpk k8s multicluster bootstrap \
--namespace redpanda \
--dns-override cluster-a=cluster-a.example.com \
--dns-override cluster-b=cluster-b.example.com \
--output=yaml --output-dir ./multicluster-bootstrap
Flags
| Value | Type | Description |
|---|---|---|
|
strings |
Kubernetes contexts. Repeatable. If omitted with |
|
bool |
Create the namespace if it does not exist (default true). |
|
stringArray |
DNS override for TLS SANs, in |
|
string |
Path to a kubeconfig file (all contexts in the file are used unless |
|
bool |
Bootstrap kubeconfig secrets (default true). |
|
bool |
Provision a standalone LoadBalancer Service per cluster and use its external address for TLS SANs. |
|
duration |
Per-cluster timeout waiting for a LoadBalancer address (0 = default of 10m). |
|
stringArray |
Override the TLS secret prefix for a context, in |
|
string |
Namespace for operator resources (default |
|
string |
Organization name for generated TLS certificates (default "Redpanda"). |
|
string |
Output mode. Empty (the default) applies resources to clusters. |
|
string |
With |
|
string |
Operator deployment label selector value ( |
|
bool |
Bootstrap TLS certificates (default true). |
Global flags
| Value | Type | Description |
|---|---|---|
|
string |
Redpanda or |
|
stringArray |
Override |
|
bool |
Ignore |
|
string |
|
|
bool |
Enable verbose logging. |