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 _tplvalues.tpl and define commonLabels, podLabels, commonAnnotations and podAnnotations attributes #6638

Merged
merged 4 commits into from
Dec 12, 2021

Conversation

ecthelion77
Copy link
Contributor

@ecthelion77 ecthelion77 commented Nov 25, 2021

  • Add _tplvalues.tpl
  • Update values file with default commonLabels, commonAnnotations, podLabels and podAnnotations
  • Update all template to render properly labels and annotations

This change allows to use this helm chart with argocd for example and use multistring labels and annotations with the standardized way from bitnami

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 25, 2021
@floreks
Copy link
Member

floreks commented Dec 1, 2021

Add dependency to bitnami common helm chart

Could you provide a little more background behind this?
Why do we need this and why should we rely on this particular external dependency?

@ecthelion77
Copy link
Contributor Author

Today, it's not possible to provide common information to all resources deployed by the chart. It's really usefull to be able to do that for monitoring for example.

While I integrate those new information (commonLabels, podLabels, commonAnnotations and podAnnotations) seems to be really interesting to use the bitnami common chart as subchart to avoid adding complexity on the concerned chart.

If we integrate basically those new information on templates with :

 {{- toYaml .Values.commonLabels | nindent 4 }}

it's always impossible to use a multistring to set information :

commonLabels:
  label1: value1
  label2: value2

is working, but

commonLabels: |
  "
  label1: value1
  label2: value2
  "

not working

with the templating from bitnami

{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}

both possibilites are working.

And the second solution is really usefull to simplify deployment with argocd

@maciaszczykm
Copy link
Member

I don't think that this is a good place for external dependencies too.

@floreks
Copy link
Member

floreks commented Dec 2, 2021

We are usually quite hesitant to add dependencies of third-party software that is not part of the k8s core (especially when it comes to deployment). We are only providing a helm chart because it is basically the main alternative to deploying apps in K8S. That's why we are not providing i.e. any example reverse-proxy configurations. There are just too many options and we'd rather force users to configure everything on their own without influencing their selection of third-party software.

@desaintmartin
Copy link
Member

I was hesitating before answering. I personally use common but if I'm not wrong, you only use https://github.com/bitnami/charts/blob/master/bitnami/common/templates/_tplvalues.tpl which could be included into this chart instead of adding the whole dependency. What do you think?

(Thanks a lot for the files reformatting)

@ecthelion77
Copy link
Contributor Author

Yes currently I simply use _tplvalues and we can imagine simply add this template to the chart. In my sense, I consider it's interesting to add the dependency to the common to avoid a rewrite of existing template and to let the possibility for future to use others powerfull objects of the dependency.
But if you consider that it's too much and you validate solution based on the integration of the template, I can modify my PR.

@desaintmartin
Copy link
Member

It would be easy to add this dependency if there are other significant needs later, from now on I think the template integration directly in the chart would be simpler to manage.

@linux-foundation-easycla
Copy link

CLA Not Signed

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. and removed cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 6, 2021
@linux-foundation-easycla
Copy link

CLA Not Signed

Add dependency and update values

add _tplvalues and remove dependencies
@ecthelion77 ecthelion77 force-pushed the helm-chart-add-common branch from 3454bd1 to a93ce84 Compare December 6, 2021 09:42
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Dec 6, 2021
@ecthelion77
Copy link
Contributor Author

@desaintmartin change are done, can you review

@@ -79,6 +84,6 @@ spec:
{{- end -}}
{{- if .Values.ingress.tls }}
tls:
{{ toYaml .Values.ingress.tls | indent 4 }}
{{ toYaml .Values.ingress.tls | nindent 4 }}
Copy link
Member

Choose a reason for hiding this comment

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

hehe this could have been indented as well, but honestly thanks for the work so far in streamlining good usage of newlines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

with pleasure :)

@desaintmartin
Copy link
Member

Could a member trigger the CI, please?

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 6, 2021
@desaintmartin
Copy link
Member

Oh, by the way, @ecthelion77, could you update PR name and description to refer to actual content?

@ecthelion77 ecthelion77 changed the title Update helm resources to enable common bitnami usage Add _tplvalues.tpl and define commonLabels, podLabels, commonAnnotations and podAnnotations attributes Dec 6, 2021
@ecthelion77
Copy link
Contributor Author

Oh, by the way, @ecthelion77, could you update PR name and description to refer to actual content?

done :)

@ecthelion77
Copy link
Contributor Author

up

@desaintmartin
Copy link
Member

@floreks @maciaszczykm Could one of you trigger CI?

@codecov
Copy link

codecov bot commented Dec 9, 2021

Codecov Report

Merging #6638 (27cb4b0) into master (870b069) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #6638   +/-   ##
=======================================
  Coverage   42.08%   42.08%           
=======================================
  Files          44       44           
  Lines        1226     1226           
  Branches      161      161           
=======================================
  Hits          516      516           
  Misses        710      710           

bump version to 5.0.5
@ecthelion77
Copy link
Contributor Author

@desaintmartin can you review again please, the chart version was bumped during waiting for worflow approval so i bumped again to version 5.0.5

@ecthelion77
Copy link
Contributor Author

up

@desaintmartin
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 12, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: desaintmartin, ecthelion77

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 57ca4e1 into kubernetes:master Dec 12, 2021
@ecthelion77 ecthelion77 deleted the helm-chart-add-common branch December 13, 2021 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants