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

Add an Helm chart for Antrea #3578

Merged
merged 5 commits into from
Apr 19, 2022
Merged

Conversation

antoninbas
Copy link
Contributor

And use the Helm templates (instead of Kustomize) to generate the
standard Antrea YAML manifests (which are checked-in and uploaded as
release assets).

Standard manifests are generated based on Helm values files located
under build/yamls/chart-values/, using a new script
(./hack/generate-standard-manifests.sh). It is much faster than the old
version.

While I believe that using Helm directly and specifying YAML values
whenever a new manifest needs to be generated would be better, the
./hack/generate-manifest.sh script is kept as-is, but it now uses Helm
instead of Kustomize.

Documentation for the Helm chart is autogenerated using helm-docs. In a
future PR, we will look into the release process for the Helm
chart. After that, Helm charts could be added for Antrea components
(Flow Aggregator, Flow visibility).

For #2641

Signed-off-by: Antonin Bas abas@vmware.com

@antoninbas antoninbas added action/release-note Indicates a PR that should be included in release notes. area/build-release Issues or PRs related to building and releasing labels Apr 1, 2022
@antoninbas
Copy link
Contributor Author

All the actual changes are in the first commit. The second commit (big diff) is for auto-generated YAML changes.

@antoninbas antoninbas force-pushed the add-helm-chart branch 3 times, most recently from c84ecf0 to ecd5e94 Compare April 1, 2022 23:19
@antoninbas
Copy link
Contributor Author

I used dyff between to compare generated manifests and ensure that there were no unintended changes. It is even K8s aware and is pretty good to compare actual K8s manifest differences. It doesn't work well for the Antrea config though, since it is embedded YAML (ConfigMap data).

@codecov-commenter
Copy link

codecov-commenter commented Apr 1, 2022

Codecov Report

Merging #3578 (ba53a18) into main (2ab80d0) will increase coverage by 1.19%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3578      +/-   ##
==========================================
+ Coverage   63.62%   64.81%   +1.19%     
==========================================
  Files         278      278              
  Lines       39360    39360              
==========================================
+ Hits        25041    25510     +469     
+ Misses      12381    11879     -502     
- Partials     1938     1971      +33     
Flag Coverage Δ
e2e-tests 49.91% <ø> (?)
kind-e2e-tests 52.23% <ø> (+1.48%) ⬆️
unit-tests 43.79% <ø> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/apiserver/handlers/endpoint/handler.go 56.52% <0.00%> (-13.05%) ⬇️
pkg/apiserver/certificate/certificate.go 70.37% <0.00%> (-6.49%) ⬇️
pkg/controller/networkpolicy/status_controller.go 68.54% <0.00%> (-3.23%) ⬇️
...g/controller/networkpolicy/store/appliedtogroup.go 87.61% <0.00%> (-2.86%) ⬇️
pkg/controller/ipam/antrea_ipam_controller.go 77.55% <0.00%> (-1.54%) ⬇️
pkg/controller/externalippool/controller.go 84.82% <0.00%> (-1.34%) ⬇️
pkg/agent/controller/networkpolicy/reject.go 85.88% <0.00%> (-1.18%) ⬇️
pkg/ipam/poolallocator/allocator.go 54.45% <0.00%> (-0.97%) ⬇️
pkg/agent/cniserver/pod_configuration.go 53.75% <0.00%> (-0.29%) ⬇️
pkg/agent/memberlist/cluster.go 74.44% <0.00%> (+0.31%) ⬆️
... and 19 more

@antoninbas antoninbas force-pushed the add-helm-chart branch 3 times, most recently from 6eff071 to f04c15a Compare April 5, 2022 19:02
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 overall

- feature/*

jobs:
check-helm-docs:
Copy link
Member

Choose a reason for hiding this comment

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

could this be a step in the existing "Verify docs and spelling" job? I found there may be a long queue waiting for runners when debugging, do you know runner will be allocated per workflow or job?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is one runner per job, I made the change you suggested

# ca.crt: <CA certificate>
# tls.crt: <TLS certificate>
# tls.key: <TLS private key>
selfSignedCert: {{ .Values.controller.selfSigned }}
Copy link
Member

Choose a reason for hiding this comment

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

is it intended to remove "Cert"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no not intended, not sure why I removed it in the first place

- "--log_file_max_size={{ .Values.agent.antreaOVS.logFileMaxSize }}"
- "--log_file_max_num={{ .Values.agent.antreaOVS.logFileMaxNum }}"
{{- if .Values.logVerbosity }}
- "--v={{ .Values.logVerbosity }}"
Copy link
Member

Choose a reason for hiding this comment

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

Does start_ovs support "--v"? this may lead to failure once set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch

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 overall, just two nits.

@@ -1 +0,0 @@
# placeholder
Copy link
Contributor

Choose a reason for hiding this comment

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

not release with this PR change, but I saw there are a few other .gitignore files have the same #placeholder, do we need them? eg: build/yamls/flow-visibility/patches/release/.gitignore.

@@ -0,0 +1 @@
trafficEncapMode: "networkPolicyOnly"
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a comment in file build/yamls/chart-values/antrea.yml, it leads a little confusion when I see it's empty. I am unable to leave a comment to an empty file, so leave it here.

@luolanzone
Copy link
Contributor

btw, the step Checking whether autogenerated Helm chart documentation is up-to-date in go.yml didn't run because of doc verify failure, looks like you need to rerun make helm-docs to regenerate README.md, there is a variable change from controller.selfSigned to controller.selfSignedCert

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
keywords:
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add "OVS"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll look into adding keywords in a follow-up PR. I still have to figure versioning & release upload for the Helm chart.

hack/generate-manifest.sh Outdated Show resolved Hide resolved
hack/generate-standard-manifests.sh Outdated Show resolved Hide resolved
hack/verify-helm.sh Outdated Show resolved Hide resolved
tnqn
tnqn previously approved these changes Apr 12, 2022
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

@antoninbas
Copy link
Contributor Author

/test-all
/test-ipv6-all

@antoninbas
Copy link
Contributor Author

/test-e2e
/test-ipv6-conformance
/test-ipv6-e2e
/test-ipv6-only-all

And use the Helm templates (instead of Kustomize) to generate the
standard Antrea YAML manifests (which are checked-in and uploaded as
release assets).

Standard manifests are generated based on Helm values files located
under build/yamls/chart-values/, using a new script
(./hack/generate-standard-manifests.sh). It is much faster than the old
version.

While I believe that using Helm directly and specifying YAML values
whenever a new manifest needs to be generated would be better, the
./hack/generate-manifest.sh script is kept as-is, but it now uses Helm
instead of Kustomize.

Documentation for the Helm chart is autogenerated using helm-docs. In a
future PR, we will look into the release process for the Helm
chart. After that, Helm charts could be added for Antrea components
(Flow Aggregator, Flow visibility).

For antrea-io#2641

Signed-off-by: Antonin Bas <abas@vmware.com>
Signed-off-by: Antonin Bas <abas@vmware.com>
Signed-off-by: Antonin Bas <abas@vmware.com>
Signed-off-by: Antonin Bas <abas@vmware.com>
Signed-off-by: Antonin Bas <abas@vmware.com>
@antoninbas
Copy link
Contributor Author

/test-all
/test-ipv6-all
/test-ipv6-only-all

@antoninbas
Copy link
Contributor Author

/test-ipv6-e2e
/test-ipv6-only-e2e
/test-ipv6-conformance

@antoninbas antoninbas added this to the Antrea v1.7 release milestone Apr 15, 2022
@antoninbas
Copy link
Contributor Author

/test-integration
/test-ipv6-e2e

@antoninbas
Copy link
Contributor Author

/test-ipv6-e2e

@antoninbas
Copy link
Contributor Author

Merging this now as the jenkins-ipv6-ds-e2e job is broken

@antoninbas antoninbas merged commit 4a3b76c into antrea-io:main Apr 19, 2022
@antoninbas antoninbas deleted the add-helm-chart branch April 19, 2022 01:06
@hangyan
Copy link
Member

hangyan commented Apr 19, 2022

Sorry i didn't notice this PR before. Thanks. A few comments:

  1. In helm3, a new crds dir is introduced to make sure crds are always installed first. it should be the same level of directory as templates
  2. we can also add the LICENSE file to the charts
  3. Maybe we can add some links to our docs in the NOTES.txt ? or following actions, like list antrea pods command?
  4. I think github have native support for hosts a charts repo ( for publishing antrea chart), maybe there is a github action for that too. Are we planning to support this?
    @antoninbas

@hangyan
Copy link
Member

hangyan commented Apr 19, 2022

@antoninbas
Copy link
Contributor Author

@hangyan thanks for the comments, this is the first PR to add Helm support, and I haven't looked at the release publishing process yet.

Your first point about CRDs is interesting. I have intentionally not placed CRDs in the crds directory for now, as it comes with some limitations (no automatic upgrade). I have been unsure about the correct course of action, and I'll open an issue to discuss this.

@hangyan
Copy link
Member

hangyan commented Apr 20, 2022

@antoninbas That make sense, i also have some doubts about this choice, just rise it up to confirm that we have considered all the limitations of different approaches..

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. area/build-release Issues or PRs related to building and releasing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants