-
Notifications
You must be signed in to change notification settings - Fork 65
Sourcecategories in Sumo appending numbers #115
Comments
cc @bendrucker : ill look into this as soon as I can, but seems likely related to the fix for #78 |
What version of Kubernetes are you running? |
We're running OpenShift v3.3 which includes Kubernetes v1.3. |
Gotcha, seems like there's probably no test coverage for that pod name format anymore. I can look into it in a few. |
We are in the middle of upgrading to OpenShift v3.9 which includes Kubernetes v1.9, but the symbolic links where I believe the code retrieves the pod name from is the same format as in K8S v1.3. For example, the first one is docker-registry-2-mqe0f... Where docker-registry is the pod_name, 2 is the deployment config counter, and mqe0f is the hash. The problem is its inconsistent on what is retrieves as the _sourceCategory. Sometimes it'll be "docker-registry", sometimes it'll be "docker-registry-2".
|
So the actual pod name is |
I suspect the regression that's affecting you from #78 has to do with the pod template hash. Rather than hardcode error-prone patterns based on string formatting (i.e. strip this part if it's numbers), we switched to actually detecting the pod template hash and deterministically stripping the dynamic parts. I'm trying to get a 1.3 cluster up on minikube but in case that doesn't seem viable so a full pod from your cluster would be helpful. |
`[svc-vxby-ose@master01-devtest-vxbyr ~]$ oc get po docker-registry-3-9n3bx -o yaml
|
From what you posted, the deployment name is |
I'm guessing deployment name wasn't always where the _sourceCategory got his values from. This is new behavior. Also, as Frank mentiond above, #78 was only fixed/closed in December 2018 which matches the first reports of this new behavior. What changed in #78 and why? How do we undo it without manually using an old version that will not be maintained? |
I don't see any reason to assume that #78 was closed by #100. #78 identified bugs in the original naive implementation of replica pod sanitization. The original implementation would remove the second to last segment of the pod name if it were a number. This is unnecessarily naive. This numeric value was the pod template hash which is included as a label on the pods. In later versions of k8s, that numeric value was mapped to an alphanumeric encoding, breaking the naive name sanitization. #100 takes the template hash, looks for the numeric or alphanumeric version in the pod name, and removes that segment by exact match. Anything else you do to your pods, including numbers, is left behind. This feature was meant to target Kubernetes ReplicaSets and this plugin was stripping bits of your pod name due to a bug. It sucks, but sometimes bug fixes are breaking changes if you were depending on buggy behavior. I made some suggestions above on how to provide a specific metadata template with labels—that would let you define conventions that match your stack. I don't think it would be a good idea to re-introduce behavior that parses pod name conventions outside of what's present in k8s core. |
I was looking for something else and came across this ticket and noticed it was still open. I think we can close this now. Thanks for explaining it @bendrucker. |
For 2.1 and beyond, user is seeing an issue where sourecategories are populating like this:
app_prod/some_app_name
app_prod/some_app_name_62
app_prod/some_app_name 63...
Can provide more info offline as needed.
Thanks!
Jeff W.
TAM, Sumo
The text was updated successfully, but these errors were encountered: