-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
oc cluster up with metrics fails with "No API token found for service account metrics-deployer" #11946
Comments
NOTE: this isn't working for me. It might be a OS bug. See: openshift/origin#11946
@pweil- I don't believe this has anything to do with Origin Metrics directly. Setting up the service account is done as part of the cluster up command. If @jmazzitelli installs origin metrics directly then it works for him. And if I follow the steps outlined in what he is doing, then it works properly for me. |
I just want to be clear about the replication procedures, I get this failure by doing nothing special other than download the oc binary, untar it, and run it via sudo:
For the record, I am on Fedora 23, with "uname -a" as follows:
|
if we are synchronously creating a service account then immediately creating a pod that uses it, that code needs to be able to retry creating the pod if it is forbidden because the service account's token hasn't been auto-generated yet. |
@liggitt thanks, would changing it to a Job do the trick? |
@soltysh could confirm, but I would expect so |
I'm quickly going to see if this works. Not sure if you'd want a PR with this (this changes the code so it just keeps retrying if the error it gets is this "retry after the token is ready" error message. I suspect this is going to fix it (if this truly is a case where retrying will help - I will see in a minute). - deployerPod := metricsDeployerPod(hostName, imagePrefix, imageVersion)
- if _, err = kubeClient.Pods(infraNamespace).Create(deployerPod); err != nil {
- return errors.NewError("cannot create metrics deployer pod").WithCause(err).WithDetails(h.OriginLog())
+ for keepTrying := true; keepTrying == true; {
+ deployerPod := metricsDeployerPod(hostName, imagePrefix, imageVersion)
+ if _, err = kubeClient.Pods(infraNamespace).Create(deployerPod); err != nil {
+ if !strings.Contains(err.Error(), "retry after the token") {
+ return errors.NewError("cannot create metrics deployer pod").WithCause(err).WithDetails(h.OriginLog())
+ }
+ } else {
+ keepTrying = false
+ } |
That fix works. My "cluster up" command finished successfully and I do see this in the output:
|
@jmazzitelli thanks for confirming that's the problem. I'd rather simply instantiate a job so that the job controller can do the retry for us. |
@csrwng sounds good to me. thanks for looking into this. |
Submitted pull request #12174 for review |
Closed via #12174 |
NOTE: this isn't working for me. It might be a OS bug. See: openshift/origin#11946
Cannot run "oc cluster up --metrics" successfully. It always fails.
Version
Steps To Reproduce
Current Result
Expected Result
Successful install of OpenShift with metrics.
Additional Information
I originally did not have my user in the docker group, which is why I prefix my command with "sudo". However, I did try this by putting my user in the docker group, and it didn't help. Same problem occurs. So I do not think it is related, but here's what I did:
$ sudo groupadd docker && sudo gpasswd -a ${USER} docker && sudo systemctl restart docker && newgrp docker
Also, I build "oc" from current master branch, and I get the same problem.
The text was updated successfully, but these errors were encountered: