Desired Functionality
When debugging or monitoring flows it is helpful to be able to quickly identify the specific kubernetes pod one is looking for. With local components the command kubectl get pods --show-labels will give enough information to narrow down which pod is which in most cases. The flow ID and step ID are both included in the pod name as well as separate labels on the pod for flowId and stepId.

With global components it is necessary to know the component ID.

It would be helpful to be able to easily identify global components by the name of the component as well, using a label such as compName.

When there are only one or two global components it is easy enough to keep them straight, but if there are 20, for example, it is difficult to keep them straight by component ID alone. This change would make it easier to navigate the deployed pods via the command line for those who prefer to use kubectl.
Solution Proposal
The file services/component-orchestrator/src/drivers/kubernetes/KubernetesDriver.js has a function _generateDeploymentDefinition()
(link) that specifies the labels the pods will have. Adding a label based on the component name could be done as the below snippet shows, where toSnakeCase() is a hypothetical function that would replace non alphanumeric characters with underscores.
if (component.isGlobal) {
labels = {
componentId: component.id,
compName: toSnakeCase(component.name),
};
link
Pros / Cons / Thoughts
- The label
compName is not used elsewhere in the project, so it is unlikely that the label will match any existing selectors
- This may be a niche use case - if others would not find this useful then it may not be worth the trouble
- Labels must conform to the requirements specified by Kubernetes
The most difficult aspect of this may be the character requirements - how would the word für be handled, for example? (ü is an invalid character for a Kubernetes label value)
Desired Functionality
When debugging or monitoring flows it is helpful to be able to quickly identify the specific kubernetes pod one is looking for. With local components the command
kubectl get pods --show-labelswill give enough information to narrow down which pod is which in most cases. The flow ID and step ID are both included in the pod name as well as separate labels on the pod forflowIdandstepId.With global components it is necessary to know the component ID.
It would be helpful to be able to easily identify global components by the name of the component as well, using a label such as
compName.When there are only one or two global components it is easy enough to keep them straight, but if there are 20, for example, it is difficult to keep them straight by component ID alone. This change would make it easier to navigate the deployed pods via the command line for those who prefer to use
kubectl.Solution Proposal
The file
services/component-orchestrator/src/drivers/kubernetes/KubernetesDriver.jshas a function_generateDeploymentDefinition()(link) that specifies the labels the pods will have. Adding a label based on the component name could be done as the below snippet shows, where
toSnakeCase()is a hypothetical function that would replace non alphanumeric characters with underscores.link
Pros / Cons / Thoughts
compNameis not used elsewhere in the project, so it is unlikely that the label will match any existing selectorsThe most difficult aspect of this may be the character requirements - how would the word
fürbe handled, for example? (üis an invalid character for a Kubernetes label value)