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

Add dependencyproxy model, crds, listers, informers #279

Merged

Conversation

shriramsharma
Copy link
Collaborator

fixes #278

Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
@shriramsharma shriramsharma added the WIP Work In Progress label Jan 24, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jan 24, 2023

Codecov Report

Merging #279 (32c1733) into master (61b8378) will decrease coverage by 1.12%.
The diff coverage is 0.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master     #279      +/-   ##
==========================================
- Coverage   74.18%   73.06%   -1.12%     
==========================================
  Files          32       33       +1     
  Lines        3266     3316      +50     
==========================================
  Hits         2423     2423              
- Misses        695      745      +50     
  Partials      148      148              
Impacted Files Coverage Δ
admiral/pkg/controller/admiral/dependencyproxy.go 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@aattuluri aattuluri changed the title adding new dependencyproxy model, crds, listers, informers Add dependencyproxy model, crds, listers, informers Jan 25, 2023

message Proxy {
// Identifier of the proxy's workload
string identity = 3;
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to confirm, admiral.io/env label on the dependency proxy would be used in addition to this identity to construct the proxy endpoint?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, that is correct. Let me know if you want to make it more explicit to avoid confusion.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can add an example in the docs with a sample dependencyproxy and what Admiral renders

kind: DependencyProxy
listKind: DependencyProxyList
plural: dependencyproxies
singular: dependencyproxy
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a shortName for the CRD, something like dp?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, will do that

Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
// spec:
// hosts:
// - test0.stage.greeting.xyz
// - test1.stage.greeting.xyz
Copy link
Contributor

Choose a reason for hiding this comment

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

I am thinking if these should be test0.greeting.xyz and test1.greeting.xyz because if some one has e2e1 and e2e2, the endpoints will look like e2e1.e2e.greeting.xyz and e2e2.e2e.greeting.xyz. Also this will make the migration later (from gateway to mesh seamless when that happens)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hey @aattuluri , I'm sorry this example I think is a little confusing. stage here is the admiral.io/env on the deployment/rollout of the destination service(greeting). So I was thinking if we'll prepend the prefixes defined above to the generated endpoint of the service. `..

So we'll be generating the regular endpoint without the prefix as well as shown here


This should make the migration seamless. Please correct me if I'm wrong.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense.

Copy link
Contributor

@aattuluri aattuluri left a comment

Choose a reason for hiding this comment

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

lgtm

Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
@shriramsharma shriramsharma marked this pull request as ready for review February 2, 2023 19:09

// DependencyProxyStatus is the status for a DependencyProxy resource
type DependencyProxyStatus struct {
ClusterSynced int32 `json:"clustersSynced"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the logic to update this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@nirvanagit , since this was in the other types, so I just kept it as is.
@aattuluri , do you know if we need this or if this can be removed?

Copy link
Contributor

Choose a reason for hiding this comment

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

@shriramsharma We should remove this given its doesnt make sense for this CRD.

)

// DepProxyHandler interface contains the methods that are required
type DepProxyHandler interface {
Copy link
Collaborator

@nirvanagit nirvanagit Feb 2, 2023

Choose a reason for hiding this comment

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

DependencyProxyHandler?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the struct which implements this already in this PR?

informer cache.SharedIndexInformer
}

type depProxyCache struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

dependencyProxyCache?


func NewDependencyProxyController(stopCh <-chan struct{}, handler DepProxyHandler, configPath string, namespace string, resyncPeriod time.Duration) (*DependencyProxyController, error) {

depProxyController := DependencyProxyController{}
Copy link
Collaborator

Choose a reason for hiding this comment

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

may be just controller?

return nil, fmt.Errorf("failed to create dependency controller k8s client: %v", err)
}

depProxyController.DepCrdClient, err = AdmiralCrdClientFromPath(configPath)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we call it admiralCRDClient? I see its called DepCrdClient even for dependency.

Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
@shriramsharma shriramsharma merged commit f3f8419 into istio-ecosystem:master Feb 6, 2023
@shriramsharma shriramsharma deleted the add-dependency-proxy-crd branch February 6, 2023 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Work In Progress
Projects
None yet
4 participants