Azure / acs-engine

WE HAVE MOVED: Please join us at Azure/aks-engine!
https://github.com/Azure/aks-engine
MIT License
1.03k stars 560 forks source link

Faulty generation of /etc/kubernetes/addons/cluster-autoscaler-deployment.yaml #4319

Closed mhyllander closed 5 years ago

mhyllander commented 5 years ago

Is this a request for help?: Yes


Is this an ISSUE or FEATURE REQUEST? (choose one): ISSUE


What version of acs-engine?: Version: v0.26.0 GitCommit: dfb2f37b0 GitTreeState: clean


Orchestrator and version (e.g. Kubernetes, DC/OS, Swarm) Kubernetes 1.12.2

What happened: I tried the newest acs-engine. I deployed a cluster according to our template, which installs the cluster-autoscaler as an addon:

                    {
                        "name": "cluster-autoscaler",
                        "enabled": true,
                        "containers": [
                            {
                                "name": "cluster-autoscaler",
                                "cpuRequests": "100m",
                                "memoryRequests": "300Mi",
                                "cpuLimits": "100m",
                                "memoryLimits": "300Mi"
                            }
                        ],
                        "config": {
                            "minNodes": "1",
                            "maxNodes": "5"
                        }
                    },

I discovered that the generation of the cluster-autoscaler addon is no longer correct. Compared to before, quotes around some string values have disappeared, and the min and max values are not inserted (I removed a couple of differing secrets in the diff below):

--- old.yaml    2018-11-30 15:57:37.129785700 +0100
+++ new.yaml    2018-11-30 15:57:46.729397500 +0100
@@ -5,7 +5,7 @@
     k8s-addon: cluster-autoscaler.addons.k8s.io
     k8s-app: cluster-autoscaler
     kubernetes.io/cluster-service: "true"
-    addonmanager.kubernetes.io/mode: "EnsureExists"
+    addonmanager.kubernetes.io/mode: EnsureExists
   name: cluster-autoscaler
   namespace: kube-system
 ---
@@ -17,7 +17,7 @@
     k8s-addon: cluster-autoscaler.addons.k8s.io
     k8s-app: cluster-autoscaler
     kubernetes.io/cluster-service: "true"
-    addonmanager.kubernetes.io/mode: "EnsureExists"
+    addonmanager.kubernetes.io/mode: EnsureExists
 rules:
 - apiGroups: [""]
   resources: ["events","endpoints"]
@@ -78,7 +78,7 @@
     k8s-addon: cluster-autoscaler.addons.k8s.io
     k8s-app: cluster-autoscaler
     kubernetes.io/cluster-service: "true"
-    addonmanager.kubernetes.io/mode: "EnsureExists"
+    addonmanager.kubernetes.io/mode: EnsureExists
 roleRef:
   apiGroup: rbac.authorization.k8s.io
   kind: ClusterRole
@@ -97,7 +97,7 @@
     k8s-addon: cluster-autoscaler.addons.k8s.io
     k8s-app: cluster-autoscaler
     kubernetes.io/cluster-service: "true"
-    addonmanager.kubernetes.io/mode: "EnsureExists"
+    addonmanager.kubernetes.io/mode: EnsureExists
 roleRef:
   apiGroup: rbac.authorization.k8s.io
   kind: Role
@@ -121,7 +121,7 @@
   namespace: kube-system
   labels:
     kubernetes.io/cluster-service: "true"
-    addonmanager.kubernetes.io/mode: "EnsureExists"
+    addonmanager.kubernetes.io/mode: EnsureExists
 ---
 apiVersion: extensions/v1beta1
 kind: Deployment
@@ -129,7 +129,7 @@
   labels:
     app: cluster-autoscaler
     kubernetes.io/cluster-service: "true"
-    addonmanager.kubernetes.io/mode: "EnsureExists"
+    addonmanager.kubernetes.io/mode: EnsureExists
   name: cluster-autoscaler
   namespace: kube-system
 spec:
@@ -154,7 +154,7 @@
         beta.kubernetes.io/os: linux
       containers:
       - image: k8s.gcr.io/cluster-autoscaler:v1.3.3
-        imagePullPolicy: Always
+        imagePullPolicy: IfNotPresent
         name: cluster-autoscaler
         resources:
           limits:
@@ -169,7 +169,7 @@
         - --logtostderr=true
         - --cloud-provider=azure
         - --skip-nodes-with-local-storage=false
-        - --nodes=1:5:k8s-agentpool1-26751425-vmss
+        - --nodes=::k8s-agentpool1-42855177-vmss
         env:
         - name: ARM_CLOUD
           value: "AzurePublicCloud"
@@ -205,7 +204,7 @@
               key: VMType
               name: cluster-autoscaler-azure
         - name: ARM_USE_MANAGED_IDENTITY_EXTENSION
-          value: "false"
+          value: false
         volumeMounts:
         - mountPath: /etc/ssl/certs/ca-certificates.crt
           name: ssl-certs

All changes are harmless except the last two. Missing min and max is not of course not optimal... And the unquoted value of ARM_USE_MANAGED_IDENTITY_EXTENSION in particular breaks the deployment because the value is expected to a string by the k8s parser.

What you expected to happen: Correct deployment of cluster-autoscaler.

How to reproduce it (as minimally and precisely as possible): Deploy the simplest possible cluster with the cluster-autoscaler addon enabled.

Anything else we need to know:

tariq1890 commented 5 years ago

@mhyllander Thanks for reporting this issue. We are looking into correcting this.