I'm trying to setup docker registry via Traefik, authenticated by a Service account bearer token. The problem is that the name of default service token secret is ended with some random characters, which can not be passed to the Ingress config, or can it?
Anyway, I want to somehow force Kubernetes to name the token in a predictable way.
The current solution is to create an API token manually.
kind: Secret
metadata:
name: account-token
annotations:
kubernetes.io/service-account.name: account
type: kubernetes.io/service-account-token
Unfortunately, the original randomly named token is still in the system, and can not be removed.
If it is created before Service account it is dropped, but when after then the randomized secret is.
default-token-r9dm9
? Why do yo have to pass it to the Ingress? – weibeld