From 70dccf7186908f499cd242e53058dd8d8fe0291e Mon Sep 17 00:00:00 2001 From: Bhargav Nookala Date: Wed, 14 Jun 2017 21:18:09 -0700 Subject: [PATCH] Adding support for sleep time, ignored pools, and spare agents (#1300) --- stable/acs-engine-autoscaler/README.md | 3 ++ .../templates/deployment.yaml | 28 +++++++++++++------ stable/acs-engine-autoscaler/values.yaml | 20 ++++++++----- 3 files changed, 36 insertions(+), 15 deletions(-) diff --git a/stable/acs-engine-autoscaler/README.md b/stable/acs-engine-autoscaler/README.md index 0de6bb6c4e..c52251f3d8 100644 --- a/stable/acs-engine-autoscaler/README.md +++ b/stable/acs-engine-autoscaler/README.md @@ -108,6 +108,9 @@ Parameter | Description | Default `kubeconfigprivatekey`| The key passed to the `kubeConfigPrivateKey` parameter in your `azuredeploy.parameters.json` generated with `acs-engine` | None. You *must* supply one. `clientprivatekey`| The key passed to the `clientPrivateKey` parameter in your `azuredeploy.parameters.json` generated with `acs-engine` | None. You *must* supply one. `acsdeployment`| [OPTIONAL] The name of the deployment used to deploy the kubernetes cluster initially. If not provided, it is defaulted to `azuredeploy` | None. +`sleeptime`| [OPTIONAL] The number of seconds to sleep between scaling loops. If not provided, a default of 60 seconds is used. | 60 +`ignorepools`| [OPTIONAL] A list of comma seperated pool names the autoscaler should ignore. | None. +`spareagents`| [OPTIONAL] Number of agents per pool that should always remain up. If not provided, a default of 1 agent is used. | 1 Specify each parameter you'd like to override using a YAML file as described above in the [installation](#Installing the Chart) section. diff --git a/stable/acs-engine-autoscaler/templates/deployment.yaml b/stable/acs-engine-autoscaler/templates/deployment.yaml index 1ad4b6ba4c..45b431a98b 100644 --- a/stable/acs-engine-autoscaler/templates/deployment.yaml +++ b/stable/acs-engine-autoscaler/templates/deployment.yaml @@ -3,13 +3,13 @@ apiVersion: extensions/v1beta1 kind: Deployment metadata: name: {{ template "fullname" . }} - labels: + labels: {{ include "labels.standard" . | indent 4 }} spec: replicas: {{ .Values.replicaCount }} template: metadata: - labels: + labels: {{ include "labels.standard" . | indent 8 }} openai/do-not-drain: "true" spec: @@ -31,7 +31,7 @@ spec: valueFrom: secretKeyRef: name: {{ template "fullname" . }} - key: azure-sp-tenant-id + key: azure-sp-tenant-id - name: KUBECONFIG_PRIVATE_KEY valueFrom: secretKeyRef: @@ -41,16 +41,28 @@ spec: valueFrom: secretKeyRef: name: {{ template "fullname" . }} - key: client-private-key + key: client-private-key command: - python - main.py - - --resource-group + - --resource-group - {{ .Values.acsenginecluster.resourcegroup }} - {{- if .Values.acsenginecluster.acsdeployment}} - - --acs-deployment + {{- if .Values.acsenginecluster.acsdeployment }} + - --acs-deployment - {{ .Values.acsenginecluster.acsdeployment }} - {{- end}} + {{ end }} + {{- if .Values.acsenginecluster.sleeptime }} + - --sleep + - {{ .Values.acsenginecluster.sleeptime }} + {{ end }} + {{- if .Values.acsenginecluster.ignorepools }} + - --ignore-pools + - {{ .Values.acsenginecluster.ignorepools }} + {{ end }} + {{- if .Values.acsenginecluster.spareagents }} + - --spare-agents + - {{ .Values.acsenginecluster.spareagents }} + {{ end }} - -vvv imagePullPolicy: {{ .Values.image.pullPolicy }} restartPolicy: Always diff --git a/stable/acs-engine-autoscaler/values.yaml b/stable/acs-engine-autoscaler/values.yaml index 8e10dc58c5..2c08075b67 100644 --- a/stable/acs-engine-autoscaler/values.yaml +++ b/stable/acs-engine-autoscaler/values.yaml @@ -9,12 +9,18 @@ image: tag: 0.3.1 pullPolicy: IfNotPresent acsenginecluster: - resourcegroup: - azurespappid: - azurespsecret: - azuresptenantid: - kubeconfigprivatekey: - clientprivatekey: + resourcegroup: + azurespappid: + azurespsecret: + azuresptenantid: + kubeconfigprivatekey: + clientprivatekey: ## Optional parameter for deployment name if not using default - #acsdeployment: + #acsdeployment: + ## Optional parameter for sleep time between scaling loops (default: 60) + #sleeptime: + ## Optional parameter for pools to ignore scaling on + #ignorepools: + ## Optional parameter denominating number of nodes to spare in a pool after scaling + #spareagents: