From e4db0d2b9e622ce2ae6320954ccbf9338f5e2b41 Mon Sep 17 00:00:00 2001 From: Guillaume Tardif Date: Thu, 18 Jun 2020 17:55:56 +0200 Subject: [PATCH] Lower CPU/ memory of sidecar container to minimum (reached limits and commented with error message) --- azure/convert/convert.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/azure/convert/convert.go b/azure/convert/convert.go index 87ebfe606..a6f715d4e 100644 --- a/azure/convert/convert.go +++ b/azure/convert/convert.go @@ -113,7 +113,7 @@ func getDNSSidecar(containers []containerinstance.Container) containerinstance.C commands = append(commands, fmt.Sprintf("echo 127.0.0.1 %s >> /etc/hosts", *container.Name)) } // ACI restart policy is currently at container group level, cannot let the sidecar terminate quietly once /etc/hosts has been edited - // Pricing is done at the container group level so letting the sidecar container "sleep" does not impact the proce for the whole group + // Pricing is done at the container group level so letting the sidecar container "sleep" should not impact the price for the whole group commands = append(commands, "sleep infinity") alpineCmd := []string{"sh", "-c", strings.Join(commands, ";")} dnsSideCar := containerinstance.Container{ @@ -123,12 +123,12 @@ func getDNSSidecar(containers []containerinstance.Container) containerinstance.C Command: &alpineCmd, Resources: &containerinstance.ResourceRequirements{ Limits: &containerinstance.ResourceLimits{ - MemoryInGB: to.Float64Ptr(1), - CPU: to.Float64Ptr(1), + MemoryInGB: to.Float64Ptr(0.1), // "The memory requirement should be in incrememts of 0.1 GB." + CPU: to.Float64Ptr(0.01), // "The CPU requirement should be in incrememts of 0.01." }, Requests: &containerinstance.ResourceRequests{ - MemoryInGB: to.Float64Ptr(1), - CPU: to.Float64Ptr(1), + MemoryInGB: to.Float64Ptr(0.1), + CPU: to.Float64Ptr(0.01), }, }, },