Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: upgrade path from Operator v1 to v2 #558

Merged
merged 5 commits into from
Dec 13, 2023
Merged

Conversation

WanzenBug
Copy link
Member

This adds a guide for upgrading an existing Piraeus Operator deployment from v1 to v2, along with some necessary changes
and fixes to the helm chart.

Closes #410

@WanzenBug WanzenBug force-pushed the helm-chart-upgrades branch 6 times, most recently from 7d951c2 to 545421b Compare November 10, 2023 08:55
@WanzenBug WanzenBug force-pushed the helm-chart-upgrades branch 4 times, most recently from 3e76923 to 8da9f8c Compare November 20, 2023 09:29
Copy link
Contributor

@phoenix-bjoern phoenix-bjoern left a comment

Choose a reason for hiding this comment

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

@WanzenBug Did a quick review of the documentation. Will perform a test run in the next few days.

docs/how-to/upgrade/2-collect-information.md Outdated Show resolved Hide resolved
docs/how-to/upgrade/2-collect-information.md Outdated Show resolved Hide resolved
docs/how-to/upgrade/2-collect-information.md Outdated Show resolved Hide resolved
docs/how-to/upgrade/2-collect-information.md Outdated Show resolved Hide resolved
@WanzenBug WanzenBug force-pushed the helm-chart-upgrades branch 3 times, most recently from e424275 to 67425e0 Compare November 30, 2023 14:40
@WanzenBug WanzenBug marked this pull request as ready for review December 1, 2023 08:45
@WanzenBug WanzenBug force-pushed the helm-chart-upgrades branch 2 times, most recently from 96b7da8 to ea34acf Compare December 1, 2023 11:42
@WanzenBug WanzenBug added documentation Improvements or additions to documentation v2 This affects only Operator v2 labels Dec 13, 2023
Copy link
Collaborator

@JoelColledge JoelColledge left a comment

Choose a reason for hiding this comment

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

Fantastic! This is a major project.

Bold to do the conversion in bash with 1000 jq calls.

The script itself I only glanced through.

docs/how-to/upgrade/index.md Outdated Show resolved Hide resolved
docs/how-to/upgrade/index.md Outdated Show resolved Hide resolved
docs/how-to/upgrade/2-collect-information.md Outdated Show resolved Hide resolved
exit 1
}

format_patch() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This script would be easier to understand and review if these functions documented what they expect on stdin, what they generate on stdout, and what the parameters are. For the last part, naming the parameters with local kind="$1" would do.

Is it worth it?

Copy link
Member Author

Choose a reason for hiding this comment

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

I added some documentation. Not sure how helpful it is. I'm kind of amazed that it works at all, but it actually is quite nice to use 😄

if [ "$(jq -r '.items[0].spec.kubeletPath' "$TEMPDIR/linstorcsidrivers.json")" != "/var/lib/kubelet" ]; then
echo "Found non-standard kubelet path"
jq '.items[0].spec.kubeletPath' "$TEMPDIR/linstorcsidrivers.json" \
| format_patch DaemonSet linstor-csi-node '{"apiVersion": "apps/v1", "kind": "DaemonSet", "metadata": {"name": "linstor-csi-node"}, "spec": {"template": {"spec": {"containers": [{"name": "linstor-csi", "volumeMounts": [{"name": "publish-dir", "mountPath": "/var/lib/kubelet", "$patch": "delete"}, {"name": "publish-dir", "mountPath": ., "mountPropagation": "Bidirectional"}]}]}}}}' \
Copy link
Collaborator

Choose a reason for hiding this comment

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

}]}]}}}} 😮 Not bad going.

@WanzenBug WanzenBug force-pushed the helm-chart-upgrades branch 2 times, most recently from 2d270df to 4ee9927 Compare December 13, 2023 13:48
Copy link
Collaborator

@JoelColledge JoelColledge left a comment

Choose a reason for hiding this comment

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

The final 2 commits should really be squashed into the appropriate previous commits. There are a few other details that have slipped into the wrong commit, but that doesn't really matter in this case.

The resulting docs look good to me.

Adds a guide on how to perform a linstor database migration for Operator v1.
This is the first step in making the migration from Operator v1 to v2.

Signed-off-by: Moritz Wanzenböck <moritz.wanzenboeck@linbit.com>
Add a script that records information about an existing v1 deployment
and tries to convert it to the v2 equivalent where it makes sense.

Also add a short guide on how to use the script.

Signed-off-by: Moritz Wanzenböck <moritz.wanzenboeck@linbit.com>
Signed-off-by: Moritz Wanzenböck <moritz.wanzenboeck@linbit.com>
Signed-off-by: Moritz Wanzenböck <moritz.wanzenboeck@linbit.com>
This index also contains the main changes between the different operator
versions.

Signed-off-by: Moritz Wanzenböck <moritz.wanzenboeck@linbit.com>
@WanzenBug
Copy link
Member Author

There are a few other details that have slipped into the wrong commit

At some point I'm going to automate my whole workflow of git commit --fixup so this stuff doesn't happen again 😛

Fixed the commits to be in some logical order.

@JoelColledge
Copy link
Collaborator

At some point I'm going to automate my whole workflow of git commit --fixup so this stuff doesn't happen again 😛

git fixup -c helps.

@WanzenBug WanzenBug merged commit 743d97d into v2 Dec 13, 2023
4 checks passed
@WanzenBug WanzenBug deleted the helm-chart-upgrades branch December 13, 2023 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation v2 This affects only Operator v2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[v2]: Upgrades
3 participants