Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

keep-prd: Bcoin + Electrum #591

Merged
merged 7 commits into from
May 5, 2020
Merged

Conversation

sthompson22
Copy link
Contributor

@sthompson22 sthompson22 commented Apr 22, 2020

Fresh on the heels of #575 we're setting up some mainnet Bcoin deployments.

Bcoin

This is more or less the same as what we did ^ with some beefcaked configs:

  1. Custom StorageClass with SSD's
  2. 2 replica StatefulSet
  3. Enabled tx indexing on all 3 environments. This is required by Electrum. See https://electrumx.readthedocs.io/en/latest/HOWTO.html

Electrum

Here we provide a production deployment for Electrum. This looks much like our lesser environments except I've stripped all of the tbtc referencing in the resource names. Notably the Service config is missing. I'll do this in the next step when we're ready to expose to the internet.

Something else to note here. keep-dev and keep-test configs are absent from this PR. This is due to us maintaining those configs with the tbtc-maintainers repo. As we phase out maintainers I'll shift the Electrum configs, with naming refactors to this repo.

Much like lesser envs with the addition of a custom storage class for
SSDs and running a 2 replica StatefulSet.
@sthompson22
Copy link
Contributor Author

These are up and syncing

Sloan Thompson added 4 commits April 21, 2020 20:50
For this to have any chance of working with Electrum we need to make
sure tx-index is enabled.  It's in the opening paragraph of their
instructions 😅.
Trying to see how we do on mainnet against a fully indexed bcoin node.
@sthompson22 sthompson22 changed the title keep-prd: Bcoin keep-prd: Bcoin + Electrum Apr 27, 2020
Clarifying which domain the cloudflare origin cert is for.  We need to
do this because the cluster will support origin certs for multiple
domains.

We're setting the replica count to 2 for HA, now that we know Electrum
works with bcoin.
name: mainnet
selector:
app: bitcoin-node
type: bcoin
Copy link
Contributor

Choose a reason for hiding this comment

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

The repetitiveness between name, type, labels, and selectors in these configs is slowly driving me insane. These all feel like opportunities for screwups down the line---updating A but not B, resulting in weird behavior that's hard to diagnose. Starting to lean towards some sort of hybrid where we use a generator to create the configs, and then commit the generated configs for good diffing in PRs...

Anyway, way outside the scope of this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I took setting up prd as an opportunity to revisit labels. The idea is to match lesser environment deployments to these labels, so they're all the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you want to have a separate discussion about labeling patterns I'm happy to do that.

Copy link
Contributor

Choose a reason for hiding this comment

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

I actually like that labels, names, and types are all related, I think it was a good update. What I'm saying instead is that this consistent style may be an opportunity to work to define something once and get a matching YAML, vs having to repeat it 3 times in 20 lines. I realize that can be a slippery slope though; definitely worth a separate discussion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah I see, with you there. This config layer needs some attention for sure, and I'm not sure Helm is the answer.

I think part of me has intentionally kept this layer as dumb as possible until there's an opportunity to research a more elegant solution.

accessModes: [ReadWriteOnce]
resources:
requests:
storage: 450Gi
Copy link
Contributor

Choose a reason for hiding this comment

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

Have we captured somewhere that we should be monitoring this to make sure we can react before we run out of disk?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We'll have an alert policy for disk space in GCP Monitoring, otherwise no.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that's all we need, just making sure it's on the radar.

valueFrom:
secretKeyRef:
name: bcoin
key: http-api-key
Copy link
Contributor

Choose a reason for hiding this comment

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

For my own understanding, this tells the bcoin node the API key others will use to interact with it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Aye.

reclaimPolicy: Retain
allowVolumeExpansion: true
mountOptions:
- debug
Copy link
Contributor

Choose a reason for hiding this comment

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

Again for my own edification, what does debug do as a mount option?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should print debugging info on mount to help troubleshoot if things go sideways.

accessModes: [ReadWriteOnce]
resources:
requests:
storage: 450Gi
Copy link
Contributor

Choose a reason for hiding this comment

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

This is obviously the first time I've taken a deep look at our Electrum deployment heh---does it replicate so much data that it needs the same amount of storage as our main node?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't, but I wasn't entirely sure of the ratio and I felt like if something we sideways we may not have enough time.

I figured if it was at least as large as bcoin storage we wouldn't have any issues. A bit of a sledgehammer.

Copy link
Contributor

@Shadowfiend Shadowfiend left a comment

Choose a reason for hiding this comment

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

This looks good to me, let's do it.

@Shadowfiend Shadowfiend merged commit 030892b into master May 5, 2020
@Shadowfiend Shadowfiend deleted the sthompson22/keep-prd/bcoin-setup branch May 5, 2020 13:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants