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

feat: Pod PVC Chaos #79

Merged
merged 3 commits into from
Mar 26, 2024
Merged

feat: Pod PVC Chaos #79

merged 3 commits into from
Mar 26, 2024

Conversation

miketonks-form3
Copy link

@miketonks-form3 miketonks-form3 commented Mar 22, 2024

What problem does this PR solve?

Adds new chaos experiment type, which deletes the PVC from a Pod, and restarts the Pod.

What's changed and how it works?

We considered making this an extension to PodChaos, but instead opted for a new chaos type. We reuse the PodSelector from PodChaos, and add a VolumeName field.

Apply deleted both the PVC and the Pod in one pass, I don't think there's any need to wait between these steps.

Tested locally and works ok.

Related changes

  • This change also requires further updates to the website (e.g. docs)
  • This change also requires further updates to the UI interface

Cherry-pick to release branches (optional)

This PR should be cherry-picked to the following release branches:

  • release-2.6
  • release-2.5

Checklist

CHANGELOG

Must include at least one of them.

  • I have updated the CHANGELOG.md
  • I have labeled this PR with "no-need-update-changelog"

Tests

Must include at least one of them.

  • Unit test
  • E2E test
  • Manual test

Side effects

  • Breaking backward compatibility

DCO

If you find the DCO check fails, please run commands like below (Depends on the actual situations. For example, if the failed commit isn't the most recent) to fix it:

git commit --amend --signoff
git push --force

@miketonks-form3 miketonks-form3 requested a review from a team as a code owner March 22, 2024 11:21
Copy link

Created new release based on commit 00b605a

Release tag: v2.6.1-f3-00b60-feature-pvc-chaos

Link to release

Copy link

Created new release based on commit 94ad812

Release tag: v2.6.1-f3-94ad8-feature-pvc-chaos

Link to release

controllers/chaosimpl/podpvcchaos/impl.go Show resolved Hide resolved
type PodPVCSpec struct {
Pod types.NamespacedName
PVC types.NamespacedName
// Namespace string `json:"namespace,omitempty"`

Choose a reason for hiding this comment

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

How come you switched from the commented out implementation? Don't the pod and PVC have to be in the same namespace?

Copy link
Author

Choose a reason for hiding this comment

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

It seemed neater - we need them in this format later, and this is only internal construct

Choose a reason for hiding this comment

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

Maybe good to delete the commented out implementation then

generic.Option
}

type PodPVCSpec struct {

Choose a reason for hiding this comment

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

I found this name confusing when reading the Apply implementation - given the spec suffix on types in api/v1alpha1.

Maybe PodPVCIdentifier or something?

Copy link
Author

Choose a reason for hiding this comment

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

Looking at k8sChaos, Target would be consistent. I copied from ResourceScaleChaos, I agree it's a bit of a vague name

Copy link

Created new release based on commit 82caf69

Release tag: v2.6.1-f3-82caf-feature-pvc-chaos

Link to release

Copy link

Created new release based on commit f462895

Release tag: v2.6.1-f3-f4628-feature-pvc-chaos

Link to release

@miketonks-form3 miketonks-form3 merged commit c69e177 into master Mar 26, 2024
46 of 47 checks passed
@miketonks-form3 miketonks-form3 deleted the feature-pvc-chaos branch March 26, 2024 08:46
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.

2 participants