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

fix: ensure that Gateway managed DataPlanes are reduced #43

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

pmalek
Copy link
Member

@pmalek pmalek commented Mar 20, 2024

Problem statement

It seems that there was one step that was missed in reduction of resources, namely Gateway's managed DataPlanes.

When for some reason there was more than 1 DataPlane owned by 1 Gateway at any point in time KGO never removed those:

if count > 1 {
err = fmt.Errorf("data plane deployments found: %d, expected: 1", count)
k8sutils.SetCondition(
createDataPlaneCondition(metav1.ConditionFalse, k8sutils.UnableToProvisionReason, err.Error(), gateway.Generation),
gatewayConditionsAndListenersAware(gateway),
)
return nil, err
}
.

This PR introduced the DataPlane reduction step which will remove the newest DataPlane which exists when there's more than 1 of those per Gateway.

Which issue does this PR solve

Fixes #29


This change has also the following effect on integration tests runtime:

Before: https://github.com/Kong/gateway-operator/actions/runs/8359101231

image

After: https://github.com/Kong/gateway-operator/actions/runs/8362324992?pr=43

image

@pmalek pmalek self-assigned this Mar 20, 2024
@pmalek pmalek force-pushed the ensure-that-gateway-managed-dataplanes-are-reduced branch 2 times, most recently from 39798c2 to cd4e0b7 Compare March 20, 2024 15:19
@pmalek pmalek force-pushed the ensure-that-gateway-managed-dataplanes-are-reduced branch from b5ef9b0 to 4c7515e Compare March 20, 2024 17:20
@pmalek pmalek marked this pull request as ready for review March 20, 2024 17:24
@pmalek pmalek requested a review from a team as a code owner March 20, 2024 17:24
@pmalek pmalek enabled auto-merge (squash) March 20, 2024 17:38
@pmalek
Copy link
Member Author

pmalek commented Mar 20, 2024

We might want to look into retrying the installation of Gateway API CRDs as it seems it can take the whole pipeline down:

panic: ERROR: command "/usr/bin/kubectl --kubeconfig /tmp/-kubeconfig-1b8f9f74-eef2-461b-bfa9-57644bbfe25b146573200 -v9 apply -k github.com/kubernetes-sigs/gateway-api/config/crd/experimental?ref=v1.0.0" failed STDERR=() STDERR=(I0320 17:25:09.195247   21852 loader.go:395] Config loaded from file:  /tmp/-kubeconfig-1b8f9f74-eef2-461b-bfa9-57644bbfe25b146573200
error: failed to run '/usr/bin/git fetch --depth=1 https://github.com/kubernetes-sigs/gateway-api v1.0.0': fatal: unable to access 'https://github.com/kubernetes-sigs/gateway-api/': HTTP/2 stream 1 was not closed cleanly before end of the underlying stream
: exit status 128
): exit status 1


goroutine 1 [running]:
github.com/kong/gateway-operator/test/integration.exitOnErr({0x563eea0, 0xc000c72060})
	/home/runner/work/gateway-operator/gateway-operator/test/integration/suite.go:203 +0x14d
github.com/kong/gateway-operator/test/integration.TestMain(0xc000[85](https://github.com/Kong/gateway-operator/actions/runs/8363207891/job/22895613453?pr=43#step:4:86)45a0, 0xc0007d5340)
	/home/runner/work/gateway-operator/gateway-operator/test/integration/suite.go:157 +0x1325
github.com/kong/gateway-operator/test/integration_test.TestMain(0xc0008545a0)
	/home/runner/work/gateway-operator/gateway-operator/test/integration/run_integration_test.go:28 +0x216
main.main()
	_testmain.go:85 +0x2f5

@pmalek pmalek merged commit 830abd5 into main Mar 20, 2024
13 checks passed
@pmalek pmalek deleted the ensure-that-gateway-managed-dataplanes-are-reduced branch March 20, 2024 17: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.

TestGatewayEssentials failing on CI
2 participants