I know that segments will be the future and MZ will be retired, but until that maybe you can use this possible solution for MZ management in kubernetes environments.
Let's assume you organize your applications by namespace level and you need MZ for filtering and access management purposes.
Basic of these Management zones are tags. So the first step is tagging the belonging entitis. Only one concrete value in this solution the namesapce name (or namespaces) . Rest of the tags are dinamic. I am trying to collect all relevant entities with in a namesapce. Only one entitiy type is missing the Cloud Application Insatance. It is not allowed to tag this entitiy type.
Here is an example for tagging. Atomatiacally applied tag name is okduat_8. The namespace selector is entityName.startsWith(\"uat8\")
"value": {
"name": "okduat_8",
"rules": [
{
"enabled": true,
"valueNormalization": "Leave text as-is",
"type": "SELECTOR",
"entitySelector": "type(\"SERVICE\"),serviceType(DATABASE_SERVICE),toRelationships.Calls(type(\"SERVICE\"),tag(\"okduat_8\"))"
},
{
"enabled": true,
"valueNormalization": "Leave text as-is",
"type": "SELECTOR",
"entitySelector": "type(\"kafka:topic\"),toRelationships.Calls(type(\"kafka:consumer\"),tag(\"okduat_8\"))"
},
{
"enabled": true,
"valueNormalization": "Leave text as-is",
"type": "SELECTOR",
"entitySelector": "type(\"kafka:topic\"),toRelationships.Calls(type(\"kafka:producer\"),tag(\"okduat_8\"))"
},
{
"enabled": true,
"valueNormalization": "Leave text as-is",
"type": "SELECTOR",
"entitySelector": "type(\"kafka:producer\"),fromRelationships.IsSameAs(type(\"PROCESS_GROUP_INSTANCE\"),tag(\"okduat_8\"))"
},
{
"enabled": true,
"valueNormalization": "Leave text as-is",
"type": "SELECTOR",
"entitySelector": "type(\"kafka:consumer\"),fromRelationships.IsSameAs(type(\"PROCESS_GROUP_INSTANCE\"),tag(\"okduat_8\"))"
},
{
"enabled": true,
"valueNormalization": "Leave text as-is",
"type": "SELECTOR",
"entitySelector": "type(\"KUBERNETES_NODE\"),toRelationships.isClusterOfNode(type(\"KUBERNETES_CLUSTER\"),tag(\"okduat_8\"))"
},
{
"enabled": true,
"valueNormalization": "Leave text as-is",
"type": "SELECTOR",
"entitySelector": "type(\"CONTAINER_GROUP\"),toRelationships.isInstanceOf(type(\"CONTAINER_GROUP_INSTANCE\"),tag(\"okduat_8\"))"
},
{
"enabled": true,
"valueNormalization": "Leave text as-is",
"type": "SELECTOR",
"entitySelector": "type(\"CONTAINER_GROUP_INSTANCE\"),fromRelationships.isCgiOfNamespace(type(\"CLOUD_APPLICATION_NAMESPACE\"),tag(\"okduat_8\"))"
},
{
"enabled": true,
"valueNormalization": "Leave text as-is",
"type": "SELECTOR",
"entitySelector": "type(\"CLOUD_APPLICATION\"),toRelationships.isNamespaceOfCa(type(\"CLOUD_APPLICATION_NAMESPACE\"),tag(\"okduat_8\"))"
},
{
"enabled": true,
"valueNormalization": "Leave text as-is",
"type": "SELECTOR",
"entitySelector": "type(\"SERVICE\"),fromRelationships.RunsOn(type(\"PROCESS_GROUP\"),tag(\"okduat_8\"))"
},
{
"enabled": true,
"valueNormalization": "Leave text as-is",
"type": "SELECTOR",
"entitySelector": "type(\"PROCESS_GROUP\"),toRelationships.isNamespaceOfPg(type(\"CLOUD_APPLICATION_NAMESPACE\"),tag(\"okduat_8\"))"
},
{
"enabled": true,
"valueNormalization": "Leave text as-is",
"type": "SELECTOR",
"entitySelector": "type(\"PROCESS_GROUP_INSTANCE\"),fromRelationships.isInstanceOf(type(\"PROCESS_GROUP\"),tag(\"okduat_8\"))"
},
{
"enabled": true,
"valueNormalization": "Leave text as-is",
"type": "SELECTOR",
"entitySelector": "type(\"KUBERNETES_SERVICE\"),toRelationships.isNamespaceOfKubernetesSvc(type(\"CLOUD_APPLICATION_NAMESPACE\"),tag(\"okduat_8\"))"
},
{
"enabled": true,
"valueNormalization": "Leave text as-is",
"type": "SELECTOR",
"entitySelector": "type(\"HOST\"),toRelationships.RunsOn(type(\"PROCESS_GROUP\"),tag(\"okduat_8\"))"
},
{
"enabled": true,
"valueNormalization": "Leave text as-is",
"type": "SELECTOR",
"entitySelector": "type(\"HOST_GROUP\"),toRelationships.isInstanceOf(type(\"HOST\"),tag(\"okduat_8\"))"
},
{
"enabled": true,
"valueNormalization": "Leave text as-is",
"type": "SELECTOR",
"entitySelector": "type(\"CLOUD_APPLICATION_NAMESPACE\"),entityName.startsWith(\"uat8\")"
},
{
"enabled": true,
"valueNormalization": "Leave text as-is",
"type": "SELECTOR",
"entitySelector": "type(\"KUBERNETES_CLUSTER\"),fromRelationships.isClusterOfNamespace(type(\"CLOUD_APPLICATION_NAMESPACE\"),tag(\"okduat_8\"))"
}
]
}
Here is the result in the GUI, (some extra in it the kafka entities, but you can extend it with other types of entities):

If your entities are tagged you can create the MZ rule. Here is an example for the MZ rule:
"value": {
"name": "okduat_8",
"rules": [
{
"enabled": true,
"type": "SELECTOR",
"entitySelector": "type(\"CLOUD_APPLICATION_INSTANCE\"),toRelationships.isNamespaceOfCai(type(\"CLOUD_APPLICATION_NAMESPACE\"),tag(\"okduat_8\"))"
},
{
"enabled": true,
"type": "SELECTOR",
"entitySelector": "type(\"kafka:topic\"),tag(\"okduat_8\")"
},
{
"enabled": true,
"type": "SELECTOR",
"entitySelector": "type(\"kafka:producer\"),tag(\"okduat_8\")"
},
{
"enabled": true,
"type": "SELECTOR",
"entitySelector": "type(\"kafka:consumer\"),tag(\"okduat_8\")"
},
{
"enabled": true,
"type": "SELECTOR",
"entitySelector": "type(\"SERVICE\"),tag(\"okduat_8\")"
},
{
"enabled": true,
"type": "SELECTOR",
"entitySelector": "type(\"PROCESS_GROUP\"),tag(\"okduat_8\")"
},
{
"enabled": true,
"type": "SELECTOR",
"entitySelector": "type(\"PROCESS_GROUP_INSTANCE\"),tag(\"okduat_8\")"
},
{
"enabled": true,
"type": "SELECTOR",
"entitySelector": "type(\"KUBERNETES_SERVICE\"),tag(\"okduat_8\")"
},
{
"enabled": true,
"type": "SELECTOR",
"entitySelector": "type(\"KUBERNETES_NODE\"),tag(\"okduat_8\")"
},
{
"enabled": true,
"type": "SELECTOR",
"entitySelector": "type(\"KUBERNETES_CLUSTER\"),tag(\"okduat_8\")"
},
{
"enabled": true,
"type": "SELECTOR",
"entitySelector": "type(\"HOST\"),tag(\"okduat_8\")"
},
{
"enabled": true,
"type": "SELECTOR",
"entitySelector": "type(\"HOST_GROUP\"),tag(\"okduat_8\")"
},
{
"enabled": true,
"type": "SELECTOR",
"entitySelector": "type(\"CONTAINER_GROUP\"),tag(\"okduat_8\")"
},
{
"enabled": true,
"type": "SELECTOR",
"entitySelector": "type(\"CONTAINER_GROUP_INSTANCE\"),tag(\"okduat_8\")"
},
{
"enabled": true,
"type": "SELECTOR",
"entitySelector": "type(\"CLOUD_APPLICATION\"),tag(\"okduat_8\")"
},
{
"enabled": true,
"type": "SELECTOR",
"entitySelector": "type(\"CLOUD_APPLICATION_NAMESPACE\"),tag(\"okduat_8\")"
}
]
}