From a1088f25755637763436a893e359751d71a44535 Mon Sep 17 00:00:00 2001 From: nikolaivanovj <110764167+nikolaivanovj@users.noreply.github.com> Date: Mon, 13 Jan 2025 13:13:32 +0200 Subject: [PATCH 01/17] Create blockscout-service.yaml --- k8s/blockscout-service.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 k8s/blockscout-service.yaml diff --git a/k8s/blockscout-service.yaml b/k8s/blockscout-service.yaml new file mode 100644 index 00000000000..6fe35a914b6 --- /dev/null +++ b/k8s/blockscout-service.yaml @@ -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 From 7efefb8a074c54b31899b853adba18f9d64891b6 Mon Sep 17 00:00:00 2001 From: nikolaivanovj <110764167+nikolaivanovj@users.noreply.github.com> Date: Mon, 13 Jan 2025 13:14:31 +0200 Subject: [PATCH 02/17] Update deploy-to-aks.yml --- .github/workflows/deploy-to-aks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-to-aks.yml b/.github/workflows/deploy-to-aks.yml index 6d1099b3cc2..f1c412860aa 100644 --- a/.github/workflows/deploy-to-aks.yml +++ b/.github/workflows/deploy-to-aks.yml @@ -35,3 +35,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 From 67024e8f0c25a3b37cbe97f509550cf3e99343e4 Mon Sep 17 00:00:00 2001 From: nikolaivanovj <110764167+nikolaivanovj@users.noreply.github.com> Date: Mon, 13 Jan 2025 13:14:48 +0200 Subject: [PATCH 03/17] Update build-deploy-aks.yml --- .github/workflows/build-deploy-aks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-deploy-aks.yml b/.github/workflows/build-deploy-aks.yml index 750432daccc..07e2e01cc35 100644 --- a/.github/workflows/build-deploy-aks.yml +++ b/.github/workflows/build-deploy-aks.yml @@ -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 From 0d6ba29a462743734e0af373c7ba89ced2900d96 Mon Sep 17 00:00:00 2001 From: nikolaivanovj <110764167+nikolaivanovj@users.noreply.github.com> Date: Mon, 13 Jan 2025 13:25:09 +0200 Subject: [PATCH 04/17] Update deploy-to-aks.yml test adding db --- .github/workflows/deploy-to-aks.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-to-aks.yml b/.github/workflows/deploy-to-aks.yml index f1c412860aa..a177745ad90 100644 --- a/.github/workflows/deploy-to-aks.yml +++ b/.github/workflows/deploy-to-aks.yml @@ -30,7 +30,11 @@ 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 From aab2043d3823f777ab2621360dc25e983bb2c899 Mon Sep 17 00:00:00 2001 From: nikolaivanovj <110764167+nikolaivanovj@users.noreply.github.com> Date: Mon, 13 Jan 2025 13:29:09 +0200 Subject: [PATCH 05/17] Create postgresql.yaml --- k8s/postgresql.yaml | 48 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 k8s/postgresql.yaml diff --git a/k8s/postgresql.yaml b/k8s/postgresql.yaml new file mode 100644 index 00000000000..06ffdebcbfb --- /dev/null +++ b/k8s/postgresql.yaml @@ -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 From 53563f0a413f632fee5a7ed7ff797949cbbb4eea Mon Sep 17 00:00:00 2001 From: nikolaivanovj <110764167+nikolaivanovj@users.noreply.github.com> Date: Mon, 13 Jan 2025 13:44:35 +0200 Subject: [PATCH 06/17] Update service.yaml --- k8s/service.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/k8s/service.yaml b/k8s/service.yaml index bc693cf19e9..104a620814e 100644 --- a/k8s/service.yaml +++ b/k8s/service.yaml @@ -9,4 +9,8 @@ spec: - protocol: TCP port: 80 targetPort: 80 + - protocol: TCP + port: 8545 + targetPort: 8545 type: LoadBalancer + From 02b983101ad9ea7c761b68ac97f83bafa05524f6 Mon Sep 17 00:00:00 2001 From: nikolaivanovj <110764167+nikolaivanovj@users.noreply.github.com> Date: Mon, 13 Jan 2025 13:45:34 +0200 Subject: [PATCH 07/17] Update docker-compose.yml --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index 00b964dfcc9..343d6ea19e3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,6 +4,7 @@ services: geth: image: "${DOCKER_HUB_USERNAME}/go-ethereum:latest" ports: + - "80:8545" - "8545:8545" - "8546:8546" - "30303:30303" From 01ae8548b193c44e0725fa060c4cff8826e2a3df Mon Sep 17 00:00:00 2001 From: nikolaivanovj <110764167+nikolaivanovj@users.noreply.github.com> Date: Mon, 13 Jan 2025 13:50:51 +0200 Subject: [PATCH 08/17] Update blockscout.yaml --- k8s/blockscout.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/k8s/blockscout.yaml b/k8s/blockscout.yaml index fd084d98f7b..486544e3fa2 100644 --- a/k8s/blockscout.yaml +++ b/k8s/blockscout.yaml @@ -17,3 +17,23 @@ spec: image: blockscout/blockscout:latest ports: - containerPort: 4000 + resources: + limits: + memory: "2Gi" + cpu: "1" + requests: + memory: "1Gi" + cpu: "0.5" + env: + - name: DATABASE_URL + value: "postgres://$(POSTGRES_USER):$(POSTGRES_PASSWORD)@postgresql-service:5432/$(POSTGRES_DB)" + - 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 From 3b9893d12080a102af7b33afbeab203a80fedfee Mon Sep 17 00:00:00 2001 From: nikolaivanovj <110764167+nikolaivanovj@users.noreply.github.com> Date: Mon, 13 Jan 2025 13:55:56 +0200 Subject: [PATCH 09/17] Update blockscout.yaml --- k8s/blockscout.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/k8s/blockscout.yaml b/k8s/blockscout.yaml index 486544e3fa2..560a07eb490 100644 --- a/k8s/blockscout.yaml +++ b/k8s/blockscout.yaml @@ -26,7 +26,10 @@ spec: cpu: "0.5" env: - name: DATABASE_URL - value: "postgres://$(POSTGRES_USER):$(POSTGRES_PASSWORD)@postgresql-service:5432/$(POSTGRES_DB)" + valueFrom: + secretKeyRef: + name: postgresql-secret + key: DATABASE_URL - name: SECRET_KEY_BASE valueFrom: secretKeyRef: From 1a5ebd19ee03d69d29f6aa22ced934892ad9f954 Mon Sep 17 00:00:00 2001 From: nikolaivanovj <110764167+nikolaivanovj@users.noreply.github.com> Date: Mon, 13 Jan 2025 13:57:43 +0200 Subject: [PATCH 10/17] Update deployment.yaml --- k8s/deployment.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index fa20a56b9fe..b844e2b9784 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -16,4 +16,7 @@ spec: - name: go-ethereum image: nikolaivanovj/go-ethereum:latest ports: - - containerPort: 80 + - containerPort: 8545 + - containerPort: 8546 + - containerPort: 30303 + - containerPort: 30303 From 7bfa30edd0b28388040ae34b0075c8c11967b0af Mon Sep 17 00:00:00 2001 From: nikolaivanovj <110764167+nikolaivanovj@users.noreply.github.com> Date: Mon, 13 Jan 2025 13:57:58 +0200 Subject: [PATCH 11/17] Update service.yaml --- k8s/service.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/k8s/service.yaml b/k8s/service.yaml index 104a620814e..372d55b3f5c 100644 --- a/k8s/service.yaml +++ b/k8s/service.yaml @@ -12,5 +12,13 @@ spec: - protocol: TCP port: 8545 targetPort: 8545 + - protocol: TCP + port: 8546 + targetPort: 8546 + - protocol: TCP + port: 30303 + targetPort: 30303 + - protocol: UDP + port: 30303 + targetPort: 30303 type: LoadBalancer - From 6da5ecf2dec96a7fa37cfffd21117142186c8e87 Mon Sep 17 00:00:00 2001 From: nikolaivanovj <110764167+nikolaivanovj@users.noreply.github.com> Date: Mon, 13 Jan 2025 14:00:02 +0200 Subject: [PATCH 12/17] Update service.yaml --- k8s/service.yaml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/k8s/service.yaml b/k8s/service.yaml index 372d55b3f5c..c54b55965fb 100644 --- a/k8s/service.yaml +++ b/k8s/service.yaml @@ -6,19 +6,24 @@ spec: selector: app: go-ethereum ports: - - protocol: TCP + - name: http + protocol: TCP port: 80 targetPort: 80 - - protocol: TCP + - name: json-rpc + protocol: TCP port: 8545 targetPort: 8545 - - protocol: TCP + - name: websocket + protocol: TCP port: 8546 targetPort: 8546 - - protocol: TCP + - name: p2p-tcp + protocol: TCP port: 30303 targetPort: 30303 - - protocol: UDP + - name: p2p-udp + protocol: UDP port: 30303 targetPort: 30303 type: LoadBalancer From 6d2c642cf533a958f636eee92c0b128a14b809c2 Mon Sep 17 00:00:00 2001 From: nikolaivanovj <110764167+nikolaivanovj@users.noreply.github.com> Date: Mon, 13 Jan 2025 14:16:56 +0200 Subject: [PATCH 13/17] Update service.yaml --- k8s/service.yaml | 62 ++++++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/k8s/service.yaml b/k8s/service.yaml index c54b55965fb..9ca282ebaed 100644 --- a/k8s/service.yaml +++ b/k8s/service.yaml @@ -1,29 +1,39 @@ -apiVersion: v1 -kind: Service +apiVersion: apps/v1 +kind: Deployment metadata: - name: go-ethereum-service + name: go-ethereum + namespace: go-ethereum spec: + replicas: 3 selector: - app: go-ethereum - ports: - - name: http - protocol: TCP - port: 80 - targetPort: 80 - - 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 + matchLabels: + app: go-ethereum + template: + metadata: + labels: + app: go-ethereum + spec: + containers: + - name: go-ethereum + image: nikolaivanovj/go-ethereum:latest + ports: + - containerPort: 8545 + - containerPort: 8546 + - containerPort: 30303 + - containerPort: 30303/udp + 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" From 0ce0f8a4b0547d755939d93b729a9eb7050806f6 Mon Sep 17 00:00:00 2001 From: nikolaivanovj <110764167+nikolaivanovj@users.noreply.github.com> Date: Mon, 13 Jan 2025 14:17:13 +0200 Subject: [PATCH 14/17] Update deployment.yaml --- k8s/deployment.yaml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index b844e2b9784..9ca282ebaed 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: go-ethereum + namespace: go-ethereum spec: replicas: 3 selector: @@ -19,4 +20,20 @@ spec: - containerPort: 8545 - containerPort: 8546 - containerPort: 30303 - - containerPort: 30303 + - containerPort: 30303/udp + 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" From aa13c12cc70f85112c22f894296c293ee3b6e2c7 Mon Sep 17 00:00:00 2001 From: nikolaivanovj <110764167+nikolaivanovj@users.noreply.github.com> Date: Mon, 13 Jan 2025 14:20:00 +0200 Subject: [PATCH 15/17] Update deployment.yaml --- k8s/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index 9ca282ebaed..ce5392ee95b 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -20,7 +20,7 @@ spec: - containerPort: 8545 - containerPort: 8546 - containerPort: 30303 - - containerPort: 30303/udp + - containerPort: 30303 command: - "geth" - "--http" From e63f091b667550e15ba09ff27651999d87feab41 Mon Sep 17 00:00:00 2001 From: nikolaivanovj <110764167+nikolaivanovj@users.noreply.github.com> Date: Mon, 13 Jan 2025 14:22:16 +0200 Subject: [PATCH 16/17] Update deployment.yaml --- k8s/deployment.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index ce5392ee95b..f564fd66d9f 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -2,7 +2,6 @@ apiVersion: apps/v1 kind: Deployment metadata: name: go-ethereum - namespace: go-ethereum spec: replicas: 3 selector: From 0bb2a1f6600d95560125d17aa533c7efc40949df Mon Sep 17 00:00:00 2001 From: nikolaivanovj <110764167+nikolaivanovj@users.noreply.github.com> Date: Mon, 13 Jan 2025 14:24:00 +0200 Subject: [PATCH 17/17] Update service.yaml --- k8s/service.yaml | 62 ++++++++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 36 deletions(-) diff --git a/k8s/service.yaml b/k8s/service.yaml index 9ca282ebaed..5b2c0909afe 100644 --- a/k8s/service.yaml +++ b/k8s/service.yaml @@ -1,39 +1,29 @@ -apiVersion: apps/v1 -kind: Deployment +apiVersion: v1 +kind: Service metadata: - name: go-ethereum - namespace: go-ethereum + name: go-ethereum-service spec: - replicas: 3 selector: - matchLabels: - app: go-ethereum - template: - metadata: - labels: - app: go-ethereum - spec: - containers: - - name: go-ethereum - image: nikolaivanovj/go-ethereum:latest - ports: - - containerPort: 8545 - - containerPort: 8546 - - containerPort: 30303 - - containerPort: 30303/udp - 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" + app: go-ethereum + ports: + - name: http + protocol: TCP + port: 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