Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.

[stable/ethereum] Add Chart for Deploying Private Ethereum Network - #3220

Merged
k8s-ci-robot merged 13 commits into
helm:masterfrom
jpoon:master
Mar 28, 2018
Merged

k8s-ci-robot merged 13 commits into
helm:masterfrom
jpoon:master

Conversation

@jpoon

@jpoon jpoon commented Jan 4, 2018 •

Copy link
Copy Markdown
Collaborator

PR adds chart to incubator for deploying a private Ethereum network to Kubernetes (fixes #2088).

The chart is comprised of 3 components:

  1. Bootnode (ethereum/client-go:alltools-v1.7.3)
  2. EthStats (ethereumex/eth-stats-dashboard:latest)
    • Ethereum Network Statistics.
    • Geth nodes will report its statistics to the dashboard
    • Accessable through a k8s service (default: LoadBalancer)
    • Geth only supports reporting status to ONE EthStats, so replica count is NOT configurable for this deployment
  3. Geth (ethereum/client-go:v1.7.3)
    • Geth is deployed in two different manners: miner, transaction
    • Miner nodes are meant for mining and will consume all container's CPU
    • Transaction nodes have mining disabled and are meant to be used to respond to API (websocket/rpc) queries. By default, these are exposed with a ClusterIP

After deploying this chart, you will end up with something like this:

k get all

For general instructions on how to deploy a private Ethereum network, see this.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 4, 2018
@jpoon

jpoon commented Jan 4, 2018

Copy link
Copy Markdown
Collaborator Author

/assign @mgoodness

@mattfarina

Copy link
Copy Markdown
Contributor

@jpoon Can you please correct for the testing errors.

@jpoon

jpoon commented Jan 5, 2018

Copy link
Copy Markdown
Collaborator Author

@mattfarina fixed lint errors.

Comment thread incubator/ethereum/values.yaml Outdated
genesis:
networkId: 98052
accountsToFund:
- da1e55471ded03adadee63ac658b671277a6c7d1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It appears there's a default account to start funding. From our tests and someone who installs this without setting up this own account people could end up mining (using their resources) for someone else.

This should use a pattern of not supplying a default account to fund. If that is required the parts that require it should be skipped and the NOTES.txt file should supply detail on how to handle this.

@jpoon jpoon Jan 8, 2018 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Hey @mattfarina. Thanks for the comment.

From our tests and someone who installs this without setting up this own account people could end up mining (using their resources) for someone else.

I want to clarify that this chart will deploy a private network so it is not connected to mainnet. What happens inside this Helm chart all stays within the k8s cluster. It is a separate Ethereum network.

To give you with a bit more detail:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's the seed value, so, it doesn't seem very dangerous - but I'd echo Matt's sentiment here. It seems awfully easy to forget to change this.

Also, one could start with a genesis.json that has multiple allocs defined already correct? Is there benefit to moving this out of that config into a separate parameter?

@jpoon jpoon Jan 11, 2018 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

one could start with a genesis.json that has multiple allocs defined already correct?

The configuration accepts an array, so supplying multiple allocs is fine. Not sure what difference supplying one vs multiple default accounts would have?

Update: See my latest commit. I've added the public/private key and account secret to the values.yaml. The specified account will be seeded with a ton of Ether and it is also the same account that mined Ether will be deposited to. .

@mattfarina

Copy link
Copy Markdown
Contributor

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 8, 2018
@foxish

foxish commented Jan 9, 2018

Copy link
Copy Markdown
Member

/assign

Comment thread incubator/ethereum/README.md Outdated

The command deploys a private Ethereum network in the default configuration. The configuration](#configuration) section lists various ways to override default configuration during deployment.

> **Tip**: List all releases using `helm list`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems a bit out of place IMO. Should be in general helm documentation.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Comment thread incubator/ethereum/values.yaml Outdated
ethstats:
image:
repository: ethereumex/eth-stats-dashboard
tag: latest

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You'd want to pin to a release tag instead? Is latest a stable tag?

@jpoon jpoon Jan 11, 2018 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fair point. I've reached out to the image owner to get them to push a versioned release.

Comment thread incubator/ethereum/values.yaml Outdated
genesis:
networkId: 98052
accountsToFund:
- da1e55471ded03adadee63ac658b671277a6c7d1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's the seed value, so, it doesn't seem very dangerous - but I'd echo Matt's sentiment here. It seems awfully easy to forget to change this.

Also, one could start with a genesis.json that has multiple allocs defined already correct? Is there benefit to moving this out of that config into a separate parameter?

@jpoon

jpoon commented Jan 11, 2018 •

Copy link
Copy Markdown
Collaborator Author

@foxish @mattfarina. I've made a change with the seed account.

I've removed support for passing multiple accounts, but instead accepting one account public/private keys, and the account secret. The account will be seeded with a ton of Ether and it will also be used to deposit mined Ether.

The account is loaded on the Geth nodes so if you exec in, and run geth account list, you'll see that it's already been imported.

There's no harm in users using the default values as this is all running in a private network.

@mattfarina

Copy link
Copy Markdown
Contributor

@jpoon at the moment I'm waiting on @foxish as he knows this space much better than I do. I'll keep an eye on this to make sure it keeps moving.

@foxish foxish left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Changes LGTM, thanks for making them. Just one more comment and this should be good to go.

Comment thread incubator/ethereum/README.md Outdated
| `geth.genesis.difficulty` | Ethereum network difficulty | `0x0400` |
| `geth.genesis.gasLimit` | Ethereum network gas limit | `0x0x8000000` |
| `geth.account.publicKey` | Geth Account to be initially funded and deposited with mined Ether | `0x975aafe74baa1978c6aabd457cf8d90ee3252db0` |
| `geth.account.privateKey` | Geth Private Key | `5c539529553e68af419860c617e20f604bd92a6f0c212b3671e0ee1312a33748` |

@foxish foxish Jan 12, 2018 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd rather this is left blank - just to avoid someone accidentally starting with a well-known private key. This and the public key can have no defaults and require the user to set a value to start.

@jpoon jpoon Jan 15, 2018 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Public key is required for the miners as it needs a default account to deposit ether. If this is empty, miner's won't come up.

just to avoid someone accidentally starting with a well-known private key

To re-iterate, this is a private Ethereum network. This network has a different genesis block than mainnet so there's no possible way it can sync to the public network.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I understand that it's private. It's not a security question, it's just an uncommon pattern to do this I think.

cc/ @unguiculus who does a lot more chart reviews

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

FWIW, for the burrow chart we had to do adopt a similar pattern, or else the tests wouldn't pass...

replicas: 1
selector:
matchLabels:
app: {{ template "ethereum.name" . }}-bootnode

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The app label should be {{ template "ethereum.name" . }} on all resources the chart creates. You should add component labels that should match the suffix of the resource names. Label selectors should then have app, release, and component labels.

See https://github.com/unguiculus/charts/blob/master/REVIEW_GUIDELINES.md for details.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

@unguiculus unguiculus self-assigned this Jan 15, 2018

@unguiculus unguiculus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tried to correct the components. Since the secret and the configmap are used by two other components, I suggested to remove the component label from them. Or maybe you want to just create one geth component. This is how you structured it in values.yaml. I guess that would make sense.

Comment thread incubator/ethereum/templates/NOTES.txt Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Fix app label in selector and add component label.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

Comment thread incubator/ethereum/templates/NOTES.txt Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Fix app label in selector and add component label.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

{{ template "ethereum.fullname" . }}-bootnode

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

component: bootnode

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

{{ template "ethereum.fullname" . }}-geth-tx

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

component: ethstats

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

{{ template "ethereum.fullname" . }}-ethstats

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

component: ethstats

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's not a component of its own. I'd remove the label.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's not a component of its own. I'd remove the label.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

@jpoon

jpoon commented Jan 16, 2018 •

Copy link
Copy Markdown
Collaborator Author

Thanks @unguiculus. I'm going to keep the geth-tx and geth-miner component labels separate as I need a geth-tx pod selector for the service.

@foxish

foxish commented Jan 24, 2018 •

Copy link
Copy Markdown
Member

@unguiculus @jpoon, is this PR good to go?

@jpoon

jpoon commented Jan 24, 2018

Copy link
Copy Markdown
Collaborator Author

Yes on my side. Addressed all of @unguiculus comments.

@mattfarina mattfarina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have one final process nit

Comment thread incubator/ethereum/LICENSE Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you remove the license file? All charts in the repo are licensed Apache 2. See https://github.com/kubernetes/charts/blob/master/LICENSE

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@jpoon

jpoon commented Feb 28, 2018

Copy link
Copy Markdown
Collaborator Author

@linki that would be optimal but I couldn't figure out a way to do that with Helm.

@prydonius

Copy link
Copy Markdown
Member

@jpoon

jpoon commented Mar 13, 2018

Copy link
Copy Markdown
Collaborator Author

Ooohhh that is helpful. Thanks @prydonius. Do you know of any easy way to extract the public key from the genPrivateKey fx?

Aside: I see you have now moved to SF! Hope things are all well since OpenHack @ AMS.

@prydonius

Copy link
Copy Markdown
Member

@jpoon hmm, not sure actually, I haven't actually used this myself! I'm guessing this might just be for generating self signed certs (the Service Catalog chart uses this). @technosophos @mattfarina any ideas if it's possible to get the public key here?

Aside: I see you have now moved to SF! Hope things are all well since OpenHack @ AMS.

Hah, actually I'm still in London - just never got around to updating my GitHub profile ;). Might be moving back sometime in May, though! Hope you're doing well!

@k8s-ci-robot k8s-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Mar 22, 2018
@jpoon

jpoon commented Mar 22, 2018 •

Copy link
Copy Markdown
Collaborator Author

@unguiculus thank you for adding support for test values (#4157)! Updated PR to add test keys and clarify documentation on how to generate those keys.

Due to the recent test changes, looking for a new LGTM please :)

@prydonius

Copy link
Copy Markdown
Member

@jpoon @unguiculus do you want to move this directly into stable? Doesn't look like there's any reason not to?

@prydonius

Copy link
Copy Markdown
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 23, 2018
@jpoon

jpoon commented Mar 23, 2018

Copy link
Copy Markdown
Collaborator Author

What's the criteria for stable? I can move it over there if you both agree.

@prydonius

Copy link
Copy Markdown
Member

@jpoon it should meet all the technical and documentation requirements listed here: https://github.com/kubernetes/charts/blob/master/CONTRIBUTING.md#technical-requirements. In particular, "Do not leverage alpha features of Kubernetes", as incubator used to be used for a lot of charts implementing PetSet ;).

@k8s-ci-robot k8s-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Mar 27, 2018
@jpoon

jpoon commented Mar 27, 2018 •

Copy link
Copy Markdown
Collaborator Author

Moved it over to stable.

@unguiculus

Copy link
Copy Markdown
Member

helm create with Helm 2.8+ gives you a better _helpers.tpl and adds a chart partial. Would you mind updating?

@jpoon

jpoon commented Mar 27, 2018

Copy link
Copy Markdown
Collaborator Author

@unguiculus done.

@prydonius prydonius changed the title [incubator/ethereum] Add Chart for Deploying Private Ethereum Network [stable/ethereum] Add Chart for Deploying Private Ethereum Network Mar 28, 2018
@prydonius

Copy link
Copy Markdown
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 28, 2018
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jpoon, prydonius, unguiculus

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

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [prydonius,unguiculus]

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

@prydonius

Copy link
Copy Markdown
Member

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 28, 2018
@k8s-ci-robot
k8s-ci-robot merged commit 744a7cd into helm:master Mar 28, 2018
ichtar pushed a commit to Bestmile/charts that referenced this pull request May 15, 2018
…elm#3220)

* add chart for deploying private ethereum network. closes helm#2088.

* fix: update readme. add privatekey for default account to fund

* fix: add private key to values. import-geth-account to geth nodes

* fix: decrease difficulty of network. increase gas limit, allow remote connections to geth-tx

* fix: make difficulty/gasLimit configurable. use versioned ethstats image

* fix: use component labels

* fix: remove LICENSE

* fix: as per code review, remove keys

* docs: add documentation on creating a new geth account

* fix: clarify documentation on creating a new account

* add custom test values.yaml

* move chart to stable

* use latest _helpers
voron pushed a commit to dysnix/helm-charts that referenced this pull request Sep 5, 2018
…elm#3220)

* add chart for deploying private ethereum network. closes helm#2088.

* fix: update readme. add privatekey for default account to fund

* fix: add private key to values. import-geth-account to geth nodes

* fix: decrease difficulty of network. increase gas limit, allow remote connections to geth-tx

* fix: make difficulty/gasLimit configurable. use versioned ethstats image

* fix: use component labels

* fix: remove LICENSE

* fix: as per code review, remove keys

* docs: add documentation on creating a new geth account

* fix: clarify documentation on creating a new account

* add custom test values.yaml

* move chart to stable

* use latest _helpers

Signed-off-by: voron <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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 Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Incubator] Add Ethereum private chain Helm chart

9 participants