First k8s deployment

This commit is contained in:
Joe Howarth 2023-01-17 11:01:52 -07:00
parent f088551a55
commit ee829d12bf
12 changed files with 97 additions and 25 deletions

View File

@ -15,6 +15,20 @@
"chainId": 14,
"rpc": "https://alfajores-forno.celo-testnet.org",
"wormholeAddress": "0x88505117CA88e7dd2eC6EA1E13f0948db2D50D56"
},
{
"description": "BSC",
"rpc": "https://data-seed-prebsc-2-s1.binance.org:8545",
"chainId": 4,
"evmNetworkId": 97,
"wormholeAddress": "0x68605AD7b15c732a30b1BbC62BE8F2A509D74b4D"
},
{
"description": "Mumbai",
"rpc": "https://matic-mumbai.chainstacklabs.com",
"chainId": 5,
"evmNetworkId": 80001,
"wormholeAddress": "0x0CBE91CF822c73C2315FB05100C2F714765d5c20"
}
]
}

View File

@ -15,23 +15,52 @@
"address": "0x61a51662f0B30Bf176484cAc5B4a033C497cB2f3",
"approved": true
}
},
{
"chainId": 5,
"rewardAddress": "0x61a51662f0B30Bf176484cAc5B4a033C497cB2f3",
"approvedSenders": {
"address": "0x61a51662f0B30Bf176484cAc5B4a033C497cB2f3",
"approved": true
}
},
{
"chainId": 4,
"rewardAddress": "0x61a51662f0B30Bf176484cAc5B4a033C497cB2f3",
"approvedSenders": {
"address": "0x61a51662f0B30Bf176484cAc5B4a033C497cB2f3",
"approved": true
}
}
],
"pricingInfo": [
{
"chainId": 6,
"deliverGasOverhead": "350000",
"updatePriceGas": "300000000000",
"updatePriceNative": "100000",
"maximumBudget": "1000000000000000000"
"deliverGasOverhead": "350_000",
"updatePriceGas": "30_000_000_000",
"updatePriceNative": "100_000",
"maximumBudget": "1_000_000_000_000_000_000"
},
{
"chainId": 14,
"deliverGasOverhead": "350000",
"updatePriceGas": "300000000000",
"updatePriceNative": "100000",
"maximumBudget": "1000000000000000000"
"deliverGasOverhead": "350_000",
"updatePriceGas": "30_000_000_000",
"updatePriceNative": "100_000",
"maximumBudget": "1_000_000_000_000_000_000"
},
{
"chainId": 5,
"deliverGasOverhead": "350_000",
"updatePriceGas": "7_322_000_000",
"updatePriceNative": "1_000_000",
"maximumBudget": "1_000_000_000_000_000_000"
},
{
"chainId": 4,
"deliverGasOverhead": "350_000",
"updatePriceGas": "600_000_000_000",
"updatePriceNative": "1_000_000",
"maximumBudget": "1_000_000_000_000_000_000"
}
]
}

View File

@ -1,7 +1,7 @@
FROM node:lts as builder
FROM --platform=linux/amd64 node:lts-alpine as builder
# Create app directory
WORKDIR /usr/src
WORKDIR /usr/src/app
# COPY package.json package-lock.json /src/
@ -11,7 +11,6 @@ WORKDIR /usr/src
# Install app dependencies
# COPY . /src
COPY node_modules .
COPY . .
CMD [ "npm", "run", "k8s-testnet" ]

View File

@ -2,4 +2,4 @@ bash deploy-redis.sh
kubectl apply -f ./spy-service.yaml
source ../../pkeys.sh
bash inject-private-keys.sh
kubectl apply -f ./simple-gr.yaml
kubectl apply -k .

View File

@ -1,5 +1,9 @@
#! /usr/bin/sh
# typically source ../../pkeys.sh in project root first
# kubectl delete secret private-keys --ignore-not-found
kubectl create secret generic private-keys \
--from-literal=PRIVATE_KEYS_CHAIN_14=${PRIVATE_KEYS_CHAIN_14} \
--from-literal=PRIVATE_KEYS_CHAIN_6=${PRIVATE_KEYS_CHAIN_6}

View File

@ -1,7 +1,7 @@
{
"mode": "BOTH",
"logLevel": "debug",
"storeType": "Redis",
"logLevel": "info",
"storeType": "InMemory",
"redisPort": 6379,
"redisHost": "redis-master.default.svc.cluster.local",
"readinessPort": 2000,

View File

@ -0,0 +1,13 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- simple-gr.yaml
configMapGenerator:
- name: relayer-engine-config
files:
- k8s-testnet/common.json
- k8s-testnet/executor.json
- k8s-testnet/listener.json
- name: generic-relayer-plugin-config
files:
- k8s-testnet/k8s-testnet.json

View File

@ -18,18 +18,22 @@ spec:
restartPolicy: Always
containers:
- name: simple-gr
image: simple-gr:latest
imagePullPolicy: Never
image: joehowarth/simple-gr:latest
imagePullPolicy: IfNotPresent
# command: [ "/bin/sh", "-c", "--" ]
# args: [ "while true; do sleep 30; done;" ]
resources:
requests:
cpu: 100m
cpu: 1
memory: 100Mi
limits:
cpu: 900m
memory: 900Mi
ports:
- containerPort: 8000
name: simple-gr
cpu: 2
memory: 2000Mi
volumeMounts:
- name: relayer-engine-config
mountPath: /usr/src/app/engine_config/k8s-testnet
- name: generic-relayer-plugin-config
mountPath: /usr/src/app/src/plugin/config
env:
- name: PRIVATE_KEYS_CHAIN_14
valueFrom:
@ -42,4 +46,11 @@ spec:
secretKeyRef:
name: private-keys
key: PRIVATE_KEYS_CHAIN_6
optional: false
optional: false
volumes:
- name: relayer-engine-config
configMap:
name: relayer-engine-config
- name: generic-relayer-plugin-config
configMap:
name: generic-relayer-plugin-config

View File

@ -4,10 +4,12 @@ kind: Service
metadata:
name: spy
namespace: default
annotations:
"service.beta.kubernetes.io/aws-load-balancer-internal": "0.0.0.0/0"
labels:
app: spy
spec:
type: LoadBalancer
# type: LoadBalancer
selector:
app: spy
ports: