Skip to main content

diagrid k8s-operator migrate

Migrate a Kubernetes namespace to Catalyst

Description

Migrate an existing Kubernetes namespace to Catalyst using the operator.

The target namespace can hold Dapr OSS workloads or plain Kubernetes workloads. This command:

• creates a Catalyst Project resource the operator reconciles into a real project (with the managed default components you select), • translates each workload's pod-template annotations from dapr.io/* to catalyst.diagrid.io/* (enabled, app-id, project, host, app-port), and • annotates any Dapr CRDs (Components, Subscriptions, ...) with the project so the operator migrates them to Catalyst.

By default only workloads currently annotated with dapr.io/enabled="true" are migrated; pass --all-workloads to migrate every workload in the namespace.

Use --new-namespace to copy the namespace's resources into a fresh namespace (with the Catalyst annotations applied) and leave the original untouched — the recommended way to cut over while keeping the OSS version running.

diagrid k8s-operator migrate <namespace> [flags]

Examples


# Migrate the "orders" namespace in place (project defaults to "orders")
diagrid k8s-operator migrate orders

# Migrate into a new namespace, keeping the original intact
diagrid k8s-operator migrate orders --new-namespace orders-catalyst

# Choose a project name and region explicitly
diagrid k8s-operator migrate orders --project payments --region aws-us-east

# Run sidecars in-cluster (local mode) and migrate every workload
diagrid k8s-operator migrate orders --host local --all-workloads

# Preview the changes without applying them
diagrid k8s-operator migrate orders --dry-run

Options

-p, --project string Catalyst project name. Defaults to the namespace name.
-r, --region string Region ID for the Catalyst project. Defaults to your only region, or prompts when several exist.
--new-namespace string Copy resources into this new namespace instead of modifying the original in place.
--host string Sidecar mode written to catalyst.diagrid.io/host: 'remote' (managed cloud) or 'local' (in-cluster). (default "remote")
--enabled Value written to catalyst.diagrid.io/enabled (opts workloads into sidecar injection). (default true)
--all-workloads Migrate every workload, not just those currently annotated with dapr.io/enabled=true.
--default-pubsub Enable the managed default pub/sub component on the project. (default true)
--default-kvstore Enable the managed default key/value store on the project. (default true)
--default-workflowstore Enable the managed default workflow store on the project. (default true)
--kubeconfig string Path to the kubeconfig file. Defaults to the standard resolution (KUBECONFIG / ~/.kube/config).
--context string Name of the kube context to operate on. Defaults to your current context.
--dry-run Print the changes that would be made without applying them.
--project-ready-timeout duration How long to wait for the project to be provisioned before updating workloads. (default 2m0s)
-h, --help help for migrate

SEE ALSO