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

WIP: Add kubelet RPM package builds. #50

Merged
merged 4 commits into from
Aug 16, 2016
Merged

Conversation

dgoodwin
Copy link
Contributor

@dgoodwin dgoodwin commented Aug 8, 2016

First attempt at the RPMs requested in issue #37.

This is intended to be relatively self contained build process that can hopefully be integrated into the larger k8s release process, just drop into the
directory and run the build-docker.sh script to launch a Docker
container with appropriate rpm/yum tooling.

Resulting rpms and yum repository metadata will appear in output/
sub-directory and can then just be rsynced, after which client systems just need a simple yum repository file similar to this one I tested with (don't try to use it it's not publically accessible):

[root@centos1 ~]# cat /etc/yum.repos.d/kubernetes.repo 
[kubernetes]
name=K8s Repository
baseurl=http://file.rdu.redhat.com/~dgoodwin/kubernetes-rpms/
enabled=1
gpgcheck=0

I took an alternate naming scheme from the Debian equivalent in #35 and packaged this as "kubernetes" rather than "kubelet", the reasoning behind this was that between hyperkube, an possible incoming rename to kube, self-hosting, and discussion around kube-master and kube-node etc, I don't know as the kubelet name will survive as the thing a user should be thinking to install. "kubernetes" however, should remain constant at least as a base package in all of this and wherever we end up. This also more closely matches the Fedora RPM packaging today which is further decomposed into the following packages:

kubernetes.x86_64 : Container cluster management
kubernetes-client.x86_64 : Kubernetes client tools
kubernetes-node.x86_64 : Kubernetes services for node host
kubernetes-master.x86_64 : Kubernetes services for master host

And I suspect we may want to synchronize approaches in the future depending on how all the binary renames play out.

cc @mikedanese @kubernetes/sig-cluster-lifecycle @detiber @timstclair

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@lukemarsden
Copy link
Contributor

Thank you @dgoodwin!

@timstclair
Copy link

I think you mentioned the wrong Tim :) Were you looking for @thockin or @timothysc?

@mindfulmonk
Copy link

mindfulmonk commented Aug 9, 2016

Thanks so much @dgoodwin for this, having RPMS will make it much easier to run latest kubernetes.

I did encounter an issue building the packages though:

zip.x86_64 3.0-16.fc24                                                        

Complete!
19 files removed
 ---> 25c34c8c8367
Removing intermediate container 97831e4293c7
Step 4 : RUN rpmdev-setuptree
 ---> Running in 4a9a380e48c7
 ---> 261eefb1b9c0
Removing intermediate container 4a9a380e48c7
Step 5 : USER root
 ---> Running in e671ee6b3a84
 ---> 5aa1d4864819
Removing intermediate container e671ee6b3a84
Step 6 : ADD entry.sh /root/
 ---> dff4df870ec8
Removing intermediate container 6775d044a802
Step 7 : CMD /root/entry.sh
 ---> Running in 25a2ca321e13
 ---> fed143cf78e3
Removing intermediate container 25a2ca321e13
Successfully built fed143cf78e3
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.i7vBmM
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cp -p /root/rpmbuild/SPECS//kubelet.service /root/rpmbuild/BUILD/
+ cp -p /root/rpmbuild/SPECS//kubelet-wrapper /root/rpmbuild/BUILD/
+ cp -p /root/rpmbuild/SPECS//99_bridge.conf /root/rpmbuild/BUILD/
+ cp -p /root/rpmbuild/SPECS//kubelet /root/rpmbuild/BUILD/
cp: cannot stat '/root/rpmbuild/SPECS//kubelet': No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.i7vBmM (%prep)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.i7vBmM (%prep) 

I'm running Arch Linux with Docker 1.11.2 and devicemapper in loopback

@mindfulmonk
Copy link

mindfulmonk commented Aug 9, 2016

To fix the above remove this line from kubernetes.spec

cp -p %{_sourcedir}/kubelet %{_builddir}/

and uncomment

curl -L --fail "https://storage.googleapis.com/kubernetes-release/release/v%{KUBE_VERSION}/bin/linux/amd64/kubelet" -o kubelet

