Bug 1883232 - Webscale: kubevirt/CNV datavolume importer pod inability to disable sidecar injection if namespace has sidecar injection enabled but VM Template does NOT
Summary: Webscale: kubevirt/CNV datavolume importer pod inability to disable sidecar i...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Storage
Version: 2.4.0
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ---
: 2.6.0
Assignee: Arnon Gilboa
QA Contact: Yan Du
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-28 14:31 UTC by Nabeel Cocker
Modified: 2024-06-13 23:11 UTC (History)
18 users (show)

Fixed In Version: virt-cdi-importer 2.6.0-15
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-03-10 11:18:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt containerized-data-importer pull 1480 0 None closed Pass specific PVC annotations to the transfer pods 2021-02-17 16:04:36 UTC
Red Hat Issue Tracker CNV-8696 0 None None None 2024-06-13 23:11:03 UTC
Red Hat Product Errata RHSA-2021:0799 0 None None None 2021-03-10 11:19:54 UTC

Description Nabeel Cocker 2020-09-28 14:31:28 UTC
Description of problem:
kubevirt/CNV datavolume importer pod inability to disable sidecar injection if namespace has sidecar injection enabled but VM Template does NOT





Version-Release number of selected component (if applicable):
OCP 4.4
CN 2.3.0

How reproducible:
always

Steps to Reproduce:
1. Annotate namespace for sidecar injection
2. create VM template utilizing a datavolume and disable sidecar injection.  
3.Apply the template.
4. the Import pod comes up and has the sidecar injected.

Actual results:


Expected results:

The expected result is NOT to have the sidecar injected into the importer pod


Additional info:

