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

selectively disable addons #275

Merged
merged 1 commit into from
Aug 19, 2022
Merged

Conversation

hakuna-matatah
Copy link
Contributor

@hakuna-matatah hakuna-matatah commented Aug 18, 2022

Issue #, if available:
#253

Description of changes:

Selectively disables addons from Infrastructure code at the time of deployment:

Testing

  • cdk deploy KITInfrastructure --no-rollback -c TestNamespace="tekton-pipelines" -c TestServiceAccount="tekton-pipelines-executor" -c AWSEBSCSIDriverAddon="" -c KarpenterAddon="" -c KITAddon=""

^^^ Empty values means disable addons - typescripty thing for String to Boolean.

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

@prateekgogia
Copy link
Member

Can we update the Readme under infrastructure as well?

@@ -15,6 +15,9 @@ export class KITInfrastructure extends Stack {
const repoUrl = this.getContextOrDefault('FluxRepoURL', "https://github.com/awslabs/kubernetes-iteration-toolkit")
const repoBranch = this.getContextOrDefault('FluxRepoBranch', 'main')
const repoPath = this.getContextOrDefault('FluxRepoPath', './infrastructure/k8s-config/clusters/kit-infrastructure')
const installEBSCSIDriverAddon = Boolean(this.getContextOrDefault("AWSEBSCSIDriverAddon", "true"))
Copy link
Member

Choose a reason for hiding this comment

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

If you change this method to be getContextOrDefault(key: string, def: string | boolean | null) it should return the context passed and have an if condition like this -
if (installKitAddon == true)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you change this method to be getContextOrDefault(key: string, def: string | boolean | null) it should return the context passed

It already returns the context passed with the change i made, no need to change ^^^ that function :D. Unless you are implying something here ?

if (installKitAddon == true)

  • hmmm ^^^ setting this value makes the value comparison to be explicit instead of implicit.

  • IOW, this change will ensure any value that is set through context is taken as false unless it is set to true explicitly(opposite of default typescript behavior for boolean/string conversion). Instead of just empty value is taken as false and any other value is taken as true( which is default typescript behavior).

@bwagner5
Copy link
Contributor

I'm curious why we'd ever want to disable those add-ons? This setup should ideally be a very opinionated testing environment. Is there a use-case for testing without some add-ons installed?

@hakuna-matatah
Copy link
Contributor Author

I'm curious why we'd ever want to disable those add-ons? This setup should ideally be a very opinionated testing environment. Is there a use-case for testing without some add-ons installed?

Yes, we have such use-case in Scalability where we only spin-up EKS specific clusters through Tekton and not having to do anything with Karpenter, KIT on management cluster/KIT Infra.
These additional addons are not used at this point, in future if we choose to test KIT Guest clusters on the same infrastructure then yes, we can turn these selectively like installing KIT addon at that point.

@hakuna-matatah hakuna-matatah force-pushed the nodegroup branch 2 times, most recently from 947ac15 to cb49570 Compare August 19, 2022 15:43
Copy link
Member

@prateekgogia prateekgogia left a comment

Choose a reason for hiding this comment

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

LGTM!

@hakuna-matatah hakuna-matatah merged commit 84bc322 into awslabs:main Aug 19, 2022
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.

3 participants