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

Use helm to generate Antrea Windows manifests #6360

Merged
merged 7 commits into from
Jun 11, 2024

Conversation

shikharish
Copy link
Contributor

Fixes #5564

@shikharish
Copy link
Contributor Author

cc: @antoninbas @luolanzone

build/charts/antrea-windows/templates/agent.yaml Outdated Show resolved Hide resolved
build/charts/antrea-windows/templates/configmap.yaml Outdated Show resolved Hide resolved
build/charts/antrea-windows/templates/daemonset.yaml Outdated Show resolved Hide resolved
build/yamls/antrea-windows-with-ovs.yml Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need this file or the directory? @antoninbas

build/charts/antrea-windows/.helmignore Show resolved Hide resolved
@luolanzone luolanzone added the area/OS/windows Issues or PRs related to the Windows operating system. label May 24, 2024
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

Are you missing the values.yaml file?

You also need to rebase this PR because of conflicts caused by another change that was merged yesterday.

build/charts/antrea-windows/Chart.yaml Show resolved Hide resolved
appVersion: latest
kubeVersion: ">= 1.16.0-0"
icon: https://raw.githubusercontent.com/antrea-io/antrea/main/docs/assets/logo/antrea_logo.svg
description: Kubernetes networking based on Open vSwitch
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
description: Kubernetes networking based on Open vSwitch
description: Kubernetes networking based on Open vSwitch for Windows Nodes

Copy link
Contributor

Choose a reason for hiding this comment

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

why is the name agent.yaml?
Maybe we could have configmaps/antrea-agent-windows.yaml and configmaps/antrea-windows-config.yaml instead?
Or alternatively configmap-antrea-agent-windows.yaml and configmap-antrea-windows-config.yaml.

Copy link
Contributor

Choose a reason for hiding this comment

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

In a PR that was merged yesterday we have stripped the -Containerd suffix for all these files, so you will need to look out for this

Comment on lines 3 to 6
{{- tpl ((.Files.Glob "conf/*.ps1").AsConfig) . | nindent 2 | replace " \n" "\n" }}
{{- if .Values.includeOVS }}
{{- tpl ((.Files.Glob "conf/ovs/*.ps1").AsConfig) . | nindent 2 | replace " \n" "\n" }}
{{- end }}
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like it may be more readable to list all files individually in this case (unlike for the main Linux chart). Do you think it is possible?

Same comment for the other ConfigMap

Copy link
Contributor

@luolanzone luolanzone left a comment

Choose a reason for hiding this comment

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

A few nits

build/charts/antrea-windows/Chart.yaml Outdated Show resolved Hide resolved
hack/generate-manifest-windows.sh Show resolved Hide resolved
hack/generate-manifest-windows.sh Outdated Show resolved Hide resolved
build/charts/antrea-windows/values.yaml Outdated Show resolved Hide resolved
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

If you run cd build/charts && make locally, it should generate a README.md file for the chart (build/charts/antrea-windows/README.md) and you need to check it in. Otherwise CI should fail (I believe this is why the Go / Verify docs and spelling job is failing at the moment).

Another thing: did you confirm that ./hack/release/prepare-assets.sh runs correctly after this change? It should produce the correct Windows manifests, with the correct image tags (versioned tags instead of latest).

hack/generate-manifest-windows.sh Outdated Show resolved Hide resolved
@@ -5,7 +5,7 @@ displayName: Antrea
home: https://antrea.io/
version: 0.0.0
appVersion: latest
kubeVersion: ">= 1.16.0-0"
kubeVersion: ">= 1.19.0-0"
Copy link
Contributor

Choose a reason for hiding this comment

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

It's pretty minor but this change (and the corresponding one in build/charts/flow-aggregator/Chart.yaml) should be in a sepatate PR (that we could even backport to release-2.0).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright reverting this.

Copy link
Contributor

Choose a reason for hiding this comment

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

You need to run make again under build/charts after this change.
Also, could you open a new PR to update the kubeVersion requirement for existing charts?

Copy link
Contributor

Choose a reason for hiding this comment

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

ping for this

build/charts/antrea-windows/values.yaml Outdated Show resolved Hide resolved
Signed-off-by: Shikhar Soni <[email protected]>
Signed-off-by: Shikhar Soni <[email protected]>
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

@wenyingd would you mind taking a quick look?

repository: "antrea/antrea-windows"
tag: "latest"

# -- Enable running Windows OVS processes inside antrea-ovs container in antrea-agent pod
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# -- Enable running Windows OVS processes inside antrea-ovs container in antrea-agent pod
# -- Enable running Windows OVS processes inside antrea-ovs container in antrea-agent Pod

(remember to regenerate the README)

Signed-off-by: Shikhar Soni <[email protected]>
luolanzone
luolanzone previously approved these changes Jun 3, 2024
Copy link
Contributor

@luolanzone luolanzone left a comment

Choose a reason for hiding this comment

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

LGTM @wenyingd @XinShuYang please help to double check, thanks.

tag: "latest"

# -- Enable running Windows OVS processes inside antrea-ovs container in antrea-agent Pod
includeOVS: false
Copy link
Contributor

Choose a reason for hiding this comment

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

By default, when the includeOVS flag is set to false in the Helm chart values, it means that Windows Open vSwitch (OVS) processes inside the antrea-ovs container won't start automatically when deploying with Helm. However, OVS processes are essential for Antrea's operation. While it's acceptable to have includeOVS set to false by default for flexibility, it's crucial to explicitly mention in the documentation that when deploying with Helm, users must set includeOVS to true. The current pull request (PR) does not contain documentation updates regarding this setting.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am fine with defaulting includeOVS to true in this PR, but it doesn't matter much: this PR introduces Helm templating to generate the Antrea Windows manifests, but at the moment we are not exposing this Helm chart to users. For the same reason, there is no need to update documentation as part of this PR.

We may start publishing the Helm chart in a subsequent release.

Copy link
Contributor

Choose a reason for hiding this comment

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

Defaulting includeOVS to true makes sense,
If the Helm chart is not currently exposed to users in current release then it would not be necessary to add documentation in this PR. Anyway We will revisit the documentation and user-facing aspects when we start considering publishing the Helm chart in a subsequent release.

Copy link
Contributor

Choose a reason for hiding this comment

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

@shikharish Could you default includeOVS to true and make the necessary changes for manifest generation? I think that going forward most users will let Antrea run OVS daemons inside a container, and when we do expose the chart to users, a default value of true will therefore make more sense.
Please use a separate commit for that change, for easier reviewing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@antoninbas So generate-manifest-windows.sh by default should create the manifest with OVS enabled?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can keep the same behavior for generate-manifest-windows.sh as now. But if the default value is changed for the chart, then the implementation of the script needs to change a little bit. In particular, if --include-ovs is not provided, you will need to explicitly set the chart value to false. I think the best thing to do in the script would be to always explicitly set the value based on the value of $INCLUDE_OVS.

antoninbas
antoninbas previously approved these changes Jun 4, 2024
wenyingd
wenyingd previously approved these changes Jun 5, 2024
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.

The code change looks good to me.

One question is I saw that this file build/charts/antrea-windows/conf/antrea-agent.conf is actually renamed from this file https://github.com/antrea-io/antrea/blob/main/build/yamls/windows/base/conf/antrea-agent.conf , so it is not strictly using helm key-value format as what Linux was doing. Do we have plan to use another patch to modify it or we will keep the current actions to separately maintain the Windows configurations? @antoninbas


## Requirements

Kubernetes: `>= 1.19.0-0`
Copy link
Contributor

Choose a reason for hiding this comment

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

@shikharish @antoninbas Could you explain why 1.19 is set as the minimum required version? Is it because the versions of Helm and Kubernetes are related?

Copy link
Contributor

@luolanzone luolanzone Jun 5, 2024

Choose a reason for hiding this comment

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

@XinShuYang please check this issue #5879 for the discussion. We changed the minimum supported K8s to v1.19 in Antrea since 2.0.

Copy link
Contributor

Choose a reason for hiding this comment

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

@XinShuYang please check this issue #5879 for the discussion. We changed the minimum supported K8s to v1.19 in Antrea since 2.0.

