add production config for testnet release (#2493)

This commit is contained in:
Preston Van Loon
2019-05-05 15:04:28 -04:00
committed by Raul Jordan
parent 409111e374
commit 06a3a0de14
6 changed files with 193 additions and 54 deletions

79
k8s/api.prylabs.net.yaml Normal file
View File

@@ -0,0 +1,79 @@
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: api-prylabs-net
namespace: istio-system
spec:
hosts:
- api.prylabs.net
gateways:
- prylabs-wildcard-gateway
http:
- match:
- uri:
prefix: /faucet.FaucetService
route:
- destination:
port:
number: 8000
host: public-faucet.pow.svc.cluster.local
corsPolicy:
allowOrigin:
- "*"
allowMethods:
- POST
- GET
- OPTIONS
- PUT
- DELETE
allowHeaders:
- grpc-timeout
- content-type
- keep-alive
- user-agent
- cache-control
- content-type
- content-transfer-encoding
- x-accept-content-transfer-encoding
- x-accept-response-streaming
- x-user-agent
- x-grpc-web
maxAge: 1728s
exposeHeaders:
- grpc-status
- grpc-message
- match:
- uri:
prefix: /ethereum.beacon.rpc.v1
route:
- destination:
port:
number: 4000
host: beacon-chain-grpc-web.beacon-chain.svc.cluster.local
corsPolicy:
allowOrigin:
- "*"
allowMethods:
- POST
- GET
- OPTIONS
- PUT
- DELETE
allowHeaders:
- grpc-timeout
- content-type
- keep-alive
- user-agent
- cache-control
- content-type
- content-transfer-encoding
- x-accept-content-transfer-encoding
- x-accept-response-streaming
- x-user-agent
- x-grpc-web
maxAge: 1728s
exposeHeaders:
- grpc-status
- grpc-message
retries:
attempts: 3

View File

@@ -62,3 +62,19 @@ spec:
loadBalancer:
consistentHash:
useSourceIp: true
---
# Public grpc-web service
kind: Service
apiVersion: v1
metadata:
name: beacon-chain-grpc-web
namespace: beacon-chain
spec:
selector:
component: beacon-chain
universe: beacon-chain
ports:
- port: 4000
targetPort: 4000
name: grpc-web-port
type: ClusterIP

View File

@@ -52,6 +52,60 @@ spec:
requests:
cpu: "100m"
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: testnet-site-production
namespace: beacon-chain
labels:
app: beacon-chain
component: testnet-site
version: production
spec:
replicas: 3
selector:
matchLabels:
app: beacon-chain
component: testnet-site
version: production
template:
metadata:
labels:
app: beacon-chain
component: testnet-site
version: production
spec:
priorityClassName: production-priority
containers:
- name: proxy-cache
image: gcr.io/prysmaticlabs/prysm/testnet-proxy-cache:latest
ports:
- containerPort: 80
name: http-cache
livenessProbe:
httpGet:
path: /
port: 4000
initialDelaySeconds: 3
periodSeconds: 15
resources:
requests:
cpu: "100m"
- name: site
image: gcr.io/prysmaticlabs/prysm-testnet-site:sapphire
ports:
- containerPort: 4000
name: http
livenessProbe:
httpGet:
path: /
port: 4000
initialDelaySeconds: 3
periodSeconds: 15
resources:
requests:
cpu: "100m"
---
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
@@ -62,14 +116,32 @@ spec:
apiVersion: extensions/v1beta1
kind: Deployment
name: testnet-site-alpha
minReplicas: 2
maxReplicas: 10
minReplicas: 1
maxReplicas: 3
metrics:
- type: Resource
resource:
name: cpu
targetAverageUtilization: 80
---
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: testnet-site-production
namespace: beacon-chain
spec:
scaleTargetRef:
apiVersion: extensions/v1beta1
kind: Deployment
name: testnet-site-production
minReplicas: 2
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
targetAverageUtilization: 80
---
kind: Service
apiVersion: v1
metadata:
@@ -89,6 +161,25 @@ spec:
name: http-nginx
type: ClusterIP
---
kind: Service
apiVersion: v1
metadata:
name: testnet-site-production
namespace: beacon-chain
spec:
selector:
app: beacon-chain
component: testnet-site
version: production
ports:
- port: 4000
targetPort: 4000
name: http-ng
- port: 80
targetPort: 80
name: http-nginx
type: ClusterIP
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
@@ -140,14 +231,9 @@ spec:
http:
- match:
- uri:
prefix: /assets
prefix: /
route:
- destination:
port:
number: 80
host: testnet-site-alpha.beacon-chain.svc.cluster.local
- match:
- uri:
prefix: /
redirect:
authority: alpha.prylabs.net
host: testnet-site-production.beacon-chain.svc.cluster.local

View File

@@ -10,46 +10,4 @@ spec:
- port: 8000
targetPort: 8000
name: grpc-web-port
type: ClusterIP
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: api-prylabs-net
namespace: istio-system
spec:
hosts:
- api.prylabs.net
gateways:
- prylabs-wildcard-gateway
http:
- route:
- destination:
port:
number: 8000
host: public-faucet.pow.svc.cluster.local
corsPolicy:
allowOrigin:
- "*"
allowMethods:
- POST
- GET
- OPTIONS
- PUT
- DELETE
allowHeaders:
- grpc-timeout
- content-type
- keep-alive
- user-agent
- cache-control
- content-type
- content-transfer-encoding
- x-accept-content-transfer-encoding
- x-accept-response-streaming
- x-user-agent
- x-grpc-web
maxAge: 1728s
exposeHeaders:
- grpc-status
- grpc-message
type: ClusterIP

View File

@@ -36,7 +36,7 @@ metadata:
name: batch-priority
value: 100
globalDefault: false
description: "Suitible for batch jobs that can tolerate occasional downtime."
description: "Suitable for batch jobs that can tolerate occasional downtime."
---
apiVersion: scheduling.k8s.io/v1beta1
kind: PriorityClass

View File

@@ -18,7 +18,7 @@ spec:
- "*.prylabs.net"
- "prylabs.net"
tls:
httpsRedirect: false
httpsRedirect: true
- port:
number: 443
name: https