mirror of https://github.com/docker/compose.git
Lower CPU/ memory of sidecar container to minimum (reached limits and commented with error message)
This commit is contained in:
parent
76a1753396
commit
e4db0d2b9e
|
@ -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))
|
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
|
// 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")
|
commands = append(commands, "sleep infinity")
|
||||||
alpineCmd := []string{"sh", "-c", strings.Join(commands, ";")}
|
alpineCmd := []string{"sh", "-c", strings.Join(commands, ";")}
|
||||||
dnsSideCar := containerinstance.Container{
|
dnsSideCar := containerinstance.Container{
|
||||||
|
@ -123,12 +123,12 @@ func getDNSSidecar(containers []containerinstance.Container) containerinstance.C
|
||||||
Command: &alpineCmd,
|
Command: &alpineCmd,
|
||||||
Resources: &containerinstance.ResourceRequirements{
|
Resources: &containerinstance.ResourceRequirements{
|
||||||
Limits: &containerinstance.ResourceLimits{
|
Limits: &containerinstance.ResourceLimits{
|
||||||
MemoryInGB: to.Float64Ptr(1),
|
MemoryInGB: to.Float64Ptr(0.1), // "The memory requirement should be in incrememts of 0.1 GB."
|
||||||
CPU: to.Float64Ptr(1),
|
CPU: to.Float64Ptr(0.01), // "The CPU requirement should be in incrememts of 0.01."
|
||||||
},
|
},
|
||||||
Requests: &containerinstance.ResourceRequests{
|
Requests: &containerinstance.ResourceRequests{
|
||||||
MemoryInGB: to.Float64Ptr(1),
|
MemoryInGB: to.Float64Ptr(0.1),
|
||||||
CPU: to.Float64Ptr(1),
|
CPU: to.Float64Ptr(0.01),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue