-
Notifications
You must be signed in to change notification settings - Fork 206
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
Observability Builder Props for Addons #833
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Howlla Couple of questions for clarity
To support Fargate cluster deployment we need to be able to pass props for coredns and cert-manager. We can remove the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @shapirov103 Please check and run e2e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Howlla definitely a needed change!
The approach is a bit overloaded from the software engineering perspective and does not align well with the builder pattern which is supposed to abstract the complexity to build the object.
How about this style to enable prop overrides:
ObservabilityBuilder.builder()
.account(account)
.region(region)
.withAddOnProps(ObservabilityBuilder.ADDON.CoreDns, myCoreDnsProps)
.withAddOnProps(ObservabilityBuilder.ADDON.CertManager, myCertManagerProps)
.enableNativePatternAddOns()
.addOns(...addOns)
.build(scope, stackId);
Please let me know if you have any questions.
hi @shapirov103 i tried the following way
but i get the following error
|
@Howlla I think the easiest approach is going to be something like: class ObservabilityBuilder {
private certManagerProps: CertManagerAddOnProps;
private awsLoadbalancerProps: AwsLoadBalancerAddOnProps;
...
public withCertManagerProps(props: CertManagerAddOnProps) {
this.certManagerProps = props; // actually deep clone here to avoid side effects
}
private withAwsLoadBalancerProps(props: AwsLoadBalancerAddOnProps) {
...
}
}
ObservabilityBuilder.builder()
.withCertManagerProps( {someprops} )
.withAwsLoadBalancerProps({some props})
.enable...() The downside is that for each addon there is an override method, but it makes it easy for the users to consume. |
I have made the changes as per your recommendation Mikhail. Will require slight modification to the cdk-eks-observability-accelerator for these files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Howlla Great work and thank you for address the kubeproxy and adot addon configurability.
@elamaran11 I put my approval on this, looks like it is pending requested changes from your side, please take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Issue #, if available:~
Description of changes: Modify some addons to export their Type for props.
Modify observability-builder.ts to accept props for each addon
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.