aws / aws-application-networking-k8s

A Kubernetes controller for Amazon VPC Lattice
https://www.gateway-api-controller.eks.aws.dev/
Apache License 2.0
164 stars 49 forks source link

Update pod readiness condition #607

Closed solmonk closed 7 months ago

solmonk commented 7 months ago

What type of PR is this?

feature

Which issue does this PR fix:

560

What does this PR do / Why do we need it:

Please refer to the issue description of #560 for the background.

If an issue # is not available please add repro steps and logs from aws-gateway-controller showing the issue:

Testing done on this change:

Tested in a simple scenario where I have 2 pods in the deployment, and adding pods. (w/ readiness gate)

Will update after further test.

Automation added to e2e: e2e test cases coming soon

Will this PR introduce any new dependencies?:

Will this break upgrades or downgrades. Has updating a running cluster been tested?:

Does this PR introduce any user-facing change?:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

liwenwu-amazon commented 7 months ago

Can you add some detail design note on how often do controller reconcile on all lattice TG targets? e.g. Is it on the timer-interval?

Does it pull lattice health state for all targets/pods?

solmonk commented 7 months ago

No - the controller only listens on endpoint event, and pulls lattice health state if any of the endpoint is not ready. This means the controller does not go in opposite direction (making ready pods non-ready)

The purpose of readiness is about "disabling traffic while keeping pods alive" which is already handled by VPC Lattice HC, so I believe this should not block any use cases, although we can support this in the future.

liwenwu-amazon commented 7 months ago

No - the controller only listens on endpoint event, and pulls lattice health state if any of the endpoint is not ready. This means the controller does not go in opposite direction (making ready pods non-ready)

What happens if targets HC are not ready ? Will controller retry later or just busy waiting

liwenwu-amazon commented 7 months ago

To make the PR smaller, Is it possible to have a separate CR just on endpoint slice change?

solmonk commented 7 months ago

controller just goes to another reconcile loop, not busy waiting. actually a separated PR was already up if you're interested - https://github.com/aws/aws-application-networking-k8s/pull/604 If this gets merged first I can rebase this PR to reduce the diff.

solmonk commented 7 months ago