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

Helm updates #183

Merged
merged 11 commits into from Jan 18, 2023
Merged

Helm updates #183

merged 11 commits into from Jan 18, 2023

Conversation

jon4hz
Copy link
Contributor

@jon4hz jon4hz commented Dec 28, 2022

Hey,
I was missing some configuration options while deploying infisical with helm.

The following features were added:

  • support for custom annotations
  • support for custom service type for the frontend
  • allow image image overrides

I also added some default helper templates and refactored the naming, labeling and selectors in a more "helmish" way.
Your service currently uses selectors like app=backend which isn't very unique and could lead to troubles, e.g. if more than one infisical installation is running in the same namespace.

@maidul98
Copy link
Collaborator

Awsome, i'll take a look at this soon

@maidul98 maidul98 self-requested a review December 28, 2022 15:42
@maidul98
Copy link
Collaborator

I was unable to run this on my minikube cluster. Were you able to test it out? I also noticed that the backend is unable to connect to the mongo db instance in the deployment anymore

@vmatsiiako
Copy link
Contributor

Hey @jon4hz! Have you maybe had time to look at Maidul's comment above ^ :)

@maidul98
Copy link
Collaborator

maidul98 commented Jan 7, 2023

@mv-turtle Gave me an update via Slack. An update from my side @jon4hz , I did not have time to fix the issue with deployment yet. If you are free, feel free to dig back into it or let me know and I can also do it

@jon4hz
Copy link
Contributor Author

jon4hz commented Jan 8, 2023

Sorry for the late response.
I'm not sure how to handle this correctly.
The mongodb service is now named according to {{ include "infisical.mongodb.fullname" . }} and we can't access named templates from the value file. However I wouldn't rename the service to anything static. Otherwise you can't helm install this chart multiple time in the same namespace.

What do you think about adding another block in the values like mongodbConnection?

mongodbConnection:
  host: xxx # defaults to the internal mongo service
  port: 27017
  username: xxx
  password: xxx

This is a breaking change but something similar will be required anyway if #182 is ever implemented. Bitnami also names the mongodb service with a named template.

@maidul98
Copy link
Collaborator

@jon4hz i will get back to this tomorrow

@maidul98
Copy link
Collaborator

I have looks around quite a bit to see if we can access the named templated in the values file but it looks like this is not possible as you mentioned.

With your suggestion, it looks like the user would be responsible for making sure if there are two instances of Infisical installed that they do not have colliding host names for the mongo db service. Are there any other down sides?

mongodbConnection:
  host: xxx # defaults to the internal mongo service
  port: 27017
  username: xxx
  password: xxx

@gitguardian
Copy link

gitguardian bot commented Jan 14, 2023

⚠️ GitGuardian has uncovered 4 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id Secret Commit Filename
- Generic Database Assignment c23b291 helm-charts/infisical/templates/_helpers.tpl View secret
- Generic Database Assignment c23b291 helm-charts/infisical/values.yaml View secret
- Generic Database Assignment 375412b helm-charts/infisical/templates/_helpers.tpl View secret
- Generic Database Assignment 375412b helm-charts/infisical/values.yaml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@jon4hz
Copy link
Contributor Author

jon4hz commented Jan 14, 2023

Actually the user doesn't have to care about any colliding name because all services will include the helm release name which is unique by default.

c23b291 changes the way how the MONGO_URL variable is set. The MONGO_URL will use the internal mongodb by default with options to override any default values.

But as I already mentioned, this change is breaking but without it, the mongodb connection will always be very static.

@jon4hz
Copy link
Contributor Author

jon4hz commented Jan 14, 2023

Btw, what do you think about changing the backend, so it accepts env vars like MONGO_USER and MONGO_PASSWORD?
This would allow passing only the password as kubernetes secret.
With the current options, you'd have to pass the entire MONGO_URL as secret which isn't very practical imo.

@maidul98
Copy link
Collaborator

I think the reason for putting the entire MONGO_URL was because mongo db cloud has a very different format and putting just the username and password would not cover that use case. For the new block you wanted to add to the values file, how would it look with a mongo cloud url?

@maidul98
Copy link
Collaborator

maidul98 commented Jan 18, 2023

Let me know if you have any concerns for 375412b other wise i'll get it merged in! Thank you so much

maidul98
maidul98 previously approved these changes Jan 18, 2023
@maidul98 maidul98 merged commit 2235069 into Infisical:main Jan 18, 2023
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

Successfully merging this pull request may close these issues.

None yet

3 participants