Comment 3 Adam Litke 2020-10-08 20:14:34 UTC
(In reply to Nabeel Cocker from comment #0)
> Description of problem:
> kubevirt/CNV datavolume importer pod inability to disable sidecar injection
> if namespace has sidecar injection enabled but VM Template does NOT
> 
> 
> 
> 
> 
> Version-Release number of selected component (if applicable):
> OCP 4.4
> CN 2.3.0
> 
> How reproducible:
> always
> 
> Steps to Reproduce:
> 1. Annotate namespace for sidecar injection
> 2. create VM template utilizing a datavolume and disable sidecar injection.

Can you explain how sidecar injection is disabled in the VM by providing an example VM.yaml file with the needed elements to do this?

Comment 4 Anil Dhingra 2020-10-20 04:20:51 UTC
issue is if namespace has SM enabled it will default inject sidecar with all pods , if cu has a requirement to run Container & CVN VM under one project with namespace has Service Mesh enabled , datavolume importer-pod should have it disabled or some logic to check that its an importer pod & will be Terminated once import is complete & no need to inject sidecar , due to sidecar injection it's never deleted post import & stays there

we may have scenario where need to run container & cnv in same namespace

tested in lab Env & with SM enabled in namespace,  CNV (cdi) importer pod has envoy proxy sidecar injected & pod never terminate post import

filed upstream bug

https://github.com/kubevirt/containerized-data-importer/issues/1449

Comment 10 Arnon Gilboa 2020-12-15 16:51:30 UTC
CNV-6812 PR (https://github.com/kubevirt/containerized-data-importer/pull/1480) adds the ability to pass specific annotations (defined in the DV or PVC) to the transfer Pods.
The one relevant annotation here is: sidecar.istio.io/inject: "false"
The fix was manually tested and documented in CNV-8332, on upstream CDI v1.27.0.

Comment 12 Yan Du 2020-12-21 11:17:50 UTC
Test on the AspenMesh cluster with latest cdi, annotation for sidecar works well.

Steps for verifying the bz:
$ oc label namespace default istio-injection=enabled
$ oc get namespace default -L istio-injection
NAME      STATUS   AGE    ISTIO-INJECTION
default   Active   6d8h   enabled

$ cat << EOF | oc create -f -
apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
  name: test-dv2
  annotations:
      sidecar.istio.io/inject: "false"
spec:
  source:
      http:
         url: "http://$url/Fedora-Cloud-Base-33-1.2.x86_64.qcow2"
  pvc:
    accessModes:
      - ReadWriteOnce
    resources:
      requests:
        storage: 10Gi
EOF

$ oc get dv
NAME          PHASE              PROGRESS   RESTARTS   AGE
test-dv2      Succeeded          100.0%                20m


If create the dv without the annotation(sidecar.istio.io/inject: "false"), got crashed for the importer pod
$ oc get pod
NAME                READY   STATUS             RESTARTS   AGE
importer-test-dv1   1/2     CrashLoopBackOff   25         105m
$ oc get dv
NAME       PHASE              PROGRESS   RESTARTS   AGE
test-dv1   ImportInProgress   N/A                   111m

seems it's better to report a new bug for the pod crash without annotation

Comment 13 Adam Litke 2021-01-04 19:07:57 UTC
Clearing an old needinfo.  The priority was indeed raised as requested.

Comment 15 Yan Du 2021-01-11 10:10:23 UTC
@Anil, here is the bug https://bugzilla.redhat.com/show_bug.cgi?id=1914833

Comment 17 Pan Ousley 2021-02-12 16:40:29 UTC
@Adam, does this need to be documented in the 2.6 release notes? It came up in my search because of the requires_doc_text? flag. Thanks!

Comment 18 Adam Litke 2021-02-16 18:18:55 UTC
Pan, it seems we should have documented the annotation in the product docs but it was missed.  I've added a Jira issue for 4.8 to address this.  In the meantime we should probably add a release note based on the information here: https://github.com/kubevirt/containerized-data-importer/pull/1582/files#diff-23cd4e72d9bb3385a6eac8d37b4b09fde064018ba2ae1f329f7064cb80d28a6cR35

Comment 19 Pan Ousley 2021-02-17 16:04:29 UTC
@alitke Thanks for the info! Can you clarify what we should document specifically? Would it be a new/changed feature (for storage) that the "sidecar.istio.io/inject: "false" annotation disables sidecar injection to the pod"?

Comment 20 Adam Litke 2021-02-17 17:57:28 UTC
Pan, we are waiting on a decision whether to annotate this by default.  If we do it by default then I suppose no documentation is needed at this time (in 4.8 we would then want to document the option for users who may need to override the default).  If the default is not altered then perhaps a release note NEW would be in order to explain how this annotation can be used to disable the injection.

Arnon, please advise once we have a decision re: the default behavior so Pan knows how to proceed with documentation.  We will also need to know when it is planned to be delivered.

Comment 21 Arnon Gilboa 2021-02-17 19:54:57 UTC
Pan, Adam, I will sure update once we approve and target the PR with default sidecar.istio.io/inject: "false" annotation for CDI transfer pods.

Comment 22 Arnon Gilboa 2021-02-17 19:56:32 UTC
keeping the needinfo for the pending update.

Comment 24 Arnon Gilboa 2021-02-22 16:09:29 UTC
PR added for Bug 1914833 to set default sidecar.istio.io/inject: "false" annotation for CDI transfer pods.

Comment 25 Pan Ousley 2021-02-22 18:47:09 UTC
I added a release note (in the technical changes section) to reflect the new default. PR: https://github.com/openshift/openshift-docs/pull/29654
I am waiting for Arnon to approve it.

In the meantime, @Yan, can you please also review this release note PR from a QE perspective? (This PR also covers CNV-9456, where I have also requested your review.) Thanks!

Comment 26 Yan Du 2021-02-23 03:23:22 UTC
Added comments in the PR. thanks

Comment 28 errata-xmlrpc 2021-03-10 11:18:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Virtualization 2.6.0 security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:0799


Note You need to log in before you can comment on or make changes to this bug.