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

k8s, cluster-up: Copy istio CNI net conf to where Multus expects #932

Merged
merged 1 commit into from
Dec 14, 2022

Conversation

ormergi
Copy link
Contributor

@ormergi ormergi commented Dec 13, 2022

Since Multus v4 it expects CNI net conf file to exist at /etc/cni/net.d but Isitio generates its net conf file at /etc/cni/multus/net.d.

Copy istio CNI net conf to where multus expects on cluster-up in order to enable deploying both Isitio and Multus until proper solution is available, tracking issue [1] [2].

[1] #906 [2] k8snetworkplumbingwg/multus-cni#982

Signed-off-by: Or Mergi [email protected]

@kubevirt-bot kubevirt-bot added the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label Dec 13, 2022
@ormergi
Copy link
Contributor Author

ormergi commented Dec 13, 2022

/cc @maiqueb @brianmcarey @dhiller

ormergi added a commit to ormergi/kubevirt that referenced this pull request Dec 13, 2022
@@ -155,4 +163,5 @@ function up() {
sleep 5
done

copy_istio_cni_conf_files
Copy link
Member

Choose a reason for hiding this comment

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

Please add a FIXME comment linking to a tracker on Multus and also open an Issue under this repository, so we don't forget to clean up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

function copy_istio_cni_conf_files() {
if [ "$KUBEVIRT_DEPLOY_ISTIO" == "true" ] && [ "$KUBEVIRT_WITH_CNAO" == "true" ]; then
for nodeNum in $(seq -f "%02g" 1 $KUBEVIRT_NUM_NODES); do
$ssh node${nodeNum} -- sudo cp -uv /etc/cni/multus/net.d/*istio*.conf /etc/cni/net.d/
Copy link
Member

Choose a reason for hiding this comment

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

Would creating a symlink be an option too? It would allow us to keep it generic and we would not need to wait for Istio to finish deployment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@phoracek it requires knowing the name of isito conf file that will be generated in order to create the link (though it won't likely to change), then it would be possible to create the link as part of deploy_istio() (before Isitio deployment ready), for example:

ISTIO_CONF_FILE_NAME="YYY-istio-cni.conf"
...
function deploy_istio() {
    if [ "$KUBEVIRT_DEPLOY_ISTIO" == "true" ]; then
        if [ "$KUBEVIRT_WITH_CNAO" == "true" ]; then
        ...
        $ssh node${nodeNum} -- sudo ln -sr /etc/cni/multus/net.d/${ISTIO_CONF_FILE_NAME} /etc/cni/net.d/
...

WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

What I meant is linking the whole directory. So no matter from which one you read/write-to, we will always have the same set of configs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It wont work because Multus dosent look for net conf files recursively nor look into links, the conf file must be copied.

Copy link
Member

Choose a reason for hiding this comment

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

i see, interesting, thanks for checking that

@@ -88,6 +88,14 @@ function wait_for_istio_ready() {
fi
}

function copy_istio_cni_conf_files() {
if [ "$KUBEVIRT_DEPLOY_ISTIO" == "true" ] && [ "$KUBEVIRT_WITH_CNAO" == "true" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: please adjust indentation to the remainder of the script

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the heads up, done

@ormergi ormergi force-pushed the multus-istio-intergation branch from 317ffef to ee2e69f Compare December 13, 2022 14:45
@ormergi
Copy link
Contributor Author

ormergi commented Dec 13, 2022

@phoracek @dhiller I have resolved your review comments please take another look 🙂

Copy link
Member

@phoracek phoracek left a comment

Choose a reason for hiding this comment

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

Thanks

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 13, 2022
Since Multus v4 it expects CNI net conf file to exist at '/etc/cni/net.d'
but isitio generates then at '/etc/cni/multus/net.d'.

Copy istio CNI net conf to where multus expects on cluster-up in order
to enable deploying both Isitio and Multus v4 until proper solution is
available, tracking issue [1] [2].

[1] kubevirt#906
[2] k8snetworkplumbingwg/multus-cni#982

Signed-off-by: Or Mergi <[email protected]>
@ormergi ormergi force-pushed the multus-istio-intergation branch from ee2e69f to af74d52 Compare December 13, 2022 14:54
@kubevirt-bot kubevirt-bot removed the lgtm Indicates that a PR is ready to be merged. label Dec 13, 2022
@ormergi
Copy link
Contributor Author

ormergi commented Dec 13, 2022

Changes: fixed missing if closure closing, missing indentation and removed the fixme comment leftover.

Copy link
Contributor

@maiqueb maiqueb left a comment

Choose a reason for hiding this comment

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

Thanks.

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 13, 2022
@maiqueb
Copy link
Contributor

maiqueb commented Dec 13, 2022

Weird, the 1.26 provisioning lane is failing w/

+ dnf install -y kernel-modules-5.14.0-210.el9.x86_64
CentOS Stream 9 - BaseOS                        8.8 MB/s | 6.0 MB     00:00    
CentOS Stream 9 - AppStream                      10 MB/s |  16 MB     00:01    
CentOS Stream 9 - Extras packages                11 kB/s | 9.2 kB     00:00    
No match for argument: kernel-modules-5.14.0-210.el9.x86_64
Error: Unable to find a match: kernel-modules-5.14.0-210.el9.x86_64

But I see the pkg available online:
http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/Packages/kernel-modules-5.14.0-210.el9.x86_64.rpm

... let's blindly retest once.
/test check-provision-k8s-1.26

@maiqueb
Copy link
Contributor

maiqueb commented Dec 13, 2022

Can we be missing some packages on the 1.26 lanes ?
@dhiller / @brianmcarey

podman run --rm --entrypoint bash -it centos:stream9 
Resolved "centos" as an alias (/etc/containers/registries.conf.d/000-shortnames.conf)
Trying to pull quay.io/centos/centos:stream9...
Getting image source signatures
Copying blob 5af5d4bc82b8 done  
Copying config bc5c131925 done  
Writing manifest to image destination
Storing signatures
[root@95b437f4fede /]# dnf info --showduplicates kernel-modules | grep Version -A1
Version      : 5.14.0
Release      : 196.el9
--
Version      : 5.14.0
Release      : 197.el9
--
Version      : 5.14.0
Release      : 200.el9
--
Version      : 5.14.0
Release      : 202.el9
--
Version      : 5.14.0
Release      : 205.el9

@dhiller
Copy link
Contributor

dhiller commented Dec 13, 2022

@ormergi
Copy link
Contributor Author

ormergi commented Dec 13, 2022

Please note that this PR change has nothing to do with check-provision-k8s-1.26 and check-up-kind-1.23-vgpu lane failures 🙂

@dhiller
Copy link
Contributor

dhiller commented Dec 13, 2022

Please note that this PR change has nothing to do with check-provision-k8s-1.26 and check-up-kind-1.23-vgpu lane failures slightly_smiling_face

Yes but it will break the publishing, since the 1.26 will fail to build

ormergi added a commit to ormergi/kubevirt that referenced this pull request Dec 13, 2022
@ormergi
Copy link
Contributor Author

ormergi commented Dec 13, 2022

Yes but it will break the publishing, since the 1.26 will fail to build

Oh, I didn't realize that, I though that it wont be included in the publish process since the lane is not mandatory :/

@Barakmor1
Copy link
Member

Barakmor1 commented Dec 14, 2022

During provisioning the provision.sh is being run inside the Centos Stream 9 box, which is a vm that is started inside a container image. This image should have the same kernel version for every run, but seemingly it changed. Asking @Barakmor1 to keep me honest here.

Yes that is how it should:
https://github.com/kubevirt/kubevirtci/blob/main/cluster-up/cluster/K8S_DEV_GUIDE.md
We changed the Centos Stream 9 version is because the lane started failing few days ago:
#924

ormergi added a commit to ormergi/kubevirt that referenced this pull request Dec 14, 2022
@brianmcarey
Copy link
Member

/test check-provision-k8s-1.26

@dhiller
Copy link
Contributor

dhiller commented Dec 14, 2022

I am suspecting that the change originates from a change in vmlinuz and/or initrd.img which are both pulled during image creation.

I am seeing a change on the initrd.img from the 12th of Dec and for vmlinuz on the 9th of Dec here: http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/images/pxeboot/

@ormergi
Copy link
Contributor Author

ormergi commented Dec 14, 2022

I am suspecting that the change originates from a change in vmlinuz and/or initrd.img which are both pulled during image creation.

I am seeing a change on the initrd.img from the 12th of Dec and for vmlinuz on the 9th of Dec here: http://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/images/pxeboot/

Note that it is the same for centos8, initd.img and vmlinuz have different release dates
http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/images/pxeboot/

@brianmcarey
Copy link
Member

/test check-provision-k8s-1.26

@dhiller
Copy link
Contributor

dhiller commented Dec 14, 2022

/test check-provision-k8s-1.26
/override check-up-kind-1.23-vgpu

Copy link
Contributor

@dhiller dhiller left a comment

Choose a reason for hiding this comment

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

/approv

@dhiller
Copy link
Contributor

dhiller commented Dec 14, 2022

/approve

@kubevirt-bot
Copy link
Contributor

@dhiller: Overrode contexts on behalf of dhiller: check-up-kind-1.23-vgpu

In response to this:

/test check-provision-k8s-1.26
/override check-up-kind-1.23-vgpu

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@brianmcarey
Copy link
Member

/test check-provision-k8s-1.26

# copy_istio_cni_conf_files copy the generated Istio CNI net conf file
# (at '/etc/cni/multus/net.d/') to where Multus expect CNI net conf files ('/etc/cni/net.d/')
function copy_istio_cni_conf_files() {
if [ "$KUBEVIRT_DEPLOY_ISTIO" == "true" ] && [ "$KUBEVIRT_WITH_CNAO" == "true" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

what about KUBVIRT_WITH_CNAO_SKIP_CONFIG ?
The CR might be installed bit later and include the multus (but not sure if those folders do exists in this case at this stage ?)

can be ignored, if there is code that returns error upon this configuration

Copy link
Contributor Author

@ormergi ormergi Dec 14, 2022

Choose a reason for hiding this comment

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

what about KUBVIRT_WITH_CNAO_SKIP_CONFIG ?
The CR might be installed bit later and include the multus (but not sure if those folders do exists in this case at this stage ?)

If by CR you mean CNAO CR, in the scenrtio where Multus deployment hangs no harm will do to the cluster if Istio confs will be copied to /etc/cni/net.d(it is already created by kubeadm IIRC)

Note that copy_istio_cni_conf_files is called only after both CNAO and Istio deployments are ready, so it is not likely to happen.

This function is called only after both CNAO and Istio deployments are ready, so it is not likely to happen.

I am not sure what you mean, the error flag is set for script.

Copy link
Contributor

@oshoval oshoval Dec 14, 2022

Choose a reason for hiding this comment

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

I mean that the condition checks KUBEVIRT_WITH_CNAO but doesnt check the possible
KUBVIRT_WITH_CNAO_SKIP_CONFIG
That allows you to install CNAO but wihtout the CNAO CR (where you say which components to install)

So if CNAO will be installed without CR (i.e using KUBVIRT_WITH_CNAO_SKIP_CONFIG)
and Istio will be installed
and later the CNAO CR will install multus, this WA code wont run and we will have the bug

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for explaining.
I think it's better to have it the way it is (w/o handling KUBVIRT_WITH_CNAO_SKIP_CONFIG) because it's we want it run when both Istio and Multus (through CNAO) are deployed.

BTW, I couldn't find usage of KUBVIRT_WITH_CNAO_SKIP_CONFIG on kubevirt CI jobs, perhaps it should be removed.

Copy link
Contributor

@oshoval oshoval Dec 14, 2022

Choose a reason for hiding this comment

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

I am fine to not handle it (we just need to know we don't support this config)
but please don't remove it .
We are using KUBVIRT_WITH_CNAO_SKIP_CONFIG on KubeSecondaryDNS.
It is helpful once you want to deploy the cached CNAO, but with your CR.
This way you don't need to care about CNAO bumps, as it is part of the kubevirtci TAG that you need to bump anyhow

@maiqueb
Copy link
Contributor

maiqueb commented Dec 14, 2022

OK seems it managed to install the kernel modules.

@dhiller your /approve was not handled by the bot. Is something wrong with it ?

Copy link
Member

@brianmcarey brianmcarey left a comment

Choose a reason for hiding this comment

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

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brianmcarey, dhiller

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [brianmcarey,dhiller]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 14, 2022
@ormergi
Copy link
Contributor Author

ormergi commented Dec 14, 2022

/test check-provision-k8s-1.25

@kubevirt-commenter-bot
Copy link

/retest-required
This bot automatically retries required jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@kubevirt-bot kubevirt-bot merged commit 6b053d7 into kubevirt:main Dec 14, 2022
kubevirt-bot added a commit to kubevirt-bot/kubevirt that referenced this pull request Dec 15, 2022
[6b053d7 k8s, cluster-up: Copy istio CNI net conf to where Multus expects](kubevirt/kubevirtci#932)
[f930087 cluster-up: add environment variable to enable FIPS](kubevirt/kubevirtci#931)
[c1a7fde Upgrade cri-o to version 1.25 for 1.25/6 providers](kubevirt/kubevirtci#930)
[16f44a7 Delete k8s-1.24-ipv6](kubevirt/kubevirtci#929)

```release-note
NONE
```

Signed-off-by: kubevirt-bot <[email protected]>
kubevirt-bot added a commit to kubevirt-bot/kubevirt that referenced this pull request Dec 16, 2022
[5660e89 Enable PSA on any provider](kubevirt/kubevirtci#915)
[6304ac8 bump, cnao: k8s-1.2[4,5] to cnao v0.82.0](https://github.com/kubevirt/kubevirtci/pull/910)](https://github.com/kubevirt/kubevirtci/pull/933)
[6b053d7 k8s, cluster-up: Copy istio CNI net conf to where Multus expects](kubevirt/kubevirtci#932)
[f930087 cluster-up: add environment variable to enable FIPS](kubevirt/kubevirtci#931)
[c1a7fde Upgrade cri-o to version 1.25 for 1.25/6 providers](kubevirt/kubevirtci#930)
[16f44a7 Delete k8s-1.24-ipv6](kubevirt/kubevirtci#929)

```release-note
NONE
```

Signed-off-by: kubevirt-bot <[email protected]>
ormergi added a commit to ormergi/kubevirt that referenced this pull request Jan 6, 2023
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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants