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

cleanup helm chart #16896

Merged
merged 2 commits into from Jul 28, 2021
Merged

cleanup helm chart #16896

merged 2 commits into from Jul 28, 2021

Conversation

dungdm93
Copy link
Contributor

@dungdm93 dungdm93 commented Jul 15, 2021

This is next part of refactoring helm chart #16792 with the following changes:

  1. remove .Values.Capabilities in favor of --kube-version in helm template, as discussion in #16752

  2. Unify image using cilium.image template.

    image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}{{ if .Values.image.useDigest }}@{{ .Values.image.digest }}{{ end }}"

    Currently, configuring image is quite long, and not consistent between components (some support digest, some are not). By using cilium.image template, it's make configuring image shorter, easier to read and consistent between components.

  3. support priorityClassName.
    Currently, some components (e.g agent) support define priorityClassName in values file, but not using in template :|, other components (e.g hubble-ui, hublle-relay) are not support priorityClassName. So, with this MR, priorityClassName is supported in all components.

  4. move hubble-metrics service & hubble ServiceMonitor to seperated file (in hubble folder)

  5. remove unnecessary parentheses
    Screenshot from 2021-07-15 20-30-29

  6. make name as the first attribute of object

  7. using nindent instead of indent
    Screenshot from 2021-07-15 18-48-14

  8. using default and ternary instead of if-else
    Screenshot from 2021-07-15 18-47-15

  9. using with instead of if when it's possible
    Screenshot from 2021-07-23 15-40-35

Signed-off-by: Đặng Minh Dũng dungdm93@live.com

@dungdm93 dungdm93 requested a review from a team as a code owner July 15, 2021 11:38
@dungdm93 dungdm93 requested review from a team and errordeveloper July 15, 2021 11:38
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Jul 15, 2021
@sayboras sayboras added the release-note/minor This PR changes functionality that users may find relevant to operating Cilium. label Jul 15, 2021
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Jul 15, 2021
@sayboras sayboras added area/helm Impacts helm charts and user deployment experience dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Jul 15, 2021
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Jul 15, 2021
@sayboras sayboras added dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. kind/cleanup This includes no functional changes. labels Jul 15, 2021
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Jul 15, 2021
Copy link
Contributor

@errordeveloper errordeveloper left a comment

Choose a reason for hiding this comment

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

Thanks very much, overall this looks good to me!

Copy link
Member

@gandro gandro left a comment

Choose a reason for hiding this comment

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

remove redundant namespace: {{ .Release.Namespace }}

I mentioned it in the other PR, but this is unfortunately not redundant. This is needed for correct use of helm template --namespace, see helm/helm#3553 (comment)

We are relying on the fact that one can kubectl create the generated YAML without an explicit -n in the docs, so this will break existing workflows.

@dungdm93
Copy link
Contributor Author

Thank @gandro for clearify. namespace is back

Copy link
Member

@gandro gandro left a comment

Choose a reason for hiding this comment

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

From a first glance, this looks correct now, thank you! It will require some manual testing to ensure there are no significant differences in the output.

One thing we need to document (because it's a breaking change) is the removal of the Capabilities values. Please add an upgrade note here:
https://github.com/cilium/cilium/blob/master/Documentation/operations/upgrade.rst#111-upgrade-notes

It could be something like:

  • The Capabilities Helm value has been removed. When using helm template to generate the Kubernetes manifest for a specific Kubernetes version, please use the --kube-version flag (introduced in Helm 3.6.0) instead.

@dungdm93 dungdm93 requested a review from a team as a code owner July 21, 2021 03:40
@dungdm93 dungdm93 requested a review from qmonnet July 21, 2021 03:40
@dungdm93 dungdm93 requested a review from gandro July 21, 2021 03:41
@dungdm93
Copy link
Contributor Author

v1.11 Upgrade Notes added

Copy link
Member

@gandro gandro left a comment

Choose a reason for hiding this comment

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

Starting to look good. A few minor things left that I noticed while comparing the helm template output

@qmonnet qmonnet added the upgrade-impact This PR has potential upgrade or downgrade impact. label Jul 21, 2021
Copy link
Member

@qmonnet qmonnet left a comment

Choose a reason for hiding this comment

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

Looks good overall, although my knowledge of the Helm chart is limited and I'm not able to provide an in-depth review of the changes.

Here are a few nitpicks below. In addition,

  • Please make sure to update the Helm reference in the Documentation (see comment below),
  • And please update your commit log message regarding the remove redundant namespace: {{ .Release.Namespace }}, given that, if I understand the discussion with Sebastian, this is in fact not the case.

@gandro
Copy link
Member

gandro commented Jul 22, 2021

Travis on ARM failed with a transient error, should not block this PR: https://app.travis-ci.com/github/cilium/cilium/jobs/526175793

# Pre-pull FROM docker images due to Buildkit sometimes failing to pull them.

grep "^FROM " Dockerfile | cut -d ' ' -f2 | xargs -n1 docker pull

Error response from daemon: Get https://registry-1.docker.io/v2/library/python/manifests/3.7.9-alpine3.11: Get https://auth.docker.io/token?scope=repository%3Alibrary%2Fpython%3Apull&service=registry.docker.io: EOF

@gandro
Copy link
Member

gandro commented Jul 22, 2021

test-me-please

Copy link
Member

@christarazi christarazi left a comment

Choose a reason for hiding this comment

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

LGTM. Could you squash Update some typo into the first commit? It fits the description of the first commit anyway.

Looks like you'll also need to rebase on master.

@christarazi christarazi added the dont-merge/needs-rebase This PR needs to be rebased because it has merge conflicts. label Jul 22, 2021
Copy link
Member

@christarazi christarazi 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 more git history related comments.

Comment on lines 199 to 201
{{- if .Values.operator.resources }}
{{- with .Values.operator.resources }}
resources:
{{- toYaml .Values.operator.resources | trim | nindent 10 }}
{{- toYaml . | trim | nindent 10 }}
Copy link
Member

Choose a reason for hiding this comment

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

This change is supposed to be part of the 1st commit but is part of the 3rd?

Copy link
Contributor Author

@dungdm93 dungdm93 Jul 23, 2021

Choose a reason for hiding this comment

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

@christarazi The 1st commit also contains priorityClassName changes, so I decided to squash 3rd commit into 1st commit.
I also update 1st commit message to match w/ this PR description.

Comment on lines 25 to 27
{{- if .Values.imagePullSecrets }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml .Values.imagePullSecrets | nindent 6 }}
{{- toYaml . | nindent 6 }}
Copy link
Member

