-
Notifications
You must be signed in to change notification settings - Fork 40
4x400: Early pass at a relay maintainer initcontainer #575
Changes from 4 commits
0ea3c0a
5e85d0c
943f336
b15a22b
f5536cd
ae311e6
ed17179
c2b4159
e621410
a5717bb
7b54a54
ac52304
fd4488d
f7d2da8
aa9d157
68c10b1
a7924c7
418c6e2
188eca3
02aa78f
0b75d3d
dec7b72
2b19680
b4de285
ea8f738
0b0d895
08d33df
009f9a3
a5a7777
80f4aea
b7f91ac
25d7034
8856fac
6391c6c
3d07ece
db763e8
bc5e151
deaa64a
a5804d5
0f585af
d10c78a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
--- | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: relay-maintainer | ||
namespace: default | ||
labels: | ||
keel.sh/policy: all | ||
app: maintainer | ||
type: relay | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: maintainer | ||
type: relay | ||
template: | ||
metadata: | ||
labels: | ||
app: maintainer | ||
type: relay | ||
spec: | ||
|
||
initContainers: | ||
- name: initcontainer-provision-relay-maintainer | ||
image: gcr.io/keep-dev-fe24/initcontainer-provision-relay-maintainer | ||
imagePullPolicy: Always | ||
env: | ||
|
||
- name: ETH_RPC_URL | ||
valueFrom: | ||
configMapKeyRef: | ||
name: eth-network-internal | ||
key: rpc-url | ||
|
||
- name: ETH_NETWORK_ID | ||
valueFrom: | ||
configMapKeyRef: | ||
name: eth-network-internal | ||
key: network-id | ||
|
||
- name: ETH_NETWORK_NAME | ||
value: internal | ||
|
||
- name: RELAY_MAINTAINER_ETH_ACCOUNT_ADDRESS | ||
valueFrom: | ||
configMapKeyRef: | ||
name: eth-account-info | ||
key: account-0-address | ||
|
||
- name: RELAY_MAINTAINER_ETH_ACCOUNT_PRIVATE_KEY | ||
valueFrom: | ||
secretKeyRef: | ||
name: eth-account-privatekeys | ||
key: account-0 | ||
|
||
- name: CONTRACT_OWNER_ETH_ACCOUNT_ADDRESS | ||
valueFrom: | ||
configMapKeyRef: | ||
name: eth-network-internal | ||
key: contract-owner-eth-account-address | ||
|
||
- name: CONTRACT_OWNER_ETH_ACCOUNT_PRIVATE_KEY | ||
valueFrom: | ||
secretKeyRef: | ||
name: eth-network-internal | ||
key: contract-owner-eth-account-private-key | ||
|
||
- name: BITCOIN_HOST | ||
value: | ||
|
||
- name: BITCOIN_PORT | ||
value: | ||
|
||
- name: BITCOIN_API_KEY | ||
value: | ||
|
||
volumeMounts: | ||
- name: relay-maintainer-env | ||
mountPath: /mnt/relay-maintainer | ||
command: ['node', '/tmp/provision-relay-maintainer.js'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I go back and forth on this, it feels good to be explicit on the app config with what command is being run for a container, even if it's the default entry point. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like this is probably true for external containers, since they can change out from under you, but for containers we control it feels like we're just doubling our workload whenever we need to change something… Either way, it's fine for this PR, especially if it's what we've been doing elsewhere. |
||
|
||
containers: | ||
- name: relay-maintainer | ||
image: gcr.io/keep-dev-fe24/relay-maintainer | ||
imagePullPolicy: Always | ||
volumeMounts: | ||
- name: relay-maintainer-env | ||
mountPath: /mnt/relay-maintainer | ||
|
||
volumes: | ||
- name: relay-maintainer-env | ||
persistentVolumeClaim: | ||
claimName: relay-maintainer-env | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: relay-maintainer-env | ||
namespace: default | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 5Mi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM node:11 AS runtime | ||
|
||
WORKDIR /tmp | ||
|
||
COPY ./package.json /tmp/package.json | ||
COPY ./package-lock.json /tmp/package-lock.json | ||
|
||
RUN npm ci | ||
|
||
COPY ./env-template /tmp/env-template | ||
|
||
COPY ./provision-relay-maintainer.js /tmp/provision-relay-maintainer.js | ||
|
||
ENTRYPOINT ["node", "./provision-relay-maintainer.js"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# default: 127.0.0.1 | ||
SUMMA_RELAY_ETHER_HOST=127.0.0.1 | ||
|
||
# default: 8545 | ||
SUMMA_RELAY_ETHER_PORT=8545 | ||
|
||
# no default | ||
# 32-byte hex-encoded privkey | ||
SUMMA_RELAY_OPERATOR_KEY= | ||
|
||
# default: ropsten | ||
SUMMA_RELAY_ETH_NETWORK=ropsten | ||
|
||
# default: inherited from ETH_NETWORK. | ||
# to override, leave network blank | ||
SUMMA_RELAY_ETH_CHAIN_ID=33 | ||
|
||
# default: 127.0.0.1 | ||
SUMMA_RELAY_BCOIN_HOST=127.0.0.1 | ||
|
||
# default: "" (empty string) | ||
SUMMA_RELAY_BCOIN_API_KEY="" | ||
|
||
# default: 8332 | ||
SUMMA_RELAY_BCOIN_PORT=8332 | ||
|
||
# no default | ||
# infura project ID | ||
SUMMA_RELAY_INFURA_KEY="" | ||
|
||
# no default | ||
# target relay smart contract address | ||
SUMMA_RELAY_CONTRACT=0x... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put some space between a few values for readability while we work through this.