You might also want to change kubernetes version to latest

%global KUBE_VERSION 1.3.4

and relax the docker version requirement

Requires: docker-engine >= 1.10

I think when you were building this initially you wanted to avoid constantly doing a curl so you put the binary on your machine instead.

@dgoodwin dgoodwin force-pushed the rpms branch 2 times, most recently from b83bcc6 to 50627df Compare August 9, 2016 11:17
@dgoodwin
Copy link
Contributor Author

dgoodwin commented Aug 9, 2016

Apoligies @timstclair you are correct. I'm guessing that it not the first time that has happened. :(

@mindfulmonk thanks you are right, the download was very slow and I failed to revert, updated with all your suggestions.

@dgoodwin
Copy link
Contributor Author

dgoodwin commented Aug 9, 2016

I'm not 100% sure the packages are fully functional as I'm not super experienced with actually using k8s, still working on testing something real but starting the binary looks promising. Here are the package contents:

[root@centos1 ~]# rpm -ql kubernetes
/etc/systemd/system/kubelet.service
/usr/bin/kubelet
/var/lib/kubelet/kubelet-wrapper
[root@centos1 ~]# rpm -ql kubernetes-plugin-cni
/etc/cni/net.d/99_bridge.conf
/opt/cni
/opt/cni/bin
/opt/cni/bin/bridge
/opt/cni/bin/cnitool
/opt/cni/bin/dhcp
/opt/cni/bin/flannel
/opt/cni/bin/host-local
/opt/cni/bin/ipvlan
/opt/cni/bin/loopback
/opt/cni/bin/macvlan
/opt/cni/bin/ptp
/opt/cni/bin/tuning

This is intended to be relatively self contained, just drop into the
directory and run the build-docker.sh script to launch a Docker
container with appropriate rpm/yum tooling.

Resulting rpms and yum repository metadata will appear in output/
sub-directory.
@dgoodwin
Copy link
Contributor Author

dgoodwin commented Aug 9, 2016

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@googlebot googlebot added cla: yes and removed cla: no labels Aug 9, 2016
@luxas
Copy link
Member

luxas commented Aug 9, 2016

Hmm, shouldn't we call this kubelet, not kubernetes
At least I would be surprised as an user to download kubernetes and don't even get kubectl!?
If we go for package managers, we should
a) make kubectl a self-contained package
b) option a + make the kubelet package dependent on kubectl (easiest and probably the best solution)
c) make a kubernetes package which includes everything (more complex)

Also, this should be for more arches, but I'm fine with the initial implementation as-is

@dgoodwin
Copy link
Contributor Author

@luxas hmm yeah I had it originally as kubelet and started drifting more towards the larger scale kubernetes naming as I wasn't sure how long "kubelet" was going to be a thing you would look to install, given all the proposed renaming out there right now.

However you are right, 'kubernetes' would imply a lot more and we probably don't really want to get into that work, and it's already done in Fedora / CentOS / RHEL anyhow. For reference Fedora ships subpackages kubernetes-node, kubernetes-master, and kubernetes-client.

I will revert to just calling this kubelet and limit it's scope.

@dgoodwin dgoodwin changed the title WIP: Add RPM package builds. WIP: Add kubelet RPM package builds. Aug 10, 2016
@@ -0,0 +1,87 @@
%global KUBE_VERSION 1.3.4
Copy link
Member

Choose a reason for hiding this comment

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

Is there a good way to parametrize this eventually?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the context of a very defined build script yeah quite likely, I think you can do rpmbuild --define 'KUBE_VERSION 1.3.4' and remove the %global here.

@mikedanese
Copy link
Member

Let's extend and address comments in a follow up. I'm currently working on infrastructure to get these hosted on GCS and it will help to have this merged.

@mikedanese mikedanese merged commit 934ec2c into kubernetes:master Aug 16, 2016
@dgoodwin dgoodwin deleted the rpms branch August 16, 2016 18:04
marpaia pushed a commit to marpaia/release that referenced this pull request Feb 21, 2019
Update company affiliation of Caleb Miles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants