How to generate environment api token for Kubernetes 1.6

It’s essentially just a wrapped regular API key/authorization header.

base64encode('Basic ' + base64encode('<access key>:<secret key>'))

Example:

access_key = 5D06A82B3A6C3BF2324E
secret_key = 5hYcESwP2LUzkTCLJMqsZgbyrregXUM7dFdsf8oJ

auth_header = 'Basic ' + base64(access_key + ':' + secret_key)
# NUQwNkE4MkIzQTZDM0JGMjMyNEU6NWhZY0VTd1AyTFV6a1RDTEpNcXNaZ2J5cnJlZ1hVTTdkRmRzZjhvSg==

token = base64(auth_header)
# QmFzaWMgTlVRd05rRTRNa0l6UVRaRE0wSkdNak15TkVVNk5XaFpZMFZUZDFBeVRGVjZhMVJEVEVwTmNYTmFaMko1Y25KbFoxaFZUVGRrUm1SelpqaHZTZz09
1 Like