0

I have a project to modify the scheduling policy, I have deployed a large number of pods at the same time, but it seems not scheduled as expected. I think kube-scheduler should cache the resource usage of nodes, so it needs to be deployed in two times.

Pod yaml is as follows, I run multiple pods through a shell loop implementation

apiVersion: v1
kind: Pod
metadata:
  name: ${POD_NAME}
  labels:
    name: multischeduler-example
spec:
  schedulerName: my-scheduler
  containers:
  - name: pod-with-second-annotation-container
    image: ibmcom/pause:3.1
    resources:
      requests:
        memory: "1Gi"
        cpu: "1"
      limits:
        memory: "2Gi"
        cpu: "2"

I want to know the interval of refreshing the cache of kube-scheduler for deployment

I really appreciate any help with this

moluzhui
  • 1,003
  • 14
  • 34
  • 1
    what do you mean by large? a bit more details please. and logs. would be helpfull to have whole picture – Vit Nov 26 '21 at 10:41
  • I don't understand the `so it needs to be deployed in two times.` comment. The pod should be deployed in a two-stage process? The scheduler? – Kerek Nov 26 '21 at 11:11
  • @Kerek I think the scheduler `caches the resource usage of nodes` (I don't know if it's correct or not), which will cause the nodes selected by the scheduler to be not the `actual optimal nodes` after I deploy several pods, so consider deploying some pods and `waiting for the cache to refresh` and then deploying some pods. Because when I use the MostRequest optimization strategy, I do not select the node with the highest resource usage and meet the condition – moluzhui Nov 27 '21 at 12:07
  • 1
    @moluzhui I still don't get the question. Even if the scheduler doesn't cache the resources on its own, it is fed by `etcd`, which has some staleness due to the delay between the binding of a pod and the update of the database. – Kerek Nov 27 '21 at 16:57
  • @Kerek When several pods are deployed, the node resource of the original smallest resource` allocated resource by kubectl describe node ` becomes the second smallest, but the scheduler still schedules Pod to the original smallest node instead of the current smallest node. I think there may be a cache inside the scheduler. So I want to know the refresh time to make sure I'm right – moluzhui Nov 29 '21 at 01:42

0 Answers0