Choose a reason for hiding this comment

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

This change is supposed to be part of the 1st commit but is part of the 3rd?

Comment on lines -2 to -21

{{- /* Workaround so that we can set the minimal k8s version that we support */ -}}
{{- $k8sVersion := .Capabilities.KubeVersion.Version -}}
{{- $k8sMajor := .Capabilities.KubeVersion.Major -}}
{{- $k8sMinor := .Capabilities.KubeVersion.Minor -}}

{{- if .Values.Capabilities -}}
{{- if .Values.Capabilities.KubeVersion -}}
{{- if .Values.Capabilities.KubeVersion.Version -}}
{{- $k8sVersion = .Values.Capabilities.KubeVersion.Version -}}
{{- if .Values.Capabilities.KubeVersion.Major -}}
{{- $k8sMajor = toString (.Values.Capabilities.KubeVersion.Major) -}}
{{- if .Values.Capabilities.KubeVersion.Minor -}}
{{- $k8sMinor = toString (.Values.Capabilities.KubeVersion.Minor) -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}

Copy link
Member

Choose a reason for hiding this comment

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

This change is supposed to be part of the 1st commit but is part of the 3rd?

Copy link
Member

@aanm aanm left a comment

Choose a reason for hiding this comment

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

Thank you for this amazing PR. Two comments:

  1. Is there any linter that you used to catch all of these inconsistencies?
  2. Just to confirm, all changes from install/kubernetes: add priorityClasses #16933 seem to be included in this PR, correct?

@dungdm93
Copy link
Contributor Author

dungdm93 commented Jul 23, 2021

@aanm

  1. Nope, I check all of this with my eye :) Honestly, it took me almost 2 weeks before I create this PR
  2. Yeah, all changes from install/kubernetes: add priorityClasses #16933 are coverd in this PR

@aanm
Copy link
Member

aanm commented Jul 23, 2021

test-me-please

Copy link
Member

@christarazi christarazi left a comment

Choose a reason for hiding this comment

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

🚀

* remove .Values.Capabilities in favor of --kube-version in helm template
* using `cilium.image` template to unify image render
* support `priorityClassName` in all components
* move `hubble-metrics` service & `hubble` ServiceMonitor to seperated file (in hubble folder)
* make `name` as the first attribute of object
* remove unnecessary parentheses
* using `nindent` instead of `indent`
* using `default` and `ternary` instead of `if-else`
* using `with` instead of `if` when it's possible

Signed-off-by: Đặng Minh Dũng <dungdm93@live.com>
Signed-off-by: Đặng Minh Dũng <dungdm93@live.com>
@dungdm93
Copy link
Contributor Author

dungdm93 commented Jul 25, 2021

@christarazi I rebased from master. But seem needs-rebase tag is not auto remove

@christarazi christarazi removed the dont-merge/needs-rebase This PR needs to be rebased because it has merge conflicts. label Jul 26, 2021
Copy link
Member

@qmonnet qmonnet left a comment

Choose a reason for hiding this comment

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

Not sure why you need another review from me, but it still looks good.

@dungdm93
Copy link
Contributor Author

@qmonnet sorry, I click to request review from @errordeveloper but accident click into your name :)

@qmonnet
Copy link
Member

qmonnet commented Jul 27, 2021

test-me-please

@qmonnet
Copy link
Member

qmonnet commented Jul 27, 2021

Ilya is currently out of office, given that his feedback has been addressed I think we can take his earlier comment as an approval. I'm unassigning him.

@qmonnet
Copy link
Member

qmonnet commented Jul 27, 2021

Considering Ilya's implicit approval (see above) and that all tests have passed, I'm labelling as ready-to-merge.

@qmonnet qmonnet added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jul 27, 2021
@brb brb merged commit b22ba5a into cilium:master Jul 28, 2021
@gandro gandro mentioned this pull request Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/helm Impacts helm charts and user deployment experience kind/cleanup This includes no functional changes. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/minor This PR changes functionality that users may find relevant to operating Cilium. upgrade-impact This PR has potential upgrade or downgrade impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants