generate_k8s_resource_definitions generates incorrect cni_ds.yaml

Bug #1791266 reported by Alexey Perevalov on 2018-09-07
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kuryr-kubernetes
Medium
Alexey Perevalov

Bug Description

Commit 8f2729cedd1845f65bd138c79ee029bffc400edc
replaced hard coded path
- path: /var/run/openvswitch
+ path: ${OVS_HOST_PATH}

by OVS_HOST_PATH. Now when OVS_HOST_PATH is empty path: field will be empty in generated cni_ds.yaml too.

It lead to the following error when we try to apply this cni_ds.yaml.

error: error validating "/tmp/resource_no_fixed/cni_ds.yml": error validating data: ValidationError(DaemonSet.spec.template.spec.volumes[4].hostPath): missing required field "path" in io.k8s.api.core.v1.HostPathVolumeSource; if you choose to ignore these errors, turn validation off with --validate=false

The steps for making kuryr-kubernetes as kubernetes addon are described here
https://docs.openstack.org/kuryr-kubernetes/latest/installation/containerized.html
as a workaround OVS_HOST_PATH could be defined as environment variable, but in some use cases it's better to omit openvswitch mount volume.

Changed in kuryr-kubernetes:
assignee: nobody → Alexey Perevalov (alexeyperevalov)
description: updated

Fix proposed to branch: master
Review: https://review.openstack.org/600693

Changed in kuryr-kubernetes:
status: New → In Progress
Changed in kuryr-kubernetes:
importance: Undecided → Medium

Reviewed: https://review.openstack.org/600693
Committed: https://git.openstack.org/cgit/openstack/kuryr-kubernetes/commit/?id=027a17f1ede835d37612833206db12f814d0f1a4
Submitter: Zuul
Branch: master

commit 027a17f1ede835d37612833206db12f814d0f1a4
Author: Alexey Perevalov <email address hidden>
Date: Fri Sep 7 05:29:49 2018 -0400

    Produce mount volume only if OVS_HOST_PATH is defined

    In case of empty $OVS_HOST_PATH
    tools/generate_k8s_resource_definitions generates incorrect
    cni_ds.yaml.

    openvswitch mount volume is necessary for ovn use case
    and maybe for vhostuser use case.

    So it's better to omit it when $OVS_HOST_PATH is empty.

    Closes-Bug: #1791266
    Change-Id: Ieed08a998f1b7e348428ab16e53d9072ca7b9e73
    Signed-off-by: Alexey Perevalov <email address hidden>

Changed in kuryr-kubernetes:
status: In Progress → Fix Released

Reviewed: https://review.openstack.org/601927
Committed: https://git.openstack.org/cgit/openstack/kuryr-kubernetes/commit/?id=254aa3440d3d3e04454ff401fd3bd263fb997786
Submitter: Zuul
Branch: stable/rocky

commit 254aa3440d3d3e04454ff401fd3bd263fb997786
Author: Alexey Perevalov <email address hidden>
Date: Fri Sep 7 05:29:49 2018 -0400

    Produce mount volume only if OVS_HOST_PATH is defined

    In case of empty $OVS_HOST_PATH
    tools/generate_k8s_resource_definitions generates incorrect
    cni_ds.yaml.

    openvswitch mount volume is necessary for ovn use case
    and maybe for vhostuser use case.

    So it's better to omit it when $OVS_HOST_PATH is empty.

    Closes-Bug: #1791266
    Change-Id: Ieed08a998f1b7e348428ab16e53d9072ca7b9e73
    Signed-off-by: Alexey Perevalov <email address hidden>
    (cherry picked from commit 027a17f1ede835d37612833206db12f814d0f1a4)

tags: added: in-stable-rocky

This issue was fixed in the openstack/kuryr-kubernetes 0.5.1 release.

This issue was fixed in the openstack/kuryr-kubernetes 0.6.0 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers