Skip to content

scripts: add migration script from public operator to cloud operator.#459

Merged
prafull01 merged 3 commits intomasterfrom
operator-migration-public
Mar 25, 2025
Merged

scripts: add migration script from public operator to cloud operator.#459
prafull01 merged 3 commits intomasterfrom
operator-migration-public

Conversation

@jmcarp
Copy link
Copy Markdown
Contributor

@jmcarp jmcarp commented Feb 14, 2025

Check in a reference implementation for migrating from statesets managed by the public operator to the cloud operator. Note that this process involves some manual steps, and we may want to automate and test it further.

@jmcarp jmcarp requested a review from prafull01 February 14, 2025 18:43
@jmcarp jmcarp force-pushed the operator-migration-public branch from 2ef1d80 to c1386ab Compare February 14, 2025 19:50
@jmcarp jmcarp force-pushed the operator-migration-public branch 2 times, most recently from 483cd20 to 8ad5f04 Compare March 13, 2025 15:50
@jmcarp jmcarp changed the base branch from poc-deploy-operator to master March 13, 2025 16:16
@jmcarp jmcarp force-pushed the operator-migration-public branch 3 times, most recently from b831b67 to 86e56d4 Compare March 18, 2025 03:44
Copy link
Copy Markdown
Contributor

@prafull01 prafull01 left a comment

Choose a reason for hiding this comment

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

Changes are working as expected with some modifications. I have left those as comments. After this many comments, I'm half expecting you to blacklist me 😆

@jmcarp jmcarp force-pushed the operator-migration-public branch from 86e56d4 to bc2873a Compare March 18, 2025 13:39
@jmcarp jmcarp marked this pull request as ready for review March 20, 2025 11:24
jmcarp and others added 2 commits March 20, 2025 07:25
Check in a reference implementation for migrating from statesets managed
by the public operator to the cloud operator. Note that this process
involves some manual steps, and we may want to automate and test it
further.
@jmcarp jmcarp force-pushed the operator-migration-public branch 2 times, most recently from 72279d8 to c7e84bc Compare March 20, 2025 13:00
@jmcarp jmcarp force-pushed the operator-migration-public branch from c7e84bc to 87a8b51 Compare March 20, 2025 13:06

# Delete public operator resources and crd.
kubectl delete -f https://raw.githubusercontent.com/cockroachdb/cockroach-operator/v2.17.0/install/crds.yaml
kubectl delete -f https://raw.githubusercontent.com/cockroachdb/cockroach-operator/v2.17.0/install/operator.yaml
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we need to be careful here, if i set export NAMESPACE=cockroach-operator-system and the above commands will actually try to delete the same namespace, so the next operations won't work.

We need to specify to not set the NAMESPACE to cockroach-operator-system

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actually this is fair point. If user have the crdbcluster CR in cockroach-operator-system then the statefulset is present in that namespace. This operation will delete the entire namespace and can cause data loss .

We should explicitly specify the resources we want to delete, rather than deleting from this link.

kubectl apply -f https://raw.githubusercontent.com/cockroachdb/cockroach-operator/v2.17.0/install/operator.yaml

kubectl apply -f https://raw.githubusercontent.com/cockroachdb/cockroach-operator/v2.17.0/examples/example.yaml
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As we mentioned export NAMESPACE=default, we can explicitly specify here to deploy example.yaml in the same namespace.

Following these commands will install crdbcluster in cockroach-operator-system namespace created while installing operator.


```
kubectl apply -f manifests/crdbnode-2.yaml
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we have a note here, while repeating the process they need decrease replicas and use the respective manifest file.

@prafull01 prafull01 merged commit 18123ce into master Mar 25, 2025
8 of 9 checks passed
@prafull01 prafull01 deleted the operator-migration-public branch March 25, 2025 08:02
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.

3 participants