Skip to content

Commit

Permalink
Allow passing custom arguments to the autoscaler
Browse files Browse the repository at this point in the history
This can be useful if you have CoreDNS deployments that only serve a
subset of nodes, and you want to use --nodelabels on the autoscaler to
have it scale according to just those nodes.

Signed-off-by: Sarah Hodne <[email protected]>
  • Loading branch information
sarahhodne authored and mrueg committed Mar 15, 2022
1 parent f4fcc76 commit fe3928a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/coredns/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: coredns
version: 1.16.7
version: 1.17.0
appVersion: 1.8.7
home: https://coredns.io
icon: https://coredns.io/images/CoreDNS_Colour_Horizontal.png
Expand Down
1 change: 1 addition & 0 deletions charts/coredns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ The command removes all the Kubernetes components associated with the chart and
| `autoscaler.max` | Max size of replicaCount | 0 (aka no max) |
| `autoscaler.includeUnschedulableNodes` | Should the replicas scale based on the total number or only schedulable nodes | `false` |
| `autoscaler.preventSinglePointFailure` | If true does not allow single points of failure to form | `true` |
| `autoscaler.customFlags` | A list of custom flags to pass into cluster-proportional-autoscaler | (no args) |
| `autoscaler.image.repository` | The image repository to pull autoscaler from | k8s.gcr.io/cluster-proportional-autoscaler-amd64 |
| `autoscaler.image.tag` | The image tag to pull autoscaler from | `1.8.1` |
| `autoscaler.image.pullPolicy` | Image pull policy for the autoscaler | IfNotPresent |
Expand Down
3 changes: 3 additions & 0 deletions charts/coredns/templates/deployment-autoscaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,7 @@ spec:
- --target=Deployment/{{ default (include "coredns.fullname" .) .Values.deployment.name }}
- --logtostderr=true
- --v=2
{{- if .Values.autoscaler.customFlags }}
{{ toYaml .Values.autoscaler.customFlags | indent 10 }}
{{- end }}
{{- end }}
5 changes: 5 additions & 0 deletions charts/coredns/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,11 @@ autoscaler:
# If true does not allow single points of failure to form
preventSinglePointFailure: true

## Optionally specify some extra flags to pass to cluster-proprtional-autoscaler.
## Useful for e.g. the nodelabels flag.
# customFlags:
# - --nodelabels=topology.kubernetes.io/zone=us-east-1a

image:
repository: k8s.gcr.io/cluster-proportional-autoscaler-amd64
tag: "1.8.1"
Expand Down

0 comments on commit fe3928a

Please sign in to comment.