Kubernetes query avg cpu/memory/disk-usage by DEPLOYMENT

Is there a way to query kubernetes deployment metrics and make a dashboard with them for : cpu/memory/disk-usage by kubernetes-DEPLOYMENT?

For the moment i manage to query metrics by container/pod ,

avg by(container)(container_memory_usage_bytes{pod="$pod", container=~“tomcat”})
avg by (container)(rate(container_cpu_user_seconds_total{image!="",container!=“POD”,pod="$pod"}[30s])*100)

My question is if we can query this by DEPLOYMENT , because pods are changed during the day and new pod-ids are lauched every day, but deployment is stable/fixed

Hi, did you resolve this?

I interogate the query by service=~"$service" . This was the fix.