<p>I use <strong>AKS</strong> to create our cluster with <strong>3</strong> worker node and their names are <strong>node-0</strong>, <strong>node-1</strong>, <strong>node-2</strong>. They are created by <strong>Azure VMSS</strong>.</p>
<p>When I deploy a <strong>pod-new</strong> through Helm, the scheduler always schedules <strong>pod-new</strong> to <strong>node-0</strong> or <strong>node-2</strong> even though those node with heavy workload.</p>
<p>Assume there is a <strong>pod-old</strong> on <strong>node-0</strong> or <strong>node-2</strong>, It will result in <strong>pod-old</strong> be evicted but still doesn't re-scheduled to <strong>node-1</strong>. I need to explicit use <strong>nodeSelector</strong> to move it to <strong>node-1</strong>.</p>
<p>Below is my <strong>deployment.yaml</strong>. To gain better resource usage, I don't specify <code>request</code> and <code>limit</code> cause my pod needs higher cpu-burst to do initialize. After initialization, it only needs a little resource to serve request.</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: aks-service
  labels:
    helm.sh/chart: service-0.1.0
    app.kubernetes.io/name: service
    app.kubernetes.io/instance: aks
    app.kubernetes.io/version: &quot;1.16.0&quot;
    app.kubernetes.io/managed-by: Helm
spec:
  replicas: 1
  minReadySeconds: 10
  selector:
    matchLabels:
      app.kubernetes.io/name: service
      app.kubernetes.io/instance: aks
  template:
    metadata:
      labels:
        app.kubernetes.io/name: service
        app.kubernetes.io/instance: aks
    spec:
      imagePullSecrets:
        - name: custom
      serviceAccountName: account-with-azure-cr
      securityContext:
        fsGroup: 2000
        runAsGroup: 3000
        runAsUser: 1000
      containers:
        - name: frontend
          image: imageurl
          imagePullPolicy: IfNotPresent
          ports:
            - name: port-frontend
              containerPort: 3000
              protocol: TCP
      terminationGracePeriodSeconds: 30
      volumes:
        - name: varlog
          hostPath:
            path: /var/log
        - name: varlibdockercontainers
          hostPath:
            path: /var/lib/docker/containers
        - name: varlogpod
          hostPath:
            path: /var/log/pods
</code></pre>

<p>In order for kubernetes to understand the resource utilization, requests data is used. You can read about best practices mentioned by AKS from <a href="https://learn.microsoft.com/en-us/azure/aks/developer-best-practices-resource-management" rel="nofollow noreferrer">link</a>.</p>
<p>Requests tells the kubernetes to block some resources for running the pods. I guess when you are saying provisioning of service, you are talking about pods only as pod is the working unit here (service is the load balancer abstraction which redirect the traffic to appropirate pod). Even if your pod requires very less resources, you can mention them in requests. Limit is something which k8s will enforce (so that is not required in your case) but requests should be must.</p>
<p>Quoting from above document</p>
<blockquote>
<p>In your pod specifications, it's best practice and very important to define these requests and limits based on the above information. If you don't include these values, the Kubernetes scheduler cannot take into account the resources your applications require to aid in scheduling decisions.</p>
</blockquote>
