# Split services based on Kubernetes Cluster they are running

**URL:** <https://community.dynatrace.com/t/split-services-based-on-kubernetes-cluster-they-are-running/44111>\
**Category:** Container platforms\
**Tags:** services-classic, processes, kubernetes\
**Created:** [February 13, 2024, 10:41pm UTC](https://community.dynatrace.com/t/split-services-based-on-kubernetes-cluster-they-are-running/44111 "2024-02-13T22:41:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Theodore\_x86](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/theodore_x86/32/17620_2.png) [@Theodore\_x86](https://community.dynatrace.com/u/Theodore_x86)\
**Post date:** [February 13, 2024, 10:41pm UTC](https://community.dynatrace.com/t/split-services-based-on-kubernetes-cluster-they-are-running/44111/1 "2024-02-13T22:41:10Z")

</div>

Hello.

We have two identical AKS clusters with deployed the exact applications/services. As expected, Dynatrace wraps all the above apps to the same process group/service.

We want to distinguish the services based on the AKS they are running. However, on process detection rules there is no condition based on Kubernetes Cluster ID. My best guess is to assign AKS nodes to different host groups so that different process groups are created. I am not quite sure if this is even going to work, since AKS nodes are more of an abstract layer rather that common hosts.

Any better idea to tune this than the “host group” concept?

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [February 14, 2024, 6:27am UTC](https://community.dynatrace.com/t/split-services-based-on-kubernetes-cluster-they-are-running/44111/2 "2024-02-14T06:27:50Z")

</div>

Hi&nbsp;[@Theodore\_x86](https://community.dynatrace.com/user/50066)

IMO You can use the Group filed in the k8s installation page

 ![Yosi_Neuman_2-1707892053096.png](https://global.discourse-cdn.com/dynatrace/original/3X/6/a/6aa754582639c4a9244ffe7b3f0ac67c048d81f7.png)

Which will add the _arg --set-host-group=first_ to the dynakub.yaml

 ![Yosi_Neuman_1-1707891943734.png](https://global.discourse-cdn.com/dynatrace/original/2X/2/20e2b04a94156969484bedf8cb375005d6f3e6d6.png)

And also a network zone will be crated under this name.

HTH

Yos

---

<div class="post-metadata">

**Author:** ![PacoPorro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pacoporro/32/36087_2.png) [@PacoPorro](https://community.dynatrace.com/u/PacoPorro)\
**Post date:** [February 14, 2024, 8:29am UTC](https://community.dynatrace.com/t/split-services-based-on-kubernetes-cluster-they-are-running/44111/3 "2024-02-14T08:29:47Z")

</div>

Also, you can use the&nbsp;DT\_RELEASE\_STAGE and&nbsp;DT\_RELEASE\_PRODUCT env variables.

> **[Cloud application and workload detection](https://docs.dynatrace.com/docs/observe/infrastructure-observability/process-groups/configuration/cloud-app-and-workload-detection)**
>
> Detect cloud applications and workloads, and define rules to merge similar Kubernetes workloads into process groups.

---

<div class="post-metadata">

**Author:** ![Theodore\_x86](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/theodore_x86/32/17620_2.png) [@Theodore\_x86](https://community.dynatrace.com/u/Theodore_x86)\
**Post date:** [February 14, 2024, 10:00am UTC](https://community.dynatrace.com/t/split-services-based-on-kubernetes-cluster-they-are-running/44111/4 "2024-02-14T10:00:54Z")

</div>

Thanks Yosi. We are not using the direct “Deploy Dynatrace” page, since we go for the CloudNativeFullStack deployment. But it’s basically the same thing, it just creates the yaml for you.

BR

Theodore

---

<div class="post-metadata">

**Author:** ![DynaGibbo](https://avatars.discourse-cdn.com/v4/letter/d/9de053/32.png) [@DynaGibbo](https://community.dynatrace.com/u/DynaGibbo)\
**Post date:** [February 15, 2024, 12:47am UTC](https://community.dynatrace.com/t/split-services-based-on-kubernetes-cluster-they-are-running/44111/5 "2024-02-15T00:47:53Z")

</div>

We had the same issue when we moved to cloud native full stack and kubernetes cluster isn’t a field you can distinguish services on.  
Our solution was to inject the set-host-group value into the dynatrace CRD, specifically the cloud

eg.

apiVersion: [dynatrace.com/v1beta1](http://dynatrace.com/v1beta1)

kind: DynaKube

metadata:

name: dynakube

namespace: dynatrace

annotations:

[feature.dynatrace.com/automatic-kubernetes-api-monitoring:](http://feature.dynatrace.com/automatic-kubernetes-api-monitoring:) “true”

[feature.dynatrace.com/enable-activegate-authtoken:](http://feature.dynatrace.com/enable-activegate-authtoken:) “true”

[feature.dynatrace.com/max-csi-mount-attempts:](http://feature.dynatrace.com/max-csi-mount-attempts:) “3”

spec:

customPullSecret: dynakube-pull-secret

apiUrl: https://{environmentid}.live.dynatrace.com/api

oneAgent:

cloudNativeFullStack:

args:

- “--set-host-group=###”

---

<div class="post-metadata">

**Author:** ![Theodore\_x86](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/theodore_x86/32/17620_2.png) [@Theodore\_x86](https://community.dynatrace.com/u/Theodore_x86)\
**Post date:** [February 26, 2024, 11:22am UTC](https://community.dynatrace.com/t/split-services-based-on-kubernetes-cluster-they-are-running/44111/6 "2024-02-26T11:22:50Z")

</div>

Yes exactly, that is what we did also eventually. Host group is the solution ultimately.

BR
