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

Issue Helm installation with own values.yaml #105

Closed
bartvanackooij opened this issue Jan 28, 2022 · 5 comments
Closed

Issue Helm installation with own values.yaml #105

bartvanackooij opened this issue Jan 28, 2022 · 5 comments

Comments

@bartvanackooij
Copy link

Hi,

I'm trying to deploy the policy-reporter with Helm and I'm running into an issue when I try to apply our own values.yaml file. Not sure if it's a bug or I'm missing something here.

Versions

policy-reporter: v2.2.0
kubernetes: 1.24.1
helm: v3.8.0

Reproduction path:

  1. Install policy-reporter with the default command:
helm upgrade -i policy-reporter policy-reporter/policy-reporter -n policy-reporter --namespace policy-reporter --version v2.2.2

Release "policy-reporter" does not exist. Installing it now.
NAME: policy-reporter
LAST DEPLOYED: Fri Jan 28 19:14:22 2022
NAMESPACE: policy-reporter
STATUS: deployed
REVISION: 1
TEST SUITE: None
  1. Export values used by deployment and store them in file:
    helm show values policy-reporter/policy-reporter > default_values.yaml

  2. Run helm upgrade using the newly created file:
    helm upgrade -i policy-reporter policy-reporter/policy-reporter -n policy-reporter --namespace policy-reporter --version v2.2.2 -f default_values.yaml
    Expected behavior:
    Succesful upgrade showing REVISION: 2

Actual behavior:

Error: UPGRADE FAILED: template: policy-reporter/templates/deployment.yaml:31:28: executing "policy-reporter/templates/deployment.yaml" at <include (print .Template.BasePath "/config-secret.yaml") .>: error calling include: template: policy-reporter/templates/config-secret.yaml:10:18: executing "policy-reporter/templates/config-secret.yaml" at <tpl (.Files.Get "config.yaml") .>: error calling tpl: error during tpl function execution for "loki:\n  host: {{ .Values.target.loki.host | quote }}\n  minimumPriority: {{ .Values.target.loki.minimumPriority | quote }}\n  skipExistingOnStartup: {{ .Values.target.loki.skipExistingOnStartup }}\n  {{- with .Values.target.loki.sources }}\n  sources:\n    {{- toYaml . | nindent 4 }}\n  {{- end }}\n\nelasticsearch:\n  host: {{ .Values.target.elasticsearch.host | quote }}\n  index: {{ .Values.target.elasticsearch.index | default \"policy-reporter\" | quote }}\n  rotation: {{ .Values.target.elasticsearch.rotation | default \"dayli\" | quote }}\n  minimumPriority: {{ .Values.target.elasticsearch.minimumPriority | quote }}\n  skipExistingOnStartup: {{ .Values.target.elasticsearch.skipExistingOnStartup }}\n  {{- with .Values.target.elasticsearch.sources }}\n  sources:\n    {{- toYaml . | nindent 4 }}\n  {{- end }}\n\nslack:\n  webhook: {{ .Values.target.slack.webhook | quote }}\n  minimumPriority: {{ .Values.target.slack.minimumPriority | quote }}\n  skipExistingOnStartup: {{ .Values.target.slack.skipExistingOnStartup }}\n  {{- with .Values.target.slack.sources }}\n  sources:\n    {{- toYaml . | nindent 4 }}\n  {{- end }}\n\ndiscord:\n  webhook: {{ .Values.target.discord.webhook | quote }}\n  minimumPriority: {{ .Values.target.discord.minimumPriority | quote }}\n  skipExistingOnStartup: {{ .Values.target.discord.skipExistingOnStartup }}\n  {{- with .Values.target.discord.sources }}\n  sources:\n    {{- toYaml . | nindent 4 }}\n  {{- end }}\n\nteams:\n  webhook: {{ .Values.target.teams.webhook | quote }}\n  minimumPriority: {{ .Values.target.teams.minimumPriority | quote }}\n  skipExistingOnStartup: {{ .Values.target.teams.skipExistingOnStartup }}\n  {{- with .Values.target.teams.sources }}\n  sources:\n    {{- toYaml . | nindent 4 }}\n  {{- end }}\n\nui:\n  host: {{ include \"policyreporter.uihost\" . }}\n  minimumPriority: {{ .Values.target.ui.minimumPriority | quote }}\n  skipExistingOnStartup: {{ .Values.target.ui.skipExistingOnStartup }}\n  {{- with .Values.target.ui.sources }}\n  sources:\n    {{- toYaml . | nindent 4 }}\n  {{- end }}\n\ns3:\n  accessKeyID: {{ .Values.target.s3.accessKeyID }}\n  secretAccessKey:  {{ .Values.target.s3.secretAccessKey }}\n  region: {{ .Values.target.s3.region }}\n  endpoint: {{ .Values.target.s3.endpoint }}\n  bucket: {{ .Values.target.s3.bucket }}\n  prefix: {{ .Values.target.s3.prefix }}\n  minimumPriority: {{ .Values.target.s3.minimumPriority | quote }}\n  skipExistingOnStartup: {{ .Values.target.s3.skipExistingOnStartup }}\n  {{- with .Values.target.s3.sources }}\n  sources:\n    {{- toYaml . | nindent 4 }}\n  {{- end }}\n\n{{- with .Values.policyPriorities }}\npriorityMap:\n  {{- toYaml . | nindent 2 }}\n{{- end }}": template: policy-reporter/templates/deployment.yaml:49:11: executing "policy-reporter/templates/deployment.yaml" at <include "policyreporter.uihost" .>: error calling include: template: policy-reporter/templates/_helpers.tpl:68:47: executing "policyreporter.uihost" at <.Values.ui.views.logs>: nil pointer evaluating interface {}.logs

Digging through the error message I manage to see something about the UI. So I tried to enable the UI and if I do so, my deployment works.

helm upgrade -i policy-reporter policy-reporter/policy-reporter -n policy-reporter --namespace policy-reporter --version v2.2.2 -f default_values.yaml --set ui.enabled=true

Release "policy-reporter" has been upgraded. Happy Helming!

There is no need for us to have the UI enabled for the policy reporter. So I'd rather have it disabled.

Thanks!

@fjogeleit
Copy link
Member

fjogeleit commented Jan 28, 2022

I found the issue, I will create an bugfix asap

@fjogeleit fjogeleit mentioned this issue Jan 28, 2022
@fjogeleit
Copy link
Member

fjogeleit commented Jan 28, 2022

Can you please update to v2.2.3 and check if it is working now?

@bartvanackooij
Copy link
Author

Wow, that's fast. I'll give it a try today and get back to you asap.

@bartvanackooij
Copy link
Author

helm upgrade -i policy-reporter policy-reporter/policy-reporter -n policy-reporter --namespace policy-reporter --version v2.2.3 -f default_values.yaml
LAST DEPLOYED: Mon Jan 31 06:58:15 2022
NAMESPACE: policy-reporter
STATUS: deployed
REVISION: 1
TEST SUITE: None

Works like a charm, thanks for the swift response. Much appreciated

@fjogeleit
Copy link
Member

Thank you for the response and thanks for trying out Policy Reporter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants