Skip to content

Commit

Permalink
Use env to determine cluster name used by OpenStack CCM and CSI, incr…
Browse files Browse the repository at this point in the history
…ease memory limits and requests for cluster-autoscaler (#2978)

* Use env to determine cluster name used by OpenStack CCM and CSI

Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>

* Increase memory requests and limits for cluster-autoscaler

Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>

---------

Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
  • Loading branch information
xmudrii authored Dec 13, 2023
1 parent bb5808b commit 950debf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions addons/cluster-autoscaler/cluster-autoscaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ spec:
resources:
limits:
cpu: 100m
memory: 300Mi
memory: 600Mi
requests:
cpu: 100m
memory: 300Mi
memory: 600Mi
serviceAccountName: cluster-autoscaler
terminationGracePeriodSeconds: 10
tolerations:
Expand Down
9 changes: 8 additions & 1 deletion pkg/tasks/probes.go
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,14 @@ func detectClusterName(s *state.State) (string, error) {
}
for _, flag := range container.Command {
if strings.HasPrefix(flag, "--cluster-name") {
return strings.Split(flag, "=")[1], nil
if val := strings.Split(flag, "=")[1]; val != "$(CLUSTER_NAME)" {
return val, nil
}
}
}
for _, env := range container.Env {
if env.Name == "CLUSTER_NAME" {
return env.Value, nil
}
}
}
Expand Down

0 comments on commit 950debf

Please sign in to comment.