google / google/kube-startup-cpu-boost

restated pods don't have CPUBoosts applied

Open
#97 9 comments 12 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
662
Forks
39
Avg merge
1d 19h
Merged PRs (30d)
8

Description

### Community Note

* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/)
to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do
not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment.

### Debug Output

### Panic Output

### Steps to Reproduce

1. Create deployment like this:
```
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: boost-test
name: boost-test
namespace: boost-test
spec:
replicas: 4
selector:
matchLabels:
app: boost-test
template:
metadata:
labels:
app: boost-test
spec:
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- boost-test
topologyKey: kubernetes.io/hostname
containers:
- image: nginx
name: nginx
resources:
requests:
cpu: 100m
memory: 20Mi
limits:
memory: 100Mi
livenessProbe:
httpGet:
port: 80
path: /indexxx.html
initialDelaySeconds: 40
periodSeconds: 5
failureThreshold: 3
successThreshold: 1
timeoutSeconds: 2
readinessProbe:
httpGet:
port: 80
path: /index.html
initialDelaySeconds: 20
periodSeconds: 5
failureThreshold: 3
successThreshold: 1
timeoutSeconds: 2
```
and CPUBoost:
```
apiVersion: autoscaling.x-k8s.io/v1alpha1
kind: StartupCPUBoost
metadata:
name: boost-cpu
namespace: boost-test
selector:
# matchLabels: {}
# matchExpressions:
# - key: app
# operator: In
# values: [ "boost-test" ]
matchLabels:
app: boost-test
spec:
resourcePolicy:
containerPolicies:
- containerName: nginx
fixedResources:
requests: "900m"
durationPolicy:
podCondition:
type: Ready
status: "True"
```
2. Observe pod requests:
```
watch "kubectl get pods -ojson | jq -r '.items[] | .spec.containers[0].resources.requests'"
```

### Expected Behavior

Operator could add resource boosts to pods that were restarted.

### Actual Behavior

When pod is restarted app inside goes through initialization and startup again, so it will consume more memory, but this is not reflected in CPU requests/limits, and may end up with starvation.

### References

* #0000

Contributor guide

Open the contributing guide

Research direction

Start by applying the Deployment and StartupCPUBoost manifests from the reproduction steps, then observe restarted pod requests with the provided kubectl and jq command. Trace the controller behavior for pods that restart and verify that CPU requests and limits are boosted again during initialization. Done means restarted pods receive the configured CPU boost; no source files or tests are named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.