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

Add v2 migrations steps #1172

Merged
merged 7 commits into from
Dec 1, 2020
Merged

Add v2 migrations steps #1172

merged 7 commits into from
Dec 1, 2020

Conversation

pmalek-sumo
Copy link
Contributor

Description

Add v2 migrations steps

Testing performed
  • ci/build.sh
  • Redeploy fluentd and fluentd-events pods
  • Confirm events, logs, and metrics are coming in

@pmalek-sumo pmalek-sumo added this to the v2.0 milestone Nov 25, 2020
@pmalek-sumo pmalek-sumo self-assigned this Nov 25, 2020
@pmalek-sumo pmalek-sumo requested a review from a team November 25, 2020 15:13
@pmalek-sumo pmalek-sumo force-pushed the docs-add-v2-migration-steps branch from 1cdc2d1 to 4d992a6 Compare November 25, 2020 15:44
- Run `curl` the upgrade script as follows:

```bash
curl -LJO https://raw.githubusercontent.com/SumoLogic/sumologic-kubernetes-collection/main/deploy/helm/sumologic/upgrade-2.0.0.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

please remember to upgrade it when the release 2.0 branch will be created

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pmalek-sumo pmalek-sumo force-pushed the docs-add-v2-migration-steps branch from 4d992a6 to 3edf5a7 Compare November 26, 2020 17:56
@pmalek-sumo pmalek-sumo force-pushed the docs-add-v2-migration-steps branch from 3edf5a7 to df254f3 Compare November 30, 2020 10:52
to that version first by running the below command.

```bash
helm upgrade collection sumologic/sumologic --reuse-values --version=1.3.2
Copy link
Contributor

Choose a reason for hiding this comment

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

could we test against --reuse-values? AFAIK changes in values.yaml won't be applied

- Run the upgrade script on the above file with the below command.

```bash
./upgrade-2.0.0.sh current_values.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe before this step we should add chmod +x upgrade-2.0.0.sh. It is quite obvious but usually this step appears in instructions, e.g. here and here

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm testing on vagrant VM created from release-v1.3 branch, commit: 2fac768.
I see following error:

./upgrade-2.0.0.sh current_values.yaml
[INFO]    Mapping fluentd.image.repository into:
[INFO]    Mapping fluentd.image.tag into:
[INFO]    Mapping image.repository into:
[INFO]    - fluentd.image.repository
[INFO]    - sumologic.setup.job.image.repository
[INFO]    Mapping image.tag into:
[INFO]    - fluentd.image.tag
[INFO]    - sumologic.setup.job.image.tag

[INFO]    Migrating prometheus-config-reloader container to config-reloader in prometheusSpec
Error: unknown flag: --arrays

yq version:

$ yq --version
yq version 3.3.0

Copy link
Contributor Author

@pmalek-sumo pmalek-sumo Nov 30, 2020

Choose a reason for hiding this comment

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

Good point

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You'll need yq at least at version 3.4.0

The following handles that at VM provision time but you can run it manually

# install yq with access to file structure
curl https://github.com/mikefarah/yq/releases/download/3.4.1/yq_linux_amd64 -L -o /usr/local/bin/yq-3.4.1
chmod +x /usr/local/bin/yq-3.4.1
ln -s /usr/local/bin/yq-3.4.1 /usr/local/bin/yq

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm testing from release-v1.3 branch, https://github.com/SumoLogic/sumologic-kubernetes-collection/blob/release-v1.3/vagrant/provision.sh#L56

May we mention required yq version in this instruction?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, apparently I missed and incorrectly changed the v2 update script

it should be fixed (i.e. user will get a notification about required yq version) via:

https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/1172/files#diff-e010a115e1f3b27c1977c58d40e6aad5860cb28d7beb501161fb7d4a9358e6cc

- At this point, users can then run:

```bash
helm upgrade collection sumologic/sumologic --version=2.0.0 -f new_values.yaml
Copy link
Contributor

@kasia-kujawa kasia-kujawa Nov 30, 2020

Choose a reason for hiding this comment

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

As 2.0.0 release is not available yet. I tested with dev version - 2.0.0-dev.0-133-g6e362ae, so I added dev helm repo:

$ helm repo list
NAME         	URL
sumologic    	https://sumologic.github.io/sumologic-kubernetes-collection
sumologic-dev	https://sumologic.github.io/sumologic-kubernetes-collection/dev

and I see following error:

$ helm upgrade collection sumologic-dev/sumologic --version=2.0.0-dev.0-133-g6e362ae -f new_values.yaml -n sumologic
Error: UPGRADE FAILED: cannot patch "collection-fluent-bit" with kind DaemonSet: DaemonSet.apps "collection-fluent-bit" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app.kubernetes.io/instance":"collection", "app.kubernetes.io/name":"fluent-bit"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable && cannot patch "collection-sumologic-fluentd-events" with kind StatefulSet: StatefulSet.apps "collection-sumologic-fluentd-events" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden && cannot patch "collection-sumologic-fluentd-metrics" with kind StatefulSet: StatefulSet.apps "collection-sumologic-fluentd-metrics" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden && cannot patch "collection-sumologic-fluentd-logs" with kind StatefulSet: StatefulSet.apps "collection-sumologic-fluentd-logs" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So this is most likely connected to labels and/or statefulset's volume claim when fluentd.persistence is enabled.

{{- if .Values.fluentd.persistence.enabled }}
volumeClaimTemplates:
- metadata:
name: buffer
spec:
accessModes: [{{ .Values.fluentd.persistence.accessMode }}]
storageClassName: {{ .Values.fluentd.persistence.storageClass }}
resources:
requests:
storage: {{ .Values.fluentd.persistence.size }}
{{- end }}

I'll add warning to upgrade 2.0.0 script, make it leave persistence as disabled if user set it as such and add short doc about how to enable it.

@pmalek-sumo pmalek-sumo merged commit 3c3acd4 into main Dec 1, 2020
@pmalek-sumo pmalek-sumo deleted the docs-add-v2-migration-steps branch December 1, 2020 11:01
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.

4 participants