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

Move atlantis-data volume to a separate PVC #304

Merged

Conversation

BrunoTarijon
Copy link
Contributor

what

Remove the atlantis-data volume creation from the sts and add a separate PVC.

why

We can not change the storage size without deleting the deployed sts.

tests

I have tested the logic using the helm template function to generate the manifests with the volumeClaim interface and the deprecated .Values.dataStorage.

@BrunoTarijon BrunoTarijon requested a review from a team as a code owner June 21, 2023 22:43
@GenPage
Copy link
Member

GenPage commented Sep 11, 2023

@BrunoTarijon LGTM, can you bump the chart version? It can be just a patch bump.

@BrunoTarijon
Copy link
Contributor Author

@BrunoTarijon LGTM, can you bump the chart version? It can be just a patch bump.

@GenPage ok, done

@bsvartz
Copy link

bsvartz commented Sep 28, 2023

@BrunoTarijon, @GMartinez-Sisti - is it possible to add the option to edit on this file:

https://github.com/runatlantis/helm-charts/blob/f56c4caa0fe5c83052d4f0b42f67c0d7f0e9d122/charts/atlantis/templates/pvc.yaml

spec:
  accessModes:
    - ReadWriteOnce

to ReadWriteMany - in order to support the following feature? runatlantis/atlantis#3795?

and this:

  volumeClaimTemplates:
  - metadata:
      name: atlantis-data
    spec:
      accessModes: ["ReadWriteOnce"] # Volume should not be shared by multiple nodes.

on this file:
https://github.com/runatlantis/helm-charts/blob/f56c4caa0fe5c83052d4f0b42f67c0d7f0e9d122/charts/atlantis/templates/statefulset.yaml

Generally - i want to be able to share the same volume between multiple atlantis instances.

@BrunoTarijon
Copy link
Contributor Author

@bsvartz I have added the requested feature.

@GenPage. Does it look good to you? Can we merge it?

@GMartinez-Sisti
Copy link
Member

@bsvartz I have added the requested feature.

@GenPage. Does it look good to you? Can we merge it?

I think the idea was to make it configurable in the values file. Leaving the default as it was before, but you configure what you want.

@jamengual jamengual added the waiting-on-response Waiting for a response from the user label Nov 16, 2023
@jamengual
Copy link
Contributor

@BrunoTarijon could you fix the conflicts? Thanks.

@matilote
Copy link

matilote commented Jan 9, 2024

Any chance to resolve the conflicts and get this merged?

@BrunoTarijon
Copy link
Contributor Author

Sorry for not seeing this for a while. I have made the custom access mode in the PVC and chose not to change the STS configuration for the access mode because it is marked as deprecated.

@jamengual I have resolved the conflicts.

Copy link

This issue is stale because it has been open for 1 month with no activity. Remove stale label or comment or this will be closed in 1 month.

@github-actions github-actions bot added the Stale label Feb 29, 2024
@BrunoTarijon BrunoTarijon requested a review from a team as a code owner February 29, 2024 03:11
@BrunoTarijon
Copy link
Contributor Author

Hey guys (@jamengual @GenPage) just receive the Stale label, could you review this PR?

@jamengual jamengual removed the Stale label Feb 29, 2024
@jamengual
Copy link
Contributor

@GMartinez-Sisti

@jamengual
Copy link
Contributor

@BrunoTarijon we have unit test now, could you take a look?

@BrunoTarijon
Copy link
Contributor Author

Done @jamengual

Co-authored-by: Gabriel Martinez <[email protected]>
@GMartinez-Sisti
Copy link
Member

GMartinez-Sisti commented Mar 5, 2024

@BrunoTarijon looks like something needs to be fixed. The error is:

4m33s Warning FailedCreate statefulset/atlantis-wbp015wolz statefulset-controller create Pod atlantis-wbp015wolz-0 in StatefulSet atlantis-wbp015wolz failed error: Pod "atlantis-wbp015wolz-0" is invalid: spec.containers[0].volumeMounts[0].name: Not found: "atlantis-data" 10m 17 atlantis-wbp015wolz.17b9e455ea79e80f

Please adjust the ci files on https://github.com/runatlantis/helm-charts/tree/main/charts/atlantis/ci and create a new one to include your change. The only requirement is that filenames end with *-values.yaml.

Let us know if you need help 😃

Copy link
Contributor Author

@BrunoTarijon BrunoTarijon left a comment

Choose a reason for hiding this comment

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

Fix the test by adding the volume to the sts.

@@ -239,11 +234,11 @@ tests:
tlsSecretName: test-tls
asserts:
- equal:
path: spec.template.spec.volumes
path: spec.template.spec.volumes[1]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Testing the specific volume for each test.

@BrunoTarijon
Copy link
Contributor Author

BrunoTarijon commented Mar 5, 2024

Please adjust the ci files on https://github.com/runatlantis/helm-charts/tree/main/charts/atlantis/ci and create a new one to include your change. The only requirement is that filenames end with *-values.yaml.

Don't get it. This feat should work with the default values.

cc: @GMartinez-Sisti

@GMartinez-Sisti
Copy link
Member

Please adjust the ci files on https://github.com/runatlantis/helm-charts/tree/main/charts/atlantis/ci and create a new one to include your change. The only requirement is that filenames end with *-values.yaml.

Don't get it. This feat should work with the default values.

cc: @GMartinez-Sisti

Fair enough. Now the tests are passing.

@GMartinez-Sisti GMartinez-Sisti merged commit 4cdb790 into runatlantis:main Mar 6, 2024
2 checks passed
@tetsuya28 tetsuya28 mentioned this pull request Mar 6, 2024
@cilindrox
Copy link
Contributor

This should've been a major release - breaks existing installs using the STS pv

@bergemalm
Copy link

Yep, breaking change!

@GMartinez-Sisti
Copy link
Member

This should've been a major release - breaks existing installs using the STS pv

Yep, breaking change!

In hindsight, you are both right. Our tests install everything from scratch, but they don't contemplate upgrades.

I tested by installing 4.21.1 and then tried to upgrade to 4.22.0 and got an error:

→ helm install atlantis runatlantis/atlantis --version 4.21.1
NAME: atlantis
LAST DEPLOYED: Fri Apr  5 18:59:30 2024
NAMESPACE: default
STATUS: deployed
REVISION: 1
NOTES:
1. Get the application URL by running these commands:
2. Atlantis will not start successfully unless at least one of the following sets of credentials are specified (see values.yaml for detailed usage):
  - github
  - githubApp
  - gitlab
  - bitbucket
→ helm upgrade atlantis runatlantis/atlantis --version 4.22.0
W0405 18:59:46.772125   48368 warnings.go:70] unknown field "labels"
Error: UPGRADE FAILED: cannot patch "atlantis" with kind StatefulSet: StatefulSet.apps "atlantis" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordinals', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden

We might create a new major release with update steps to fix this. Discussing with the other maintainers. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-on-response Waiting for a response from the user
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants