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

Force create cni folders when starting Windows containerd agent #4685

Merged
merged 1 commit into from
Mar 10, 2023

Conversation

XinShuYang
Copy link
Contributor

Create /opt/cni/bin/ and /etc/cni/net.d/ folders to avoid errors caused by non-existent paths.

Fixes #4680

Create /opt/cni/bin/ and /etc/cni/net.d/ folders to avoid errors caused by non-existent paths.

Fixes antrea-io#4680

Signed-off-by: Shuyang Xin <gavinx@vmware.com>
@XinShuYang
Copy link
Contributor Author

/test-windows-all

Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

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

LGTM

@tnqn tnqn added the action/release-note Indicates a PR that should be included in release notes. label Mar 8, 2023
@tnqn tnqn added this to the Antrea v1.11 release milestone Mar 8, 2023
@@ -9,6 +9,8 @@ data:
mkdir -force C:/var/run/secrets/kubernetes.io/serviceaccount
cp $mountPath/var/run/secrets/kubernetes.io/serviceaccount/ca.crt C:/var/run/secrets/kubernetes.io/serviceaccount
cp $mountPath/var/run/secrets/kubernetes.io/serviceaccount/token C:/var/run/secrets/kubernetes.io/serviceaccount
mkdir -force c:/opt/cni/bin/
Copy link
Contributor

Choose a reason for hiding this comment

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

As the directory is created in the initContainers, the path may be deleted when Pod is deleted. Is it as expected?

Copy link
Member

Choose a reason for hiding this comment

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

really? then how could cp $mountPath/k/antrea/cni/* c:/opt/cni/bin/ below take effect if c:/opt/cni/bin/ is not in host filesystem?

Copy link
Contributor Author

@XinShuYang XinShuYang Mar 8, 2023

Choose a reason for hiding this comment

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

Yes they are created in host filesystem and deleting pod won't delete these directories.

Copy link
Contributor

Choose a reason for hiding this comment

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

It should by my fault. Before it can be merged, I also want to know the difference between this solution and the one that uses hostPath in container volumes?

Copy link
Member

Choose a reason for hiding this comment

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

I don't know how this actually works because there is no configuration saying c:/ is a host volume, I guess Windows hostProcess Pod is different from Linux Pod and it has direct access to host filesystem. Then perhaps there is no point to leverage hostPath to achieve it just for these two directories given the script already creates other directories in host filesystem.

@XinShuYang
Copy link
Contributor Author

/test-windows-all

Copy link
Contributor

@wenyingd wenyingd left a comment

Choose a reason for hiding this comment

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

LGTM

@tnqn
Copy link
Member

tnqn commented Mar 10, 2023

/skip-all

@tnqn tnqn merged commit 35ddd50 into antrea-io:main Mar 10, 2023
jainpulkit22 pushed a commit to urharshitha/antrea that referenced this pull request Apr 28, 2023
…ea-io#4685)

Create /opt/cni/bin/ and /etc/cni/net.d/ folders to avoid errors caused by non-existent paths.

Fixes antrea-io#4680

Signed-off-by: Shuyang Xin <gavinx@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/release-note Indicates a PR that should be included in release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

C:\opt\cni\opt folder is not created by antrea-windows-containerd causing failure for antrea-agent install
3 participants