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

Support default sidecar proxy resources #470

Merged
merged 1 commit into from
Jun 18, 2020

Conversation

lkysow
Copy link
Member

@lkysow lkysow commented May 26, 2020

Companion to hashicorp/consul-k8s#267

Allow setting default sidecar proxy resources. The defaults are set to null so that by default the envoy proxy doesn't run up against any limits.

To test, use

global:
  imageK8S: lkysow/consul-k8s-dev:may26-resources3
connectInject:
  enabled: true
  sidecarProxy:
    resources:
      limits:
        memory: 200Mi
        cpu: 200m
      requests:
        memory: 100Mi
        cpu: 100m

@lkysow lkysow requested a review from a team May 26, 2020 20:41
Copy link
Contributor

@ishustava ishustava left a comment

Choose a reason for hiding this comment

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

This looks good! I've tested it out, and everything looked good to me. Going back to my comment in the hashicorp/consul-k8s#267 about checking if limit >= resource, I don't think we need to do it for annotations. I was able to see the error message in the status of my deployment. But I still think it'd be useful to check that for defaults in the connect inject command.

I'm curious though about this choice of defaults. Are you concerned that making our recommended defaults actual defaults will be a breaking change? Would it make sense to only set requests but not limits to eliminate the concern around running up against limits?

values.yaml Show resolved Hide resolved
@lkysow lkysow force-pushed the resource-setting-defaults branch 2 times, most recently from 28a1935 to f0ce5e1 Compare June 1, 2020 21:35
@lkysow
Copy link
Member Author

lkysow commented Jun 1, 2020

But I still think it'd be useful to check that for defaults in the connect inject command.
Will do

I'm curious though about this choice of defaults. Are you concerned that making our recommended defaults actual defaults will be a breaking change? Would it make sense to only set requests but not limits to eliminate the concern around running up against limits?

I made this decision (not setting defaults) to make the first-run experience better. Needing 100Mi/100m per pod just for the sidecar could add up quickly on a small cluster where someone is testing things out. Since all of our defaults are catered towards the first-run experience and we expect production users to customize settings themselves this decision felt inline with the rest of the chart defaults.

But I'm not super set on this, there are good arguments both sides.

@lkysow lkysow force-pushed the resource-setting-sidecar-defaults branch from 310924d to cc13b6e Compare June 1, 2020 21:48
@lkysow lkysow force-pushed the resource-setting-defaults branch 2 times, most recently from 2a3a4a0 to 97d94c6 Compare June 2, 2020 20:46
@lkysow lkysow force-pushed the resource-setting-sidecar-defaults branch from cc13b6e to 19d5921 Compare June 3, 2020 22:56
Copy link
Contributor

@ishustava ishustava left a comment

Choose a reason for hiding this comment

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

This looks good! Keeping defaults as null makes sense for now.

@lkysow lkysow force-pushed the resource-setting-defaults branch from 1143c7e to 7627d3c Compare June 5, 2020 21:44
@lkysow lkysow force-pushed the resource-setting-sidecar-defaults branch from 19d5921 to 818b55e Compare June 5, 2020 21:45
Base automatically changed from resource-setting-defaults to master June 5, 2020 21:48
@lkysow
Copy link
Member Author

lkysow commented Jun 5, 2020

NOTE: Waiting for consul-k8s build.

@ishustava ishustava added the enhancement New feature or request label Jun 12, 2020
@lkysow lkysow changed the base branch from master to release/0.22.0 June 17, 2020 19:54
@lkysow
Copy link
Member Author

lkysow commented Jun 17, 2020

Require #499

@lkysow lkysow merged commit 4337e23 into release/0.22.0 Jun 18, 2020
@lkysow lkysow deleted the resource-setting-sidecar-defaults branch June 18, 2020 17:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants