Skip to content
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

federation e2e: Adding retries to fetching secret in controller manager #27823

Merged
merged 1 commit into from
Jun 22, 2016

Conversation

nikhiljindal
Copy link
Contributor

Ref: #27708

Trying to fix the following failure in fed controller manager:

error in fetching secret: Get https://10.0.0.1:443/api/v1/namespaces/federation/secrets/federation-apiserver-secret: dial tcp 10.0.0.1:443: i/o timeout

I am not sure why that error is happening in the first place. kube-proxy should have been configured before fed controller manager pod comes up. I didnt find anything wrong in kube-proxy logs.
The request never reaches fed apiserver.
Lets see if adding retries helps.

cc @kubernetes/sig-cluster-federation @mml @colhom

@nikhiljindal nikhiljindal changed the title Adding retries to fetching secret in controller manager federation e2e: Adding retries to fetching secret in controller manager Jun 22, 2016
@nikhiljindal nikhiljindal added this to the v1.3 milestone Jun 22, 2016
@nikhiljindal nikhiljindal assigned ghost Jun 22, 2016
)

const (
KubeAPIQPS = 20.0
KubeAPIBurst = 30
KubeconfigSecretDataKey = "kubeconfig"
getSecretTimeout = 1 * time.Minute
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have kept the timeout to 1 min.
Happy to reduce it but want to first make sure that the test passes on jenkins.
We can look at the log and see how much time is it taking and adjust timeout based on that.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Please use standard timeouts from the utils package.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean: https://github.com/kubernetes/kubernetes/blob/master/test/e2e/framework/util.go?
Thats the package that has standard timeouts.
But I cannot depend on test code from here. We can perhaps refactor that library to move generic parts out of test.

@k8s-github-robot k8s-github-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. release-note-label-needed labels Jun 22, 2016
@nikhiljindal nikhiljindal added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note-label-needed labels Jun 22, 2016
@@ -101,9 +105,16 @@ var KubeconfigGetterForSecret = func(secretName string) clientcmd.KubeconfigGett
return nil, fmt.Errorf("error in creating in-cluster client: %s", err)
}
data = []byte{}
secret, err := client.Secrets(namespace).Get(secretName)
var secret *api.Secret
for start := time.Now(); time.Since(start) < getSecretTimeout; time.Sleep(2 * time.Second) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Please use standard retry periods from the utils package. Better still, use wait.Poll (or whatever it's called) from the utils package.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated the code to use wait.Poll

@ghost
Copy link

ghost commented Jun 22, 2016

Some minor nits, then LGTM. Feel free to apply the label yourself once addressed. Thanks @nikhiljindal

@nikhiljindal
Copy link
Contributor Author

Thanks! Updated code as per comments.
Adding LGTM tag as per comment above.

@nikhiljindal nikhiljindal added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Jun 22, 2016
@k8s-bot
Copy link

k8s-bot commented Jun 22, 2016

GCE e2e build/test passed for commit c59de79.

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Jun 22, 2016

GCE e2e build/test passed for commit c59de79.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 1e2f70d into kubernetes:master Jun 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants