No clear Documentation on how to use the library in k8 environment #106
Comments
@vijayparashar12 good point, we should add some (Zalando internal) documentation. Here is an usage example: https://github.com/zalando-stups/aws-credentials-service/blob/master/app.py Generally speaking, what you need:
import tokens
tokens.configure()
tokens.manage('mytoken', ['uid']) # "mytoken" needs to match what was defined in PlatformCredentialsSet
tokens.start()
tokens.get('mytoken') |
@hjacobs Thanks for the answer, but maybe I was not clear when I created the issue, but what I was looking for is that how can I configure a library that it can work both in STUP and K8 together at the same time, as currently we only want to move our staging in k8 and production in STUP and move production service when we have gain confidence. P.S I will try to ask this question in Zalando internal forums to get more contextual ans wer |
@vijayparashar12 the above code will work for both STUPS and Kubernetes, you just need to set the right env vars and make sure that the token name corresponds to the token name in PlatformCredentialsSet (the token name did not matter in STUPS). |
form what i can see in the |
@BGehrels Library works on fallback mechanism if they do not find K8 environment they try to fetch token from the token provider via rest. I will say current design is not at all intuitive on whats going on inside the library. |
@vijayparashar12 @BGehrels please have a look to latest README.md. If you still think there is something missing or should be changed propose your changes in a PR please. |
Looks great, thanks @jbellmann |
I do not find any clean documentation how to use tokens library in kubernetes environment .
The text was updated successfully, but these errors were encountered: