Lower CPU/ memory of sidecar container to minimum (reached limits and commented with error message)

This commit is contained in:
Guillaume Tardif 2020-06-18 17:55:56 +02:00
parent 76a1753396
commit e4db0d2b9e
1 changed files with 5 additions and 5 deletions

View File

@ -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),
},
},
},