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

Adds Initial Infra Manager #178

Merged
merged 2 commits into from
Aug 3, 2022
Merged

Adds Initial Infra Manager #178

merged 2 commits into from
Aug 3, 2022

Conversation

danehans
Copy link
Contributor

@danehans danehans commented Jul 28, 2022

Adds initial Infra Manager implementation.

Requires: #183

xref: #41

Signed-off-by: danehans [email protected]

@danehans danehans requested a review from a team as a code owner July 28, 2022 16:04
@danehans danehans added the area/infra-mgr Issues related to the provisioner used for provisioning the managed Envoy Proxy fleet. label Jul 28, 2022
@danehans danehans added this to the 0.2.0-rc1 milestone Jul 28, 2022

// A nil infra proxy ir means the proxy infra should be deleted, but metadata is
// required to know the ns/name of the resources to delete. Add support for deleting
// the infra when https://github.com/envoyproxy/gateway/issues/173 is resolved.
Copy link
Contributor

@arkodg arkodg Jul 28, 2022

Choose a reason for hiding this comment

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

imho the metadata should only be used for informational features such as labelling and status and not for CRUD of k8s resources.
one way to handle deletes could be for the infra manager to reconcile all k8s resources owned by this infra manager (tied to a single GW Class), and delete those resources that are not part of the Translate o/p

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IMO infra IR metadata should include a deletionTimestamp that is set by the Resource Translator when the associated Gateway is deleted. An infra IR with deletionTimestamp tells the Infra Manager to delete the associated infra.

xref kube meta: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#metadata

one way to handle deletes could be for the infra manager to reconcile all k8s resources owned by this infra manager (tied to a single GW Class), and delete those resources that are not part of the Translate o/p

Yes, this is a possible solution but IMO not as efficient as it requires a List() and then Delete().

// Manager provides the scaffolding for managing infrastructure.
type Manager struct {
Kubernetes *kubernetes.Infra
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we expect there to multiple things here? Before I got to this file, I was assuming Manager was going to be an interface that kubernetes.Infra implements.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the struct will contain a field for every supported provider. I created #182 to track the need to move this to an interface.

internal/infrastructure/translator.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jul 29, 2022

Codecov Report

Merging #178 (cea006f) into main (a1ff4f9) will decrease coverage by 1.58%.
The diff coverage is 44.13%.

@@            Coverage Diff             @@
##             main     #178      +/-   ##
==========================================
- Coverage   61.74%   60.16%   -1.59%     
==========================================
  Files          20       23       +3     
  Lines        1814     1993     +179     
==========================================
+ Hits         1120     1199      +79     
- Misses        632      722      +90     
- Partials       62       72      +10     
Impacted Files Coverage Δ
internal/cmd/server.go 24.32% <ø> (ø)
...ternal/infrastructure/kubernetes/serviceaccount.go 21.42% <21.42%> (ø)
internal/infrastructure/kubernetes/infra.go 35.13% <35.13%> (ø)
internal/ir/infra.go 62.79% <62.79%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us.

arkodg
arkodg previously approved these changes Aug 1, 2022
// NewInfra returns a new Infra.
func NewInfra(cli client.Client) *Infra {
return &Infra{
mu: sync.Mutex{},
Copy link
Contributor

@LukeShu LukeShu Aug 3, 2022

Choose a reason for hiding this comment

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

nit: this line is unnecessary

LukeShu
LukeShu previously approved these changes Aug 3, 2022
Copy link
Contributor

@LukeShu LukeShu left a comment

Choose a reason for hiding this comment

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

lgtm

internal/infrastructure/translator.go Outdated Show resolved Hide resolved
internal/infrastructure/kubernetes/infra.go Outdated Show resolved Hide resolved
internal/infrastructure/manager.go Outdated Show resolved Hide resolved
internal/infrastructure/kubernetes/serviceaccount.go Outdated Show resolved Hide resolved
Copy link
Contributor

@skriss skriss left a comment

Choose a reason for hiding this comment

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

👍

@danehans danehans merged commit a603060 into envoyproxy:main Aug 3, 2022
@danehans danehans deleted the infra_mgr branch August 3, 2022 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/infra-mgr Issues related to the provisioner used for provisioning the managed Envoy Proxy fleet.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants