Bug 1241469

Summary: kubectl should be in its own subpackage
Product: [Fedora] Fedora Reporter: Stef Walter <stefw>
Component: kubernetesAssignee: Jan Chaloupka <jchaloup>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: avagarwa, eparis, golang-updates, jchaloup, lsm5, nhorman, stefw, vbatts
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: kubernetes-1.0.0-0.9.git2d88675.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1253337 (view as bug list) Environment:
Last Closed: 2015-07-31 07:53:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1253337    
Attachments:
Description Flags
Break out kubectl into kubernetes-client sub-package none

Description Stef Walter 2015-07-09 09:52:05 UTC
The kubectl command should be in its own subpackage. kubectl can be used on systems where neither a kubernetes-master or kubernetes-node should be installed. In addition it can be used against openshift/origin/atomic

Cockpit would like to depend on kubectl

Comment 1 Stef Walter 2015-07-09 09:56:16 UTC
Created attachment 1050206 [details]
Break out kubectl into kubernetes-client sub-package

Comment 2 Jan Chaloupka 2015-07-09 10:21:30 UTC
Hi Stef,

kubectl is used by both master and node subpackages. I will finish the decomposition. Thanks for the heads up and justification.

Regards
Jan

Comment 3 Jan Chaloupka 2015-07-09 14:50:38 UTC
Stef, Avesh,

can you test the scratch build [1]?. I don't see any problems in this case as kubectl has no config files not service files. Just kubernetes-master and kubernetes-nodes depends on kubernetes-client now. So it is more like to test if master and node subpackages are still working as expected.

[1] http://koji.fedoraproject.org/koji/taskinfo?taskID=10328080

Thanks
Jan

Comment 4 Avesh Agarwal 2015-07-10 15:34:33 UTC
Hi Jan,

what worked:
1. I upgraded from current kubernetes-master/node to kubernetes-master/node and kubernets-client and it worked fine.

2. I installed stand-alone kubectl-cleint on a system and it worked fine.

What did not seem to work:
Uninstalling kubernetes-client uninstalls kubernets-master/node too, which should not happen i think. I can reasonably think use cases where only master/node pieces are installed on a system and kubernetes-client on other system.  

Uninstalling stand-alone kubernets-client seemed to stuck for considerable time (for around more than 15/20 sec) as it seemed to find some dependencies (i think kubernetes-master/node).

