-
Notifications
You must be signed in to change notification settings - Fork 8
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
recover etcd: Remove kube-apiserver container to trigger immediate restart #97
Conversation
Verified that kube-apiserver is immediately restarted by kubelet, and that it is healthy. |
cmd/etcd.go
Outdated
log.Printf("Warning: Unable to restart kubelet on machine %q: %v", mwc.Machine.Name, err) | ||
log.Printf("[recover etcd] Removing kube-apiserver container on master %q to trigger immediate restart", mwc.Machine.Name) | ||
if err := removeKubeAPIServerContainer(mwc.Client); err != nil { | ||
log.Fatalf("Unable to remove kube-apiserver container on master %q: %v", mwc.Machine.Name, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Daniel, do we want to log fatal here or return the errr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, fixing.
cmd/etcd.go
Outdated
if err != nil { | ||
return "", fmt.Errorf("error running %q: %v (stdout: %q, stderr: %q)", cmd, err, string(stdOut), string(stdErr)) | ||
} | ||
return string(stdOut), nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is trimming of the string, required as well here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes--without it there is a trailing newline. Fixing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Daniel, thanks for fixing this, few small questions
8fbda83
to
1d979d9
Compare
Squashed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into this Daniel.
|
||
func identifyDockerContainer(filters []string, client sshmachine.Client) (string, error) { | ||
filterFlags := buildDockerFilterFlags(filters) | ||
cmd := fmt.Sprintf("docker ps --quiet %s", filterFlags) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be better to use docker inspect --format="{{.Id}}" contianer_name
? Although I suppose it would be difficult to get the exact container name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the name includes UIDs that we can't derive.
Fixes #98