Since we have removed windows docker support, the windows container manifest can only be deployed when windows host process feature is enabled. But as I know this feature was first introduced in kubernetes 1.22 (https://kubernetes.io/blog/2021/08/16/windows-hostprocess-containers/) Maybe we should update the minimum supported version for antrea windows? Do you have any suggestion? @antoninbas @luolanzone @wenyingd

Copy link
Contributor

Choose a reason for hiding this comment

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

That's a good point. @shikharish please update the version requirement to 1.22 for this chart (and this chart only), and re-generate the Readme

Copy link
Contributor

Choose a reason for hiding this comment

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

reminder

@luolanzone luolanzone added this to the Antrea v2.1 release milestone Jun 5, 2024
@antoninbas
Copy link
Contributor

One question is I saw that this file build/charts/antrea-windows/conf/antrea-agent.conf is actually renamed from this file https://github.com/antrea-io/antrea/blob/main/build/yamls/windows/base/conf/antrea-agent.conf , so it is not strictly using helm key-value format as what Linux was doing. Do we have plan to use another patch to modify it or we will keep the current actions to separately maintain the Windows configurations? @antoninbas

@wenyingd the file is not using templating at the moment. This is because the chart is not exposed to users yet and we only use it for helm templating. Before exposing the chart to users, we will add the appropriate configuration values to values.yaml, and we will use these values to render the configuration. Then it will more closely match what we do for Linux. For now, the only Helm values we have are the ones necessary to render the 2 different supported Windows manifests. Hopefully I understood your question correctly.

@wenyingd
Copy link
Contributor

wenyingd commented Jun 6, 2024

@wenyingd the file is not using templating at the moment. This is because the chart is not exposed to users yet and we only use it for helm templating. Before exposing the chart to users, we will add the appropriate configuration values to values.yaml, and we will use these values to render the configuration. Then it will more closely match what we do for Linux. For now, the only Helm values we have are the ones necessary to render the 2 different supported Windows manifests. Hopefully I understood your question correctly.

Got it, thanks for the explanation.

- $env:CONTAINER_SANDBOX_MOUNT_POINT/var/lib/antrea-windows/Install-OVSDriver.ps1
command:
- powershell
image: antrea/antrea-windows:latest
Copy link
Contributor

@XinShuYang XinShuYang Jun 6, 2024

Choose a reason for hiding this comment

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

I think this value should not be hardcoded, could you update it to align with the others? This bug was introduced by a previous PR, but it would be better if we could fix it in this PR. The GitHub CI didn't catch this bug because when running generate-manifest-windows.sh, it works well in the dev mode but only fails in the release mode. cc @antoninbas

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for catching this @XinShuYang
@shikharish please replace with {{ .Values.image.repository }}:{{ .Values.image.tag }}

Signed-off-by: Shikhar Soni <[email protected]>
@shikharish shikharish dismissed stale reviews from wenyingd and antoninbas via 3fde559 June 7, 2024 17:34
antoninbas
antoninbas previously approved these changes Jun 7, 2024
@antoninbas
Copy link
Contributor

/test-windows-all

@antoninbas
Copy link
Contributor

/test-windows-containerd-networkpolicy
/test-windows-containerd-e2e

home: https://antrea.io/
version: 0.0.0
appVersion: latest
kubeVersion: ">= 1.19.0-0"
Copy link
Contributor

Choose a reason for hiding this comment

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

mark


## Requirements

Kubernetes: `>= 1.19.0-0`
Copy link
Contributor

Choose a reason for hiding this comment

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

reminder

@XinShuYang
Copy link
Contributor

/test-windows-containerd-networkpolicy
/test-windows-containerd-e2e

Signed-off-by: Shikhar Soni <[email protected]>
@antoninbas
Copy link
Contributor

/test-windows-all

Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for working on this!

@antoninbas antoninbas merged commit 6fce4e8 into antrea-io:main Jun 11, 2024
52 of 60 checks passed
antoninbas added a commit to antoninbas/antrea that referenced this pull request Jun 12, 2024
After merging antrea-io#6360, this directory no longer exists.

Signed-off-by: Antonin Bas <[email protected]>
antoninbas added a commit that referenced this pull request Jun 13, 2024
After merging #6360, this directory no longer exists.

Signed-off-by: Antonin Bas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/OS/windows Issues or PRs related to the Windows operating system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use helm to generate antrea windows manifests
6 participants