Skip to content

Commit

Permalink
Add support for excluding containers on individual deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
davekonopka authored and Andrew Suderman committed Aug 1, 2019
1 parent 03f6574 commit 241603e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,7 @@ Queries all the VPA objects that are labelled for this tool and summarizes their
### Container Exclusions

The `dashboard` and `summary` commands can exclude recommendations for a list of comma separate container names using the `--excludes-containers` argument. This option can be useful for hiding recommendations for sidecar containers for things like Linkerd and Istio.

Containers can be excluded for individual deployments by applying an annotation to any deployment. The annotation value should be a list of comma separated container names. The annotation value will be combined with any values provided through the `--excludes-containers` argument.

`goldilocks.fairwinds.com/exclude-container: linkerd-proxy`
4 changes: 4 additions & 0 deletions pkg/summary/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ func constructSummary(vpas *v1beta2.VerticalPodAutoscalerList, excludeContainers
break
}

if annotationValue, annotationFound := deployment.Annotations["goldilocks.fairwinds.com/exclude-container"]; annotationFound {
containerExclusions = append(containerExclusions, strings.Split(annotationValue, ",")...)
}

CONTAINER_REC_LOOP:
for _, containerRecommendation := range vpa.Status.Recommendation.ContainerRecommendations {
for _, exclusion := range containerExclusions {
Expand Down

0 comments on commit 241603e

Please sign in to comment.