Hey @ Liana, You could use Horizontal Pod Autoscaler for this purpose.
It would scale all of them, internally the deployment creates a replica set (which does the scaling), and then a set number of pods are made by that replica set.
The pod is what actually holds both of those containers. and if you want to scale them independently they should be separate pods (and therefore replica sets, deployments, etc).
So for Horizontal Pod Autoscaler to work you need to specify min and max replicas and the threshold what percentage of cpu and memory you want your pods to autoscale..without having the manually run kubectl autoscale deployment.
you can use the below yaml file to do the same.
name: app targetCPUUtilizationPercentage: 70