Blog
Home

Kubernetes tip 3: Pinning workloads to specific nodes

14 July 2026 · 59 views

Sometimes you want a workload on a specific node pool or VM size. A simple way is to label the node and use nodeSelector in the deployment.

kubectl label nodes aks-b2suser-xxxx podtype=user

In the deployment yaml of the microservice add nodeSelector:

spec:
  template:
    spec:
      nodeSelector:
        podtype: "user"

You can also target a specific VM size when that fits the workload better:

spec:
  nodeSelector:
    node.kubernetes.io/instance-type: Standard_B2ms

It is a small detail, but it helps with workload placement, isolation, and cost control.

Deployment yaml snippet screenshot

Co-authored with Claude.

If this was useful, you can buy me a coffee.

New articles: follow via RSS.

Comments

← All articlesView as Markdown