Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build-deploy-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@ jobs:
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
kubectl apply -f k8s/blockscout.yaml
kubectl apply -f k8s/blockscout-service.yaml
7 changes: 6 additions & 1 deletion .github/workflows/deploy-to-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ jobs:
az login --service-principal --username $DOSPN_CLIENT_ID --password $DOSPN_CLIENT_SECRET --tenant $DOSPN_TENANT_ID
az aks get-credentials --resource-group gethdevnetrg --name gethdevnetaks

- name: Deploy to AKS
- name: Deploy PostgreSQL to AKS
run: |
kubectl apply -f k8s/postgresql.yaml

- name: Deploy Blockscout to AKS
run: |
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
kubectl apply -f k8s/blockscout.yaml
kubectl apply -f k8s/blockscout-service.yaml
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ services:
geth:
image: "${DOCKER_HUB_USERNAME}/go-ethereum:latest"
ports:
- "80:8545"
- "8545:8545"
- "8546:8546"
- "30303:30303"
Expand Down
12 changes: 12 additions & 0 deletions k8s/blockscout-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: blockscout-service
spec:
selector:
app: blockscout
ports:
- protocol: TCP
port: 4000
targetPort: 4000
type: LoadBalancer
23 changes: 23 additions & 0 deletions k8s/blockscout.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,26 @@ spec:
image: blockscout/blockscout:latest
ports:
- containerPort: 4000
resources:
limits:
memory: "2Gi"
cpu: "1"
requests:
memory: "1Gi"
cpu: "0.5"
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: postgresql-secret
key: DATABASE_URL
- name: SECRET_KEY_BASE
valueFrom:
secretKeyRef:
name: postgresql-secret
key: SECRET_KEY_BASE
- name: ETHEREUM_JSONRPC_HTTP_URL
valueFrom:
secretKeyRef:
name: postgresql-secret
key: ETHEREUM_JSONRPC_HTTP_URL
21 changes: 20 additions & 1 deletion k8s/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,23 @@ spec:
- name: go-ethereum
image: nikolaivanovj/go-ethereum:latest
ports:
- containerPort: 80
- containerPort: 8545
- containerPort: 8546
- containerPort: 30303
- containerPort: 30303
command:
- "geth"
- "--http"
- "--http.addr"
- "0.0.0.0"
- "--http.port"
- "8545"
- "--http.api"
- "web3,eth,net"
- "--ws"
- "--ws.addr"
- "0.0.0.0"
- "--ws.port"
- "8546"
- "--ws.api"
- "web3,eth,net"
48 changes: 48 additions & 0 deletions k8s/postgresql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgresql
spec:
replicas: 1
selector:
matchLabels:
app: postgresql
template:
metadata:
labels:
app: postgresql
spec:
containers:
- name: postgresql
image: postgres:latest
ports:
- containerPort: 5432
env:
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: postgresql-secret
key: POSTGRES_USER
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: postgresql-secret
key: POSTGRES_PASSWORD
- name: POSTGRES_DB
valueFrom:
secretKeyRef:
name: postgresql-secret
key: POSTGRES_DB
---
apiVersion: v1
kind: Service
metadata:
name: postgresql-service
spec:
selector:
app: postgresql
ports:
- protocol: TCP
port: 5432
targetPort: 5432
type: ClusterIP
21 changes: 19 additions & 2 deletions k8s/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,24 @@ spec:
selector:
app: go-ethereum
ports:
- protocol: TCP
- name: http
protocol: TCP
port: 80
targetPort: 80
targetPort: 8545
- name: json-rpc
protocol: TCP
port: 8545
targetPort: 8545
- name: websocket
protocol: TCP
port: 8546
targetPort: 8546
- name: p2p-tcp
protocol: TCP
port: 30303
targetPort: 30303
- name: p2p-udp
protocol: UDP
port: 30303
targetPort: 30303
type: LoadBalancer
Loading