Custom resource limitation

Hi, guys.
I’m doing a project in which I have a licensed software to run on a container. I have a pod with only one container that requests a token to a server based on the license it has mounted as volume in it. The problem is I can not have more than one pod requesting tokens, otherwise I could create some problems in production. My goal is the following:
I create a custom resource: softwarex-licenses in namespace namespacex
I set the limit of this resource usage to some valuex
When the pod is to be created, the api notices it and compares to the limit.
So, basically I want to create a resourcequota with a custom metric, but as long as I know, there’s no native support for that.
What I AM doing:
I created a custom namespace licensed-software-namespacex
I created a resourcequota limiting the number of pods in this namespace
Then run the pod with licensed software in a private namespace
So basically I am limiting the number of pods in the namespace, but I know there could be more than one container per pod, so it is not ideal.

Is there any better way to solve this problem?