# Split K8S services by version

**URL:** <https://community.dynatrace.com/t/split-k8s-services-by-version/45887>\
**Category:** Container platforms\
**Tags:** services-classic, process-groups, kubernetes\
**Created:** [June 3, 2024, 2:21pm UTC](https://community.dynatrace.com/t/split-k8s-services-by-version/45887 "2024-06-03T14:21:22Z")\
**Posts on this page:** 7\
**Page:** 1

<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:** [June 3, 2024, 2:21pm UTC](https://community.dynatrace.com/t/split-k8s-services-by-version/45887/1 "2024-06-03T14:21:22Z")

</div>

Hi guys,

Customer developers running few version of the same application on K8S cluster.

Dynatrace merge together all the pods from different version into unified service and we are asked to split the process by versions.

Each version running on its separated _workload_ name which look like **name-version#-subversion#**

_Kubernetes full pod name_ for each process also look like&nbsp; **name-version#-subversion#-podid**

But&nbsp;_Kubernetes group detection rule result_&nbsp;shows as **name-\*-\*-\*** and eventually collect all the process of different version together.

We have tried to set&nbsp; **Cloud application and workload detection** &nbsp;to ignore _Base pod name_&nbsp;with no success 😞

Any suggestion on how to sperate the processes ?

[@yair\_mashmor](https://community.dynatrace.com/user/6034)&nbsp;& Yos

---

<div class="post-metadata">

**Author:** ![cesarsaravia](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/cesarsaravia/32/12818_2.png) [@cesarsaravia](https://community.dynatrace.com/u/cesarsaravia)\
**Post date:** [June 3, 2024, 3:37pm UTC](https://community.dynatrace.com/t/split-k8s-services-by-version/45887/2 "2024-06-03T15:37:59Z")

</div>

Hi&nbsp;[@Yosi\_Neuman](https://community.dynatrace.com/user/6931)&nbsp;  
You should create an [Advanced detection rule](https://docs.dynatrace.com/docs/shortlink/process-groups#advanced) for the Process Groups based on k8s. Be sure to do not ignore the numbers because those are the versions are you expecting to split.

Example:

 ![cesarsaravia_1-1717428874891.png](https://global.discourse-cdn.com/dynatrace/original/3X/b/9/b9649d09c90ec56221277b522741b660e00f68f4.png)

Note: After creating this rule, you need to restart/killing the pods and wait to recreate new ones and the new PG rules applies.

Regards,  
Cesar S.

---

<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:** [June 4, 2024, 8:20am UTC](https://community.dynatrace.com/t/split-k8s-services-by-version/45887/3 "2024-06-04T08:20:25Z")

</div>

Hi&nbsp;[@cesarsaravia](https://community.dynatrace.com/user/30478)

That was our first approach, because it failed to split the processes we tried the&nbsp;_Cloud application and workload detection._

Will give it another try and will update

Thanks

Yos &&nbsp;[@yair\_mashmor](https://community.dynatrace.com/user/6034)

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [June 4, 2024, 9:25am UTC](https://community.dynatrace.com/t/split-k8s-services-by-version/45887/4 "2024-06-04T09:25:22Z")

</div>

Hey&nbsp;[@Yosi\_Neuman](https://community.dynatrace.com/user/6931)&nbsp;,

first of all - what deployment model in Kubernetes are you using? The answer pretty much depends on that. If you use cloudNativeFullStack or applicationOnly, you can use the [build label propagation feature](https://docs.dynatrace.com/docs/shortlink/build-label-propagation). It will set DT\_RELEASE\* environment variables based on the metadata of the workload.

If you use classicFullStack, this does not have any effect, but you can set the variables also manually in the application deployment (one of our customers preferred this way and stayed with classicFullStack for now).&nbsp; Don’t forget to set a rule in the cloud application and workload detection, for example:

 ![Julius_Loman_0-1717492913772.png](https://global.discourse-cdn.com/dynatrace/original/3X/6/a/6a39a300bece2070acde9d3161dda5c18da454e0.png)

If all this fails, you can use also old school methods of defining your own variable (maybe customer is using that!) and create a classic process group detection rule using this variable. But anyway, you should do that in a way which scales globally in your environment.

---

<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:** [June 4, 2024, 9:53am UTC](https://community.dynatrace.com/t/split-k8s-services-by-version/45887/5 "2024-06-04T09:53:46Z")

</div>

This is how I would approach to this too.

---

<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:** [June 4, 2024, 12:44pm UTC](https://community.dynatrace.com/t/split-k8s-services-by-version/45887/6 "2024-06-04T12:44:27Z")

</div>

Hi&nbsp;[@Julius\_Loman](https://community.dynatrace.com/user/3364)

Its&nbsp;classicFullStack and we tried the&nbsp;cloud application and workload detection with no success 😞

Will try the old school way 😐

Thanks&nbsp;[@yair\_mashmor](https://community.dynatrace.com/user/6034)&nbsp;& Yos

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [June 4, 2024, 2:01pm UTC](https://community.dynatrace.com/t/split-k8s-services-by-version/45887/7 "2024-06-04T14:01:24Z")

</div>

Yes, old school way will work. However, it might be possible for you to automate this at the deployment level - but it depends on how the customer is deploying apps. If they have automation and basic templates, it’s possible to do it there and maybe setup the DT\_RELEASE\* variables.

Be sure to investigate this option too.
