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

Add alternative names for the server binaries to hyperkube #41017

Merged
merged 2 commits into from
Feb 10, 2017

Conversation

luxas
Copy link
Member

@luxas luxas commented Feb 6, 2017

What this PR does / why we need it:

Right now one can't swap a server image to the hyperkube image without touching the command field in the yaml spec, and that's daunting and leading to extra and unnecessary logic for example in kubeadm.

This makes the hyperkube image directly swappable, so now /usr/local/bin/kube-* is a portable first argument (or simply kube-* if there's a shell).

Special notes for your reviewer:

Release note:

Align the hyperkube image to support running binaries at /usr/local/bin/ like the other server images

@jessfraz @thockin @ixdy

@k8s-reviewable
Copy link

This change is Reviewable

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 6, 2017
@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Feb 6, 2017
@@ -76,8 +78,11 @@ RUN ln -s /hyperkube /apiserver \
&& ln -s /hyperkube /kubectl \
&& ln -s /hyperkube /kubelet \
Copy link
Member

Choose a reason for hiding this comment

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

while at it, may be add symlinks in /usr/local/bin for these two also? It's kind of annoying these aren't in the path...

@@ -27,8 +27,10 @@ func NewKubeAPIServer() *Server {
s := options.NewServerRunOptions()

hks := Server{
SimpleUsage: "apiserver",
Long: "The main API entrypoint and interface to the storage system. The API server is also the focal point for all authorization decisions.",
name: "apiserver",
Copy link
Member

Choose a reason for hiding this comment

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

is it necessary to add name for all of these? doesn't Name() DTRT already?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not 100% required, but I think it's a little bit cleaner than just relying on SimpleUsage for this

Copy link
Member

Choose a reason for hiding this comment

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

not critical, but if we're going to add names for everything, maybe also add them for the federation- servers and then just simplify Name()?

@@ -55,7 +55,7 @@ func (hk *HyperKube) AddServer(s *Server) {
// FindServer will find a specific server named name.
func (hk *HyperKube) FindServer(name string) (*Server, error) {
for _, s := range hk.servers {
if s.Name() == name {
if s.Name() == name || s.AlternativeName == name {
Copy link
Member

Choose a reason for hiding this comment

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

it's not 100% correct, but I wonder if just additionally checking for a kube- prefix would be an easier way of accomplishing the same thing.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I thought about that as well, but I think the code changes are so small in any case it's worth to do it "the real way"

@luxas
Copy link
Member Author

luxas commented Feb 9, 2017

@ixdy Does this look good to you if I fix the nit @errordeveloper mentioned?

@luxas luxas force-pushed the symlink_hyperkube branch from b47fb57 to 6f6ddc0 Compare February 9, 2017 19:46
@luxas
Copy link
Member Author

luxas commented Feb 10, 2017

@k8s-bot gci gke e2e test this
@k8s-bot gci gce e2e test this

SimpleUsage string // One line description of the server.
Long string // Longer free form description of the server
Run serverRunFunc // Run the server. This is not expected to return.
AlternativeName string
Copy link
Member

Choose a reason for hiding this comment

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

maybe add a comment for this?

@ixdy
Copy link
Member

ixdy commented Feb 10, 2017

/lgtm
with a few minor comments/suggestions

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 10, 2017
@mikedanese
Copy link
Member

/approve

please squash

@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

The following people have approved this PR: luxas, mikedanese

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 10, 2017
@mikedanese mikedanese added the do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. label Feb 10, 2017
@mikedanese
Copy link
Member

Also @ixdy has a comment.

@luxas
Copy link
Member Author

luxas commented Feb 10, 2017

The commits are logical, one for modifying cmd/hyperkube, one for modifying the image.

May I please add the comment in a future PR if that's important? I'd like to get this in during the weekend in time for v1.6.0-alpha.2 (so kubeadm can be simplified) and I'm going to sleep now :)

@ixdy
Copy link
Member

ixdy commented Feb 10, 2017

I'm fine with addressing my two comments in a separate PR.

@mikedanese mikedanese removed the do-not-merge DEPRECATED. Indicates that a PR should not merge. Label can only be manually applied/removed. label Feb 10, 2017
@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 38252, 41122, 36101, 41017, 41264)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants