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

[NET-4144] add gateway pdb #2985

Closed
wants to merge 26 commits into from
Closed

[NET-4144] add gateway pdb #2985

wants to merge 26 commits into from

Conversation

kkavish
Copy link

@kkavish kkavish commented Sep 21, 2023

Changes proposed in this PR:

  • Add PDB for all gateways

How I've tested this PR:
manually

How I expect reviewers to test this PR:

  • Deploy consul k8s cluster using kind with gateways, check kubectl get poddisruptionbudget -n for PDBs
  • Unit tests

Checklist:

- PDB for gateways
- PDB for gateways
- CHANGELOG.md
@hashicorp-cla
Copy link

hashicorp-cla commented Sep 21, 2023

CLA assistant check
All committers have signed the CLA.

@kkavish kkavish added the pr/no-backport signals that a PR will not contain a backport label label Sep 21, 2023
- added entry in .changelog folder
@kkavish kkavish changed the title Net 4144 gateway pdb [NET-4144] add gateway pdb Sep 21, 2023
@kkavish kkavish added the consul-india PRs/Issues assigned to Consul India team label Sep 21, 2023
Copy link
Contributor

@Ganeshrockz Ganeshrockz left a comment

Choose a reason for hiding this comment

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

Skimmed through the changes and have some basic questions. Will go through the PR again in detail once those queries get resolved.

CHANGELOG.md Outdated Show resolved Hide resolved
.changelog/2985.txt Outdated Show resolved Hide resolved
charts/consul/values.yaml Outdated Show resolved Hide resolved
charts/consul/values.yaml Outdated Show resolved Hide resolved
charts/consul/values.yaml Outdated Show resolved Hide resolved
charts/consul/values.yaml Outdated Show resolved Hide resolved
charts/consul/values.yaml Show resolved Hide resolved
charts/consul/templates/crd-gateways-disruptionbudget.yaml Outdated Show resolved Hide resolved
- removed entry in .changelog folder
- reverted changes in values.yaml done for local testing
Copy link
Contributor

@Ganeshrockz Ganeshrockz left a comment

Choose a reason for hiding this comment

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

Looks good mostly. Deferring the approval to the service-mesh/gateways team who owns the codebase.

.changelog/2985.txt Outdated Show resolved Hide resolved
- correction in .changelog
@mr-miles
Copy link
Contributor

Sorry to drop in out of nowhere! But any chance to add a pdb for the ingress gateways too? I know ingress gateways themselves are deprecated for replacement by api-gateways, but they are still supported. Its confusing if the gateways are inconsistent in their config, unless they're going to be removed from the chart completely.

@kkavish
Copy link
Author

kkavish commented Sep 28, 2023

Sorry to drop in out of nowhere! But any chance to add a pdb for the ingress gateways too? I know ingress gateways themselves are deprecated for replacement by api-gateways, but they are still supported. Its confusing if the gateways are inconsistent in their config, unless they're going to be removed from the chart completely.

  • thanks for suggesting it, makes sense, we'd add it to ingress as well.

- added pdb to ingress gateways
- correction in .changelog
@@ -0,0 +1,3 @@
```release-note:improvement
pdb: adding pod disruption budget for all the gateways
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pdb: adding pod disruption budget for all the gateways
gateways: create PodDisruptionBudget for all gateways

charts/consul/templates/crd-gateways-disruptionbudget.yaml Outdated Show resolved Hide resolved
charts/consul/values.yaml Show resolved Hide resolved
- modified all PDB configs to be homogenous.
- added poddisruptionbudget.go for custom gateways.
- correction in .changelog
control-plane/api/v1alpha1/api_gateway_types.go Outdated Show resolved Hide resolved
}

type PodDisruptionBudgetSpec struct {
Enabled bool `json:"enabled,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't expect an Enabled field here. If the field is non-nil then we can assume that it's enabled

Copy link
Author

Choose a reason for hiding this comment

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

my thought process was:

  1. The configs remain same for resources that we create and the resources created through templates. i.e. they all have - enable, minAvailable and maxUnavailable thus making them homogenous.
  2. For the resources we create, if the end-user/dev needs to disable PDB she/he could just go ahead and make enabled = false instead of deleting the whole stanza and adding it back again when they require it.

Shall I go ahead and remove the enabled flag anyways?

control-plane/api-gateway/gatekeeper/gatekeeper.go Outdated Show resolved Hide resolved
control-plane/api-gateway/gatekeeper/gatekeeper_test.go Outdated Show resolved Hide resolved
- updating PDB to follow the pattern in role.go
- updating PDB to follow the pattern in role.go
@david-yu
Copy link
Contributor

@nathancoleman I chatted with @kkavish he said this might need re-review? However I'm not sure if it's ready given that it looks like most of the tests are still failing?

@nathancoleman
Copy link
Member

Re-reviewing is on my To Do list; however, it's lower in priority than work related to Consul 1.17.0 releasing next week. I confirmed with @kkavish that we're not trying to get this change into 1.17.0.

@david-yu
Copy link
Contributor

Sure not a rush. Let's revisit after 1.17, I also asked @kkavish to brush up this PR to get the tests to pass as well.

@david-yu
Copy link
Contributor

david-yu commented Nov 8, 2023

@kkavish Could you try re-basing to get the unit tests on control plane to pass?

- disabling pdbs in values.yaml
- data plane image
- running tests
# Conflicts:
#	charts/consul/values.yaml
- running tests
@david-yu david-yu linked an issue Nov 14, 2023 that may be closed by this pull request
- running tests
- running tests
- running tests
- running tests
- running tests
- running tests
@david-yu
Copy link
Contributor

david-yu commented Dec 1, 2023

I'm guess the PR is still failing to pass any acceptance tests?

@kkavish
Copy link
Author

kkavish commented Dec 4, 2023

I'm guess the PR is still failing to pass any acceptance tests?

@david-yu sorry, I've been on a vacation, I'll try to get this fixed this week.

kkavish and others added 4 commits December 4, 2023 15:54
- running tests
# Conflicts:
#	charts/consul/templates/crd-gatewayclassconfigs.yaml
- running tests
@kkavish kkavish closed this Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consul-india PRs/Issues assigned to Consul India team pr/no-backport signals that a PR will not contain a backport label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No way to add pdb to gateways
7 participants