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

feat: add erpc chart #345

Merged
merged 11 commits into from
Oct 31, 2024
Merged

Conversation

paolofacchinetti
Copy link
Contributor

Adds the erpc chart and closes #337

A few things i'd love to get some feedback on

I based my implementation and the relative config defaults on the railway-deployment for erpc. I'm not a fan of having the config (which contains remote RPC apikeys) be stored in a configmap, but from how they use gotemplate to load env variables into the config file i assume erpc doesnt support config overrides from environment variables.

The prepackaged docker image by erpc is hardcoded to run as root. It's fairly easy to change that with a new Dockerfile but we would have to rehost the image on another registry and keep it updated. Not sure on what the policies are for that stuff, but i'm open to discuss

I didnt include postgres or prometheus/grafana since they arent a requirement (nor the default config) and people can just deploy those with the relative charts/operators.

@skylenet
Copy link
Member

hey @paolofacchinetti . Thanks for the draft PR!

The prepackaged docker image by erpc is hardcoded to run as root.

You could set some default Pod securityContext, which will prevent any containers from that pod to run as root.

Example, in values.yaml. We also use this in many other charts:

securityContext:
  fsGroup: 10001
  runAsGroup: 10001
  runAsNonRoot: true
  runAsUser: 10001

I didnt include postgres or prometheus/grafana since they arent a requirement (nor the default config) and people can just deploy those with the relative charts/operators.

Yeah, that makes sense 👍

@skylenet
Copy link
Member

I'm not a fan of having the config (which contains remote RPC apikeys) be stored in a configmap, but from how they use gotemplate to load env variables into the config file i assume erpc doesnt support config overrides from environment variables.

You could have an init container, that mounts the configmap and env vars and then performs an envsubst into a file in a shared emtpyDir volume (init container <-> erpc container).

@paolofacchinetti
Copy link
Contributor Author

paolofacchinetti commented Oct 30, 2024

Hey @skylenet, thanks for the feedback!

You could set some default Pod securityContext, which will prevent any containers from that pod to run as root.

Example, in values.yaml. We also use this in many other charts:

securityContext:
  fsGroup: 10001
  runAsGroup: 10001
  runAsNonRoot: true
  runAsUser: 10001

Done in 2dbec96

I was blocked due to a misbelief that erpc could only look for the config file under the /root directory, but after looking into the code I noticed it's possible to specify the config file location as the first cli arg of the boot cmd.

You could have an init container, that mounts the configmap and env vars and then performs an envsubst into a file in a shared emtpyDir volume (init container <-> erpc container).

Done in f5a8051

Apparently erpc already performs env substitution natively. I'm not sure why the railway deployment goes out of its way to do it again through a custom Dockerfile. It looks like the railway deployment also uses gotemplating control flows to specify different upstreams conditionally. That said, we don't need the initContainer.

@paolofacchinetti paolofacchinetti marked this pull request as ready for review October 30, 2024 16:55
@skylenet
Copy link
Member

Awesome! Can you update the content in charts/erpc/README.md.gotmpl and regenerate the README.md using make docs ? Currently it has a lot of dora references.

@paolofacchinetti
Copy link
Contributor Author

Awesome! Can you update the content in charts/erpc/README.md.gotmpl and regenerate the README.md using make docs ? Currently it has a lot of dora references.

Oh you're right, my bad. Now it should be okay 😄

@skylenet skylenet merged commit f25d4a7 into ethpandaops:master Oct 31, 2024
1 check passed
@paolofacchinetti paolofacchinetti deleted the feat/erpc-chart branch November 4, 2024 08:54
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.

Add erpc helm chart
2 participants