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

allow passing certificates as values instead of files in the Helm chart #2364

Closed
rahil-p opened this issue Nov 10, 2021 · 1 comment · Fixed by #2367
Closed

allow passing certificates as values instead of files in the Helm chart #2364

rahil-p opened this issue Nov 10, 2021 · 1 comment · Fixed by #2367
Labels
good first issue These are great first issues. If you are looking for a place to start, start here! help wanted We would love help on these issues. Please come help us! kind/feature New features for Agones
Milestone

Comments

@rahil-p
Copy link
Contributor

rahil-p commented Nov 10, 2021

Problem

For some manifests, certificates are read in from the certs directory. This makes it very inconvenient for a user to supply their own certificates. Here's an example from the allocator-tls secret:

data:
{{- if .Values.agones.allocator.generateTLS }}
  tls.crt: {{ b64enc $cert.Cert }}
  tls.key: {{ b64enc $cert.Key }}
{{- else }}
  tls.crt: {{ .Files.Get "certs/allocator/server.crt" | b64enc }}
  tls.key: {{ .Files.Get "certs/allocator/server.key" | b64enc }}
{{- end }}

Solution

This problem could be solved by exposing values for providing certificate data. Using the example above:

data:
{{- if .Values.agones.allocator.generateTLS }}
  tls.crt: {{ b64enc $cert.Cert }}
  tls.key: {{ b64enc $cert.Key }}
{{- else }}
  tls.crt: {{ default (.Files.Get "certs/allocator/server.crt") .Values.agones.allocator.tlsCrt | b64enc }}
  tls.key: {{ default (.Files.Get "certs/allocator/server.key") .Values.agones.allocator.tlsKey | b64enc }}
{{- end }}

The user could supply the certificate and key with:

helm install my-release agones/agones \
  --set-file agones.allocator.tlsCrt=mydir/tls.crt,agones.allocator.tlsKey=mydir/tls.key
@rahil-p rahil-p added the kind/feature New features for Agones label Nov 10, 2021
@markmandel markmandel added good first issue These are great first issues. If you are looking for a place to start, start here! help wanted We would love help on these issues. Please come help us! labels Nov 10, 2021
@markmandel
Copy link
Member

I like this idea 👍🏻 a PR would be lovely!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue These are great first issues. If you are looking for a place to start, start here! help wanted We would love help on these issues. Please come help us! kind/feature New features for Agones
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants