Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Add additional resource settings for Connect and gateways #556

Merged
merged 2 commits into from
Jul 29, 2020

Conversation

adilyse
Copy link
Contributor

@adilyse adilyse commented Jul 28, 2020

Updates #532.

Adds resource setting configuration values for lifecycle sidecar and init containers for Connect and gateways.

@adilyse adilyse added area/connect Related to Connect, e.g. injection area/gateways Related to gateway components labels Jul 28, 2020
@adilyse adilyse requested review from a team, lkysow and thisisnotashwin and removed request for a team July 28, 2020 18:19
Copy link

@thisisnotashwin thisisnotashwin left a comment

Choose a reason for hiding this comment

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

This is most excellent @adilyse !! Can't wait to see this in the open :)

Copy link
Member

@lkysow lkysow left a comment

Choose a reason for hiding this comment

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

I've tested all this out and it works great. I have a couple of questions and suggestions.

@@ -138,6 +138,38 @@ spec:
{{- if not (kindIs "invalid" $resources.requests.cpu) }}
-default-sidecar-proxy-cpu-request={{ $resources.requests.cpu }} \
{{- end }}

{{- if .Values.connectInject.initContainer }}
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to support

connectInject:
  initContainer: null

? (I'm assuming that's what this is for).

I think it would be fine to support

connectInject:
  initContainer:
    resources: null

and that's the pattern we follow for the sidecarProxy.resources.

I have the same question for the other sections.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We give a nil pointer exception if someone removes or comments out the entire initContainer section in the values file. This check handles that case. If we aren't worried about that scenario, the extra layer of checks can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This Helm doc is related.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need to handle that case since I think it would be unlikely a user does that and since I haven't seen other locations where we're doing it. But I don't feel too strongly about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since it provides some extra protection, I'm going to leave it for now.

test/unit/connect-inject-deployment.bats Outdated Show resolved Hide resolved
test/unit/connect-inject-deployment.bats Outdated Show resolved Hide resolved
yq 'any(contains("-lifecycle-sidecar-cpu-limit=200m"))' | tee /dev/stderr)
[ "${actual}" = "true" ]
}

#--------------------------------------------------------------------
# sidecarProxy.resources
Copy link
Member

Choose a reason for hiding this comment

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

Should we add tests for:

  • can set initContainer: null, lifecycleSidecarContainer: null (if we keep that functionality)
  • can set resources: null
  • can set each setting to null and the flag won't be set
  • can set explicitly to 0 and the flag will be set

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was hesitant to add too many tests before getting feedback. I've add those suggested except the first, pending a decision on that functionality.

Copy link
Member

@lkysow lkysow left a comment

Choose a reason for hiding this comment

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

Thanks for adding those tests!

I favour removing the support for initContainer: null (and lifecycel:null) but it's not a blocker.

@adilyse adilyse force-pushed the refactor_container_resources branch from cf1f3f9 to 747f284 Compare July 29, 2020 23:02
kschoche and others added 2 commits July 29, 2020 16:02
Init container resource settings are now split into each individual
section. Lifecycle sidecar settings remain a global setting.
@adilyse adilyse force-pushed the refactor_container_resources branch from 747f284 to 30be79c Compare July 29, 2020 23:02
@adilyse adilyse merged commit 39698a4 into master Jul 29, 2020
@adilyse adilyse deleted the refactor_container_resources branch July 29, 2020 23:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/connect Related to Connect, e.g. injection area/gateways Related to gateway components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants