I have setup like this:
- one container "cont1" in Azure ACR with one image and one tag (image1:1.0.0),
- AKS cluster with one custom defined namespace: testns,
- two separate deployments: deploy1, deploy2.
Those deployments share same (mentioned above) image. I have separate defined resources for each deplyment wit different CPU and Memory parameteres. My trouble is that I would like to have two separate HPA for every deployment (separatly). If I make two separated HPAs Kubernetes will combine metrics from two deplyments' pods. There is also information that two HPA cannot contol one image. How to do this?
Don't think HPA cobines metrics from two deployments, unless you have used same labels for the pods. Here is an example based on https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/
Deployment 1
Deploy it on namespace testns
Deployment 2
Deploy it on namespace testns
Then run a load on the first deployment
Then we can observer HPA triggers correctly on specific deployment.