Skip to content

Commit

Permalink
Merge pull request #354 from celo-org/no-default-replicas
Browse files Browse the repository at this point in the history
Do not use default for replicas
  • Loading branch information
jcortejoso authored Jul 16, 2024
2 parents 9e221df + cfd58fe commit 4f4ed2b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion charts/blockscout/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
apiVersion: v2
name: blockscout
version: 1.3.26
version: 1.3.27
appVersion: v2.0.4-beta
description: Chart which is used to deploy Blockscout for Celo Networks
home: https://explorer.celo.org
Expand Down
11 changes: 7 additions & 4 deletions charts/blockscout/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Chart which is used to deploy Blockscout for Celo Networks

![Version: 1.3.26](https://img.shields.io/badge/Version-1.3.26-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v2.0.4-beta](https://img.shields.io/badge/AppVersion-v2.0.4--beta-informational?style=flat-square)
![Version: 1.3.27](https://img.shields.io/badge/Version-1.3.27-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v2.0.4-beta](https://img.shields.io/badge/AppVersion-v2.0.4--beta-informational?style=flat-square)

- [blockscout](#blockscout)
- [Chart requirements](#chart-requirements)
Expand Down Expand Up @@ -36,7 +36,7 @@ To install/manage a release named `celo-mainnet-fullnode` connected to `mainnet`

```bash
# Select the chart release to use
CHART_RELEASE="oci://us-west1-docker.pkg.dev/celo-testnet/clabs-public-oci/blockscout --version=1.3.26" # Use remote chart and specific version
CHART_RELEASE="oci://us-west1-docker.pkg.dev/celo-testnet/clabs-public-oci/blockscout --version=1.3.27" # Use remote chart and specific version
CHART_RELEASE="./" # Use this local folder

# (Only for local chart) Sync helm dependencies
Expand All @@ -60,7 +60,7 @@ helm upgrade my-blockscout -f values-alfajores-blockscout2.yaml --namespace=celo

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| blockscout.api | object | `{"affinity":{},"autoscaling":{"enabled":true,"maxReplicas":10,"minReplicas":2,"target":{"cpu":70}},"db":{"connectionName":"project:region:db-name","name":"blockscout","port":5432,"proxy":{"resources":{"requests":{"cpu":"10m","memory":"20Mi"}}}},"hostname":"","livenessProbe":{"failureThreshold":5,"httpGet":{"path":"/api/v1/health/liveness","port":"http","scheme":"HTTP"},"initialDelaySeconds":60,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":5},"nodeSelector":{},"poolSize":30,"poolSizeReplica":5,"port":4000,"primaryRpcRegion":"indexer","rateLimit":"1000000","readinessProbe":{"failureThreshold":5,"httpGet":{"path":"/api/v1/health/liveness","port":"http","scheme":"HTTP"},"initialDelaySeconds":30,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":5},"resources":{"requests":{"cpu":0.5,"memory":"500Mi"}},"rpcRegion":"api","strategy":{"rollingUpdate":{"maxSurge":1,"maxUnavailable":"20%"}},"suffix":{"enabled":false,"path":""}}` | Configuraton for the api component |
| blockscout.api | object | `{"affinity":{},"autoscaling":{"enabled":true,"maxReplicas":10,"minReplicas":2,"target":{"cpu":70}},"db":{"connectionName":"project:region:db-name","name":"blockscout","port":5432,"proxy":{"resources":{"requests":{"cpu":"10m","memory":"20Mi"}}}},"hostname":"","livenessProbe":{"failureThreshold":5,"httpGet":{"path":"/api/v1/health/liveness","port":"http","scheme":"HTTP"},"initialDelaySeconds":60,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":5},"nodeSelector":{},"poolSize":30,"poolSizeReplica":5,"port":4000,"primaryRpcRegion":"indexer","rateLimit":"1000000","readinessProbe":{"failureThreshold":5,"httpGet":{"path":"/api/v1/health/liveness","port":"http","scheme":"HTTP"},"initialDelaySeconds":30,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":5},"replicas":1,"resources":{"requests":{"cpu":0.5,"memory":"500Mi"}},"rpcRegion":"api","strategy":{"rollingUpdate":{"maxSurge":1,"maxUnavailable":"20%"}},"suffix":{"enabled":false,"path":""}}` | Configuraton for the api component |
| blockscout.api.affinity | object | `{}` | affinity for api pods |
| blockscout.api.autoscaling | object | `{"enabled":true,"maxReplicas":10,"minReplicas":2,"target":{"cpu":70}}` | HPA configuration for api deployment |
| blockscout.api.db | object | `{"connectionName":"project:region:db-name","name":"blockscout","port":5432,"proxy":{"resources":{"requests":{"cpu":"10m","memory":"20Mi"}}}}` | Database configuration for indexer. Prepared to be used with CloudSQL |
Expand All @@ -76,6 +76,7 @@ helm upgrade my-blockscout -f values-alfajores-blockscout2.yaml --namespace=celo
| blockscout.api.primaryRpcRegion | string | `"indexer"` | PRIMARY_REGION env variable for api pod. Do not change. |
| blockscout.api.rateLimit | string | `"1000000"` | request rateLimit for api coponent |
| blockscout.api.readinessProbe | object | `{"failureThreshold":5,"httpGet":{"path":"/api/v1/health/liveness","port":"http","scheme":"HTTP"},"initialDelaySeconds":30,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":5}` | readinessProbe for api container |
| blockscout.api.replicas | int | `1` | Number of replicas for api deployment. Won't be used if autoscaling.enabled is true |
| blockscout.api.resources | object | `{"requests":{"cpu":0.5,"memory":"500Mi"}}` | resources for api container |
| blockscout.api.rpcRegion | string | `"api"` | MY_REGION env variable for api pod. Do not change. |
| blockscout.api.strategy | object | `{"rollingUpdate":{"maxSurge":1,"maxUnavailable":"20%"}}` | UpdateStrategy for api deployment |
Expand Down Expand Up @@ -106,6 +107,7 @@ helm upgrade my-blockscout -f values-alfajores-blockscout2.yaml --namespace=celo
| blockscout.indexer.poolSizeReplica | int | `5` | Max number of DB connections for read-only API endpoints requests |
| blockscout.indexer.primaryRpcRegion | string | `"indexer"` | PRIMARY_REGION env variable for indexer pod. Do not change. |
| blockscout.indexer.readinessProbe | object | `{"failureThreshold":5,"httpGet":{"path":"/health/readiness","port":"health","scheme":"HTTP"},"initialDelaySeconds":30,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":5}` | readinessProbe for indexer container |
| blockscout.indexer.replicas | int | `1` | Number of replicas for indexer deployment. Should not be bigger than 1 |
| blockscout.indexer.resources | object | `{"requests":{"cpu":2,"memory":"2G"}}` | resources for indexer container |
| blockscout.indexer.rpcRegion | string | `"indexer"` | MY_REGION env variable for indexer pod. Do not change. |
| blockscout.indexer.strategy | object | `{"rollingUpdate":{"maxSurge":1,"maxUnavailable":0}}` | UpdateStrategy for indexer deployment |
Expand All @@ -121,7 +123,7 @@ helm upgrade my-blockscout -f values-alfajores-blockscout2.yaml --namespace=celo
| blockscout.shared.image | object | `{"pullPolicy":"Always","repository":"gcr.io/celo-testnet/blockscout","tag":"c6ca0da21bd238948d13ec2fabf4428a9dbbc7b6"}` | Image to use for blockscout components |
| blockscout.shared.migrationJobInitialValue | string | `"{0,0}"` | Starting point for data migration job (`INITIAL_VALUE` env var) |
| blockscout.shared.secrets | object | `{"analyticsKey":"","campaignBannerApiUrl":"","dbPassword":"","dbUser":"","discordWebhookUrl":"","erlang_cookie":"","grafanaCloud":"","recaptcha_apiKey":"","recaptcha_projectId":"","recaptcha_secretKey":"","recaptcha_siteKey":"","segmentKey":""}` | Reference to secrets. Format: gcp:secretmanager:projects/<project-id>/secrets/<env>-blockscout-<secret-key>. Using tool https://github.com/doitintl/secrets-init |
| blockscout.web | object | `{"accountPoolSize":1,"affinity":{},"appsMenu":{"enabled":true},"autoscaling":{"enabled":true,"maxReplicas":5,"minReplicas":2,"target":{"cpu":70}},"basicAuth":{"enabled":false},"campaignBanner":{"refreshInterval":"60"},"db":{"connectionName":"project:region:db-name","name":"blockscout","port":5432,"proxy":{"resources":{"requests":{"cpu":"10m","memory":"20Mi"}}}},"envHostname":"","extraEnvironments":{"source":[],"target":[]},"homepage":{"showPrice":true,"showTxs":false},"hostname":"","liveUpdates":{"disabled":true},"livenessProbe":{"failureThreshold":5,"httpGet":{"path":"/api/v1/health/liveness","port":"http","scheme":"HTTP"},"initialDelaySeconds":60,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":5},"nodeSelector":{},"poolSize":30,"poolSizeReplica":5,"port":4000,"primaryRpcRegion":"indexer","readinessProbe":{"failureThreshold":5,"httpGet":{"path":"/api/v1/health/liveness","port":"http","scheme":"HTTP"},"initialDelaySeconds":30,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":5},"resources":{"requests":{"cpu":"500m","memory":"250M"}},"rpcRegion":"web","sourcify":{"enabled":true,"repoUrl":"https://repo.sourcify.dev/contracts","serverUrl":"https://sourcify.dev/server"},"stats":{"enabled":false,"makerdojo":"","reportUrl":""},"strategy":{"rollingUpdate":{"maxSurge":1,"maxUnavailable":"20%"}},"suffix":{"enabled":false,"path":""},"tokenIcons":{"enabled":false}}` | Configuraton for the web component |
| blockscout.web | object | `{"accountPoolSize":1,"affinity":{},"appsMenu":{"enabled":true},"autoscaling":{"enabled":true,"maxReplicas":5,"minReplicas":2,"target":{"cpu":70}},"basicAuth":{"enabled":false},"campaignBanner":{"refreshInterval":"60"},"db":{"connectionName":"project:region:db-name","name":"blockscout","port":5432,"proxy":{"resources":{"requests":{"cpu":"10m","memory":"20Mi"}}}},"envHostname":"","extraEnvironments":{"source":[],"target":[]},"homepage":{"showPrice":true,"showTxs":false},"hostname":"","liveUpdates":{"disabled":true},"livenessProbe":{"failureThreshold":5,"httpGet":{"path":"/api/v1/health/liveness","port":"http","scheme":"HTTP"},"initialDelaySeconds":60,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":5},"nodeSelector":{},"poolSize":30,"poolSizeReplica":5,"port":4000,"primaryRpcRegion":"indexer","readinessProbe":{"failureThreshold":5,"httpGet":{"path":"/api/v1/health/liveness","port":"http","scheme":"HTTP"},"initialDelaySeconds":30,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":5},"replicas":1,"resources":{"requests":{"cpu":"500m","memory":"250M"}},"rpcRegion":"web","sourcify":{"enabled":true,"repoUrl":"https://repo.sourcify.dev/contracts","serverUrl":"https://sourcify.dev/server"},"stats":{"enabled":false,"makerdojo":"","reportUrl":""},"strategy":{"rollingUpdate":{"maxSurge":1,"maxUnavailable":"20%"}},"suffix":{"enabled":false,"path":""},"tokenIcons":{"enabled":false}}` | Configuraton for the web component |
| blockscout.web.accountPoolSize | int | `1` | ACCOUNT_POOL_SIZE env variable for web pod |
| blockscout.web.affinity | object | `{}` | affinity for web pods |
| blockscout.web.appsMenu | object | `{"enabled":true}` | Configuration for the app menu on the web, for customizing the list of apps on `More` menu |
Expand All @@ -143,6 +145,7 @@ helm upgrade my-blockscout -f values-alfajores-blockscout2.yaml --namespace=celo
| blockscout.web.poolSizeReplica | int | `5` | Max number of DB connections for read-only API endpoints requests |
| blockscout.web.primaryRpcRegion | string | `"indexer"` | PRIMARY_REGION env variable for web pod. Do not change. |
| blockscout.web.readinessProbe | object | `{"failureThreshold":5,"httpGet":{"path":"/api/v1/health/liveness","port":"http","scheme":"HTTP"},"initialDelaySeconds":30,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":5}` | readinessProbe for web container |
| blockscout.web.replicas | int | `1` | Number of replicas for web deployment. Won't be used if autoscaling.enabled is true |
| blockscout.web.resources | object | `{"requests":{"cpu":"500m","memory":"250M"}}` | resources for web container |
| blockscout.web.rpcRegion | string | `"web"` | MY_REGION env variable for web pod. Do not change. |
| blockscout.web.strategy | object | `{"rollingUpdate":{"maxSurge":1,"maxUnavailable":"20%"}}` | UpdateStrategy for web deployment |
Expand Down
2 changes: 1 addition & 1 deletion charts/blockscout/templates/blockscout-api.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
{{- include "celo.blockscout.annotations" . | nindent 4 }}
spec:
{{- if not .Values.blockscout.api.autoscaling.enabled }}
replicas: {{ .Values.blockscout.api.replicas | default 1 }}
replicas: {{ .Values.blockscout.api.replicas}}
{{- end }}
strategy:
type: RollingUpdate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
rollingUpdate:
maxSurge: {{ .Values.blockscout.indexer.strategy.rollingUpdate.maxSurge }}
maxUnavailable: {{ .Values.blockscout.indexer.strategy.rollingUpdate.maxUnavailable }}
replicas: {{ .Values.blockscout.indexer.replicas | default 1 }}
replicas: {{ .Values.blockscout.indexer.replicas }}
selector:
matchLabels:
app: blockscout
Expand Down
2 changes: 1 addition & 1 deletion charts/blockscout/templates/blockscout-web.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
{{- include "celo.blockscout.annotations" . | nindent 4 }}
spec:
{{- if not .Values.blockscout.web.autoscaling.enabled }}
replicas: {{ .Values.blockscout.web.replicas | default 1 }}
replicas: {{ .Values.blockscout.web.replicas }}
{{- end }}
strategy:
type: RollingUpdate
Expand Down
5 changes: 5 additions & 0 deletions charts/blockscout/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ blockscout:

# -- Configuraton for the indexer component
indexer:
# -- Number of replicas for indexer deployment. Should not be bigger than 1
replicas: 1
# -- termination timeout for indexer pod
terminationGracePeriodSeconds: 60
Expand Down Expand Up @@ -122,6 +123,8 @@ blockscout:

# -- Configuraton for the api component
api:
# -- Number of replicas for api deployment. Won't be used if autoscaling.enabled is true
replicas: 1
# -- Hostname for api ingress endpoint
hostname: ""
# -- If api component is served at rootPath
Expand Down Expand Up @@ -202,6 +205,8 @@ blockscout:

# -- Configuraton for the web component
web:
# -- Number of replicas for web deployment. Won't be used if autoscaling.enabled is true
replicas: 1
# -- Hostname for web ingress endpoint (also applies to api at /(graphql|graphiql|api)).
# If empty, will be generated based on release name and domainName.
hostname: ""
Expand Down

0 comments on commit 4f4ed2b

Please sign in to comment.