Comment 5 Stef Walter 2015-07-10 15:35:55 UTC
(In reply to Avesh Agarwal from comment #4)
> Uninstalling kubernetes-client uninstalls kubernets-master/node too, which
> should not happen i think. I can reasonably think use cases where only
> master/node pieces are installed on a system and kubernetes-client on other
> system.  

It's very common for the server side of a package to require the client side be installed. It's been the case for the database servers (mysql, postgres) ... as well as things like openssh-server.

Comment 6 Avesh Agarwal 2015-07-10 15:38:17 UTC
(In reply to Stef Walter from comment #5)
> (In reply to Avesh Agarwal from comment #4)
> > Uninstalling kubernetes-client uninstalls kubernets-master/node too, which
> > should not happen i think. I can reasonably think use cases where only
> > master/node pieces are installed on a system and kubernetes-client on other
> > system.  
> 
> It's very common for the server side of a package to require the client side
> be installed. It's been the case for the database servers (mysql, postgres)
> ... as well as things like openssh-server.

Agree, but why uninstalling kubernetes-client should uninstall master?

Comment 7 Stef Walter 2015-07-10 15:39:11 UTC
(In reply to Avesh Agarwal from comment #6)
> (In reply to Stef Walter from comment #5)
> > (In reply to Avesh Agarwal from comment #4)
> > > Uninstalling kubernetes-client uninstalls kubernets-master/node too, which
> > > should not happen i think. I can reasonably think use cases where only
> > > master/node pieces are installed on a system and kubernetes-client on other
> > > system.  
> > 
> > It's very common for the server side of a package to require the client side
> > be installed. It's been the case for the database servers (mysql, postgres)
> > ... as well as things like openssh-server.
> 
> Agree, but why uninstalling kubernetes-client should uninstall master?

Because kubernetes-master requires kubernetes-client. 

For extra fun, try uninstalling python, or glibc :)

Comment 8 Jan Chaloupka 2015-07-10 15:41:02 UTC
> I can reasonably think use cases where only master/node pieces are
> installed on a system and kubernetes-client on other system. 

As both kubernetes-master and kubernetes-node both have kubectl command implicitely, it is correct behaviour to uninstall both kubernetes-master and kubernetes-node if kubernetes-client is.

If there is machine with kubernetes-master and kubernetes-client installed on it is the same case as to have kubernetes-master installed before this decomposition.

> Uninstalling stand-alone kubernets-client seemed to stuck for considerable
> time (for around more than 15/20 sec) as it seemed to find some
> dependencies (i think kubernetes-master/node).

Cost that have to paid I guess.

Comment 9 Avesh Agarwal 2015-07-10 15:44:52 UTC
(In reply to Stef Walter from comment #7)
> (In reply to Avesh Agarwal from comment #6)
> > (In reply to Stef Walter from comment #5)
> > > (In reply to Avesh Agarwal from comment #4)
> > > > Uninstalling kubernetes-client uninstalls kubernets-master/node too, which
> > > > should not happen i think. I can reasonably think use cases where only
> > > > master/node pieces are installed on a system and kubernetes-client on other
> > > > system.  
> > > 
> > > It's very common for the server side of a package to require the client side
> > > be installed. It's been the case for the database servers (mysql, postgres)
> > > ... as well as things like openssh-server.
> > 
> > Agree, but why uninstalling kubernetes-client should uninstall master?
> 
> Because kubernetes-master requires kubernetes-client. 
> 
> For extra fun, try uninstalling python, or glibc :)

But what about those use cases, where some admin only wants kubernetes-master on a system and does not want kubernetes-client on the same system for whatever reasons? One reason may be that an admin is running kubernetes-client on a remote system and does not want to increase the attack surface of the kubernets-master system by installing kubernetes-client?

Comment 10 Jan Chaloupka 2015-07-10 15:47:15 UTC
Every file kubernetes-client provides is at the moment included in files provided by kubernetes-master.

Of course it is possible to add kubernetes-client subpackage without removing kubectl from kubernetes-master/node. However, this will duplicate files.

Comment 11 Avesh Agarwal 2015-07-10 15:58:04 UTC
(In reply to Jan Chaloupka from comment #10)
> Every file kubernetes-client provides is at the moment included in files
> provided by kubernetes-master.
> 
> Of course it is possible to add kubernetes-client subpackage without
> removing kubectl from kubernetes-master/node. However, this will duplicate
> files.

How about this to avoid duplication: that master/node installs client, but uninstalling client does not remove master/client, if that makes sense.

Comment 12 Avesh Agarwal 2015-07-10 16:01:12 UTC
(In reply to Avesh Agarwal from comment #11)
> (In reply to Jan Chaloupka from comment #10)
> > Every file kubernetes-client provides is at the moment included in files
> > provided by kubernetes-master.
> > 
> > Of course it is possible to add kubernetes-client subpackage without
> > removing kubectl from kubernetes-master/node. However, this will duplicate
> > files.
> 
> How about this to avoid duplication: that master/node installs client, but
> uninstalling client does not remove master/client, if that makes sense. 

Nuke that, it might not be possible as dependencies wont work like that I think.

Comment 13 Jan Chaloupka 2015-07-10 16:21:11 UTC
>> How about this to avoid duplication: that master/node installs client, but
>> uninstalling client does not remove master/client, if that makes sense. 
>
> Nuke that, it might not be possible as dependencies wont work like that I think.

Yes. There are file duplications and then kubernetes-client is independent of kubernetes-master/node and visa verse. Or there are no duplications but master/nodes depends on client.

> One reason may be that an admin is running kubernetes-client on a remote system
> and does not want to increase the attack surface of the kubernetes-master system
> by installing kubernetes-client?

How could this be used? From my point of view installed files will be the same.

Comment 14 Eric Paris 2015-07-10 16:57:05 UTC
are we sure this is not dnf 'helpfully' uninstall all new leaves?  /me would need to find the dnf magic to make it not do that.  (I haven't actually looked at the provides/requires/stuff you added, just know dnf does that.)

Comment 15 Jan Chaloupka 2015-07-17 09:56:00 UTC
From packaging guidelines [1]:

"A Fedora package must not list a file more than once in the spec file's %files listings. If you think your package is a valid exception to this, please bring it to the attention of the Packaging Committee so they can improve on this Guideline."

So duplication is not implicitly allowed between two %files sections (if my understanding of it is correct). The only exception are license files.

Talking to Lubos Kardos (<lkardos>, rpm maintainer) the work-flow is like this:
1) rpm installs both k8s-master and k8s-client. /usr/bin/kubectl owned by old k8s-master is not deleted
2) both old k8s-master and new k8s-client own the binary
3) old k8s-master is removed and the binary is now owned only by k8s-client

If old and new /usr/bin/kubectl has different checksum, the old one is replaced by the new one.

Eric, does it cover your situation?

[1] https://fedoraproject.org/wiki/Packaging:Guidelines#Duplicate_Files

Comment 17 Fedora Update System 2015-07-20 20:44:49 UTC
kubernetes-1.0.0-0.9.git2d88675.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/kubernetes-1.0.0-0.9.git2d88675.fc22

Comment 18 Fedora Update System 2015-07-20 20:46:17 UTC
kubernetes-1.0.0-0.9.git2d88675.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/kubernetes-1.0.0-0.9.git2d88675.fc21

Comment 19 Fedora Update System 2015-07-23 08:54:19 UTC
Package kubernetes-1.0.0-0.9.git2d88675.fc22:
* should fix your issue,
* was pushed to the Fedora 22 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing kubernetes-1.0.0-0.9.git2d88675.fc22'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-11915/kubernetes-1.0.0-0.9.git2d88675.fc22
then log in and leave karma (feedback).

Comment 20 Fedora Update System 2015-07-31 07:53:57 UTC
kubernetes-1.0.0-0.9.git2d88675.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 21 Fedora Update System 2015-07-31 07:54:41 UTC
kubernetes-1.0.0-0.9.git2d88675.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.