Bug 1662751

Summary: [RFE] Add "virtctl delete" command to remove services exposed via "virtctl expose"
Product: Container Native Virtualization (CNV) Reporter: Yossi Segev <ysegev>
Component: RFEAssignee: Sebastian Scheinkman <sscheink>
Status: CLOSED DEFERRED QA Contact: Stephen Gordon <sgordon>
Severity: medium Docs Contact:
Priority: low    
Version: 1.4CC: cnv-qe-bugs, danken, fdeutsch, fsimonce, ncredi, sardella, ycui
Target Milestone: ---Keywords: FutureFeature
Target Release: future   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-26 01:38:09 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:

Description Yossi Segev 2019-01-01 15:15:11 UTC
Description of problem:
These no command to delete an exposed service, even if this service was exposed using "virtctl expose".
virtcrl should have a delete command, just like there's "oc expose" and "oc delete svc".


Version-Release number of selected component (if applicable):
Server/client: v0.12.0-alpha.2


How reproducible:
Always.


Steps to Reproduce:
1. Create a cirros VM.
 # oc create -f cluster/example/vm-cirros.yaml
2. Start the VM:
 # virtctl start vm-cirros
3. Verify VMI is running.
 # oc get VMI
NAME            AGE       PHASE     IP            NODENAME
vm-cirros       10m       Running   10.130.0.46   cnv-executor-ysegev-node1.example.com
4. Expose a service using "virtctl expose", e.g. a service of type NodePort:
 # virtctl expose vmi vm-cirros --name=testnp --port=27017 --target-port=22 --type=NodePort


Actual results:
In order to delete the exposed service, you have to run "oc delete svc".


Expected results:
It makes sense, that just like "oc expose" has a complementary "oc delete svc", there should also be a complementary "virtctl delete svc".

Additional info:

Comment 1 Fabian Deutsch 2019-01-02 13:49:16 UTC
IMO we should drop "virtctl expose" and make it easier to use virtual machines with "kubectl expose"

An upstream patch would be necessary to allow "kubectl expose -l domain=mydom".

Comment 3 Dan Kenigsberg 2019-01-15 13:05:00 UTC
Either way we expose (virtctl or kubecrl) we should have a reciprocal command to delete.

Comment 6 Dan Kenigsberg 2019-05-29 10:04:35 UTC
delegating Jira request to Yossi.

Comment 7 Yossi Segev 2019-05-29 10:28:08 UTC
https://jira.coreos.com/browse/CNV-1998

Comment 8 Ying Cui 2021-05-26 01:38:09 UTC
Close this RFE bug, we will follow the fix by jira in comment 7.