diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..bd4fc43e --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,36 @@ +name: Lint and Test Charts + +on: pull_request + +jobs: + lint-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v3 + with: + version: v3.12.1 + + - uses: actions/setup-python@v4 + with: + python-version: '3.9' + check-latest: true + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.4.0 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) + if [[ -n "$changed" ]]; then + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + - name: Run chart-testing (lint) + if: steps.list-changed.outputs.changed == 'true' + run: ct lint --target-branch ${{ github.event.repository.default_branch }} diff --git a/helm/celestia-local/.helmignore b/charts/celestia-local/.helmignore similarity index 100% rename from helm/celestia-local/.helmignore rename to charts/celestia-local/.helmignore diff --git a/helm/celestia-local/Chart.yaml b/charts/celestia-local/Chart.yaml similarity index 87% rename from helm/celestia-local/Chart.yaml rename to charts/celestia-local/Chart.yaml index 6d78d220..3c246477 100644 --- a/helm/celestia-local/Chart.yaml +++ b/charts/celestia-local/Chart.yaml @@ -15,10 +15,18 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.0 +version: 0.2.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. appVersion: "1.16.0" + +maintainers: + - name: wafflesvonmaple + url: astria.org + - name: steezeburger + url: astria.org + - name: joroshiba + url: astria.org diff --git a/helm/celestia-local/files/scripts/init-bridge.sh b/charts/celestia-local/files/scripts/init-bridge.sh similarity index 100% rename from helm/celestia-local/files/scripts/init-bridge.sh rename to charts/celestia-local/files/scripts/init-bridge.sh diff --git a/helm/celestia-local/files/scripts/init-celestia-appd.sh b/charts/celestia-local/files/scripts/init-celestia-appd.sh similarity index 100% rename from helm/celestia-local/files/scripts/init-celestia-appd.sh rename to charts/celestia-local/files/scripts/init-celestia-appd.sh diff --git a/helm/celestia-local/files/scripts/start-bridge.sh b/charts/celestia-local/files/scripts/start-bridge.sh similarity index 100% rename from helm/celestia-local/files/scripts/start-bridge.sh rename to charts/celestia-local/files/scripts/start-bridge.sh diff --git a/helm/celestia-local/files/scripts/start-celestia-appd.sh b/charts/celestia-local/files/scripts/start-celestia-appd.sh similarity index 100% rename from helm/celestia-local/files/scripts/start-celestia-appd.sh rename to charts/celestia-local/files/scripts/start-celestia-appd.sh diff --git a/helm/celestia-local/templates/configmap.yaml b/charts/celestia-local/templates/configmap.yaml similarity index 100% rename from helm/celestia-local/templates/configmap.yaml rename to charts/celestia-local/templates/configmap.yaml diff --git a/helm/celestia-local/templates/deployment.yaml b/charts/celestia-local/templates/deployment.yaml similarity index 100% rename from helm/celestia-local/templates/deployment.yaml rename to charts/celestia-local/templates/deployment.yaml diff --git a/helm/celestia-local/templates/service.yaml b/charts/celestia-local/templates/service.yaml similarity index 100% rename from helm/celestia-local/templates/service.yaml rename to charts/celestia-local/templates/service.yaml diff --git a/helm/celestia-local/templates/storageclasses.yaml b/charts/celestia-local/templates/storageclasses.yaml similarity index 100% rename from helm/celestia-local/templates/storageclasses.yaml rename to charts/celestia-local/templates/storageclasses.yaml diff --git a/helm/celestia-local/templates/tests/test-connection.yaml b/charts/celestia-local/templates/tests/test-connection.yaml similarity index 100% rename from helm/celestia-local/templates/tests/test-connection.yaml rename to charts/celestia-local/templates/tests/test-connection.yaml diff --git a/helm/celestia-local/templates/volumes.yaml b/charts/celestia-local/templates/volumes.yaml similarity index 100% rename from helm/celestia-local/templates/volumes.yaml rename to charts/celestia-local/templates/volumes.yaml diff --git a/helm/celestia-local/values.yaml b/charts/celestia-local/values.yaml similarity index 99% rename from helm/celestia-local/values.yaml rename to charts/celestia-local/values.yaml index 5a26b12d..1989b27c 100644 --- a/helm/celestia-local/values.yaml +++ b/charts/celestia-local/values.yaml @@ -43,5 +43,3 @@ ports: celestiaTokenService: 5353 bridgeRPC: 26658 bridgeHTTP: 26659 - - diff --git a/helm/rollup/.helmignore b/charts/rollup/.helmignore similarity index 100% rename from helm/rollup/.helmignore rename to charts/rollup/.helmignore diff --git a/helm/rollup/Chart.yaml b/charts/rollup/Chart.yaml similarity index 86% rename from helm/rollup/Chart.yaml rename to charts/rollup/Chart.yaml index a1200363..046e9ab5 100644 --- a/helm/rollup/Chart.yaml +++ b/charts/rollup/Chart.yaml @@ -15,10 +15,18 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.3.1 +version: 0.4.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.3.0" +appVersion: "0.4.0" + +maintainers: + - name: wafflesvonmaple + url: astria.org + - name: steezeburger + url: astria.org + - name: joroshiba + url: astria.org diff --git a/helm/rollup/files/genesis/geth-genesis.json b/charts/rollup/files/genesis/geth-genesis.json similarity index 100% rename from helm/rollup/files/genesis/geth-genesis.json rename to charts/rollup/files/genesis/geth-genesis.json diff --git a/helm/rollup/files/keys/private_key.txt b/charts/rollup/files/keys/private_key.txt similarity index 100% rename from helm/rollup/files/keys/private_key.txt rename to charts/rollup/files/keys/private_key.txt diff --git a/helm/rollup/files/scripts/init-geth.sh b/charts/rollup/files/scripts/init-geth.sh similarity index 100% rename from helm/rollup/files/scripts/init-geth.sh rename to charts/rollup/files/scripts/init-geth.sh diff --git a/helm/rollup/files/scripts/start-conductor.sh b/charts/rollup/files/scripts/start-conductor.sh similarity index 86% rename from helm/rollup/files/scripts/start-conductor.sh rename to charts/rollup/files/scripts/start-conductor.sh index 96f9adcc..c9ad2f22 100755 --- a/helm/rollup/files/scripts/start-conductor.sh +++ b/charts/rollup/files/scripts/start-conductor.sh @@ -4,7 +4,7 @@ set -o errexit -o nounset -o pipefail # Request Celestia token if connecting to celestia BEARER_TOKEN="" -if [ "$ASTRIA_CONDUCTOR_DISABLE_FINALIZATION" = "false" ]; then +if [ "$ASTRIA_CONDUCTOR_EXECUTION_COMMIT_LEVEL" != "SoftOnly" ]; then BEARER_TOKEN=$(wget -qO- http://celestia-service:5353) if [ -z "$BEARER_TOKEN" ]; then diff --git a/helm/rollup/files/scripts/start-geth.sh b/charts/rollup/files/scripts/start-geth.sh similarity index 100% rename from helm/rollup/files/scripts/start-geth.sh rename to charts/rollup/files/scripts/start-geth.sh diff --git a/charts/rollup/templates/_helpers.tpl b/charts/rollup/templates/_helpers.tpl new file mode 100644 index 00000000..d454cbe0 --- /dev/null +++ b/charts/rollup/templates/_helpers.tpl @@ -0,0 +1,32 @@ +{{/* +Return if ingress is stable. +*/}} +{{- define "rollup.ingress.isStable" -}} +{{- eq (include "rollup.ingress.apiVersion" .) "networking.k8s.io/v1" }} +{{- end }} + +{{/* +Return if ingress supports ingressClassName. +*/}} +{{- define "rollup.ingress.supportsIngressClassName" -}} +{{- or (eq (include "rollup.ingress.isStable" .) "true") (and (eq (include "rollup.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) }} +{{- end }} + +{{/* +Return if ingress supports pathType. +*/}} +{{- define "rollup.ingress.supportsPathType" -}} +{{- or (eq (include "rollup.ingress.isStable" .) "true") (and (eq (include "rollup.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) }} +{{- end }} + +Return the appropriate apiVersion for ingress. +*/}} +{{- define "rollup.ingress.apiVersion" -}} +{{- if and ($.Capabilities.APIVersions.Has "networking.k8s.io/v1") (semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version) }} +{{- print "networking.k8s.io/v1" }} +{{- else if $.Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }} +{{- print "networking.k8s.io/v1beta1" }} +{{- else }} +{{- print "extensions/v1beta1" }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/helm/rollup/templates/configmap.yaml b/charts/rollup/templates/configmap.yaml similarity index 99% rename from helm/rollup/templates/configmap.yaml rename to charts/rollup/templates/configmap.yaml index a8e4ac0e..e53a41f6 100644 --- a/helm/rollup/templates/configmap.yaml +++ b/charts/rollup/templates/configmap.yaml @@ -8,7 +8,7 @@ data: ASTRIA_CONDUCTOR_CELESTIA_NODE_URL: "{{ .Values.config.celestia.fullNodeUrl }}" ASTRIA_CONDUCTOR_CHAIN_ID: "{{ .Values.config.rollup.chainId }}" ASTRIA_CONDUCTOR_EXECUTION_RPC_URL: "http://127.0.0.1:{{ .Values.ports.executionGRPC }}" - ASTRIA_CONDUCTOR_DISABLE_FINALIZATION: "{{ .Values.config.rollup.disableFinalization }}" + ASTRIA_CONDUCTOR_EXECUTION_COMMIT_LEVEL: "{{ .Values.config.rollup.executionCommitLevel }}" ASTRIA_CONDUCTOR_SEQUENCER_URL: "{{ .Values.config.sequencer.websocket }}" ASTRIA_CONDUCTOR_DISABLE_EMPTY_BLOCK_EXECUTION: "{{ .Values.config.rollup.skipEmptyBlocks }}" ASTRIA_CONDUCTOR_INITIAL_SEQUENCER_BLOCK_HEIGHT: "{{ .Values.config.sequencer.initialBlockHeight }}" diff --git a/helm/rollup/templates/deployment.yaml b/charts/rollup/templates/deployment.yaml similarity index 100% rename from helm/rollup/templates/deployment.yaml rename to charts/rollup/templates/deployment.yaml diff --git a/helm/rollup/templates/ingress.yaml b/charts/rollup/templates/ingress.yaml similarity index 54% rename from helm/rollup/templates/ingress.yaml rename to charts/rollup/templates/ingress.yaml index b0096bb8..81b53455 100644 --- a/helm/rollup/templates/ingress.yaml +++ b/charts/rollup/templates/ingress.yaml @@ -1,10 +1,42 @@ +{{- if .Values.ingress.enabled -}} +{{- $ingressApiIsStable := eq (include "rollup.ingress.isStable" .) "true" -}} +{{- $ingressSupportsIngressClassName := eq (include "rollup.ingress.supportsIngressClassName" .) "true" -}} +{{- $ingressSupportsPathType := eq (include "rollup.ingress.supportsPathType" .) "true" -}} +{{- $ingressPathType := .Values.ingress.pathType -}} +{{- $extraPaths := .Values.ingress.extraPaths -}} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ .Values.config.rollup.name }}-ingress namespace: {{ .Values.namespace }} + labels: + {{- with .Values.ingress.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.ingress.annotations }} + annotations: + {{- range $key, $value := . }} + {{ $key }}: {{ tpl $value $ | quote }} + {{- end }} + {{- end }} spec: + {{- if and $ingressSupportsIngressClassName .Values.ingress.ingressClassName }} + ingressClassName: {{ .Values.ingress.ingressClassName }} + {{- end -}} + {{- with .Values.ingress.defaultBackend }} + defaultBackend: + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} rules: + {{- if .Values.ingress.hosts }} + {{- with .Values.ingress.hosts }} + {{- tpl (toYaml .) $ | nindent 6 }} + {{- end }} + {{- with .Values.ingress.tls }} + tls: + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} + {{- else }} - host: executor.{{ .Values.config.rollup.name }}.localdev.me http: paths: @@ -45,3 +77,6 @@ spec: name: {{ .Values.config.rollup.name }}-blockscout-svc port: name: blockscout-svc + {{- end -}} +{{- end }} + diff --git a/helm/rollup/templates/secretproviderclass.yaml b/charts/rollup/templates/secretproviderclass.yaml similarity index 100% rename from helm/rollup/templates/secretproviderclass.yaml rename to charts/rollup/templates/secretproviderclass.yaml diff --git a/helm/rollup/templates/service.yaml b/charts/rollup/templates/service.yaml similarity index 100% rename from helm/rollup/templates/service.yaml rename to charts/rollup/templates/service.yaml diff --git a/helm/rollup/templates/storageclasses.yaml b/charts/rollup/templates/storageclasses.yaml similarity index 100% rename from helm/rollup/templates/storageclasses.yaml rename to charts/rollup/templates/storageclasses.yaml diff --git a/helm/rollup/templates/volumes.yaml b/charts/rollup/templates/volumes.yaml similarity index 100% rename from helm/rollup/templates/volumes.yaml rename to charts/rollup/templates/volumes.yaml diff --git a/helm/rollup/values.yaml b/charts/rollup/values.yaml similarity index 67% rename from helm/rollup/values.yaml rename to charts/rollup/values.yaml index 4625aae0..63915d8b 100644 --- a/helm/rollup/values.yaml +++ b/charts/rollup/values.yaml @@ -19,8 +19,11 @@ config: networkId: 912559 # Set to true to have rollup blocks only be generated when there are transactions skipEmptyBlocks: false - # Set to true to rely on sequencer fully without Celestia DA finalization - disableFinalization: false + # Determines what will drive block execution, options are: + # - "SoftOnly" -> blocks are only pulled from the sequencer + # - "FirmOnly" -> blocks are only pulled from DA + # - "SoftAndFirm" -> blocks are pulled from both the sequencer and DA + executionCommitLevel: 'SoftOnly' # Definitions around who has funding on startup genesisAccounts: - address: "0xaC21B97d35Bf75A7dAb16f35b111a50e78A72F30" @@ -29,7 +32,7 @@ config: faucet: # The account from which the faucet disburses funds, likely want to have # the corresponding account given a balance in genesis accounts. - # Note: When secretProvider.enabled is true the secret provided by + # Note: When secretProvider.enabled is true the secret provided by # `evmPrivateKey` is used instead of this value. privateKey: "8b3a7999072c9c9314c084044fe705db11714c6c4ed7cddb64da18ea270dd203" # The amount of token to give per request @@ -39,15 +42,15 @@ config: sequencer: # Block height to start syncing rollup from initialBlockHeight: 1 - # Websocket connection used for + # Websocket connection used for websocket: "ws://sequencer-service:26657/websocket" # URL path for the sequencer rpc: "http://sequencer-service:26657" # Private key which is used for wrapping txs for sequencer submission - # Note: When secretProvider.enabled is true the secret provided by + # Note: When secretProvider.enabled is true the secret provided by # `sequencerPrivateKey` is used instead of this value. privateKey: "2bd806c97f0e00af1a1fc3328fa763a9269723c8db8fac4f93af71db186d6e90" - + # Configuration for Celestia DA celestia: # Full node which client will connect to @@ -56,13 +59,13 @@ config: images: # Core images for the rollup, developed for Astria geth: "ghcr.io/astriaorg/go-ethereum:0.3.0" - conductor: "ghcr.io/astriaorg/conductor:0.6.0--conductor" - composer: "ghcr.io/astriaorg/composer:0.2.1--composer" + conductor: "ghcr.io/astriaorg/conductor:0.7.0--conductor" + composer: "ghcr.io/astriaorg/composer:0.2.2--composer" # Rollup faucet faucet: "ghcr.io/astriaorg/ria-faucet:0.0.1" - # Pertaining to deploying blockscout block explorer + # Pertaining to deploying blockscout block explorer blockscout: core: "docker.io/blockscout/blockscout:5.1.0" postgres: "docker.io/library/postgres:14" @@ -88,7 +91,53 @@ secretProvider: filename: evmPrivateKey.txt resourceName: "projects/$PROJECT_ID/secrets/evmPrivateKey/versions/latest" key: token - + +ingress: + enabled: true + # For Kubernetes >= 1.18 you should specify the ingress-controller via the field ingressClassName + # See https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#specifying-the-class-of-an-ingress + # ingressClassName: nginx + # Values can be templated + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + labels: {} + hosts: {} + # - host: executor.example.com + # http: + # paths: + # - path: "/" + # pathType: Prefix + # backend: + # service: + # name: astria-evm-service + # port: + # name: json-rpc-svc + # - host: faucet.example.com + # http: + # paths: + # - path: "/" + # pathType: Prefix + # backend: + # service: + # name: astria-faucet-service + # port: + # name: faucet-svc + # - host: blockscout.example.com + # http: + # paths: + # - path: "/" + # pathType: Prefix + # backend: + # service: + # name: astria-blockscout-svc + # port: + # name: blockscout-svc + tls: {} + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + # Default persistent storage values # NOTE - `rollupName` will be used with `persistentVolumeName` to generate names for kubernetes resources. # e.g. astria-executor-pv, astria-executor-pvc diff --git a/helm/sequencer-faucet/.helmignore b/charts/sequencer-faucet/.helmignore similarity index 100% rename from helm/sequencer-faucet/.helmignore rename to charts/sequencer-faucet/.helmignore diff --git a/helm/sequencer-faucet/Chart.yaml b/charts/sequencer-faucet/Chart.yaml similarity index 88% rename from helm/sequencer-faucet/Chart.yaml rename to charts/sequencer-faucet/Chart.yaml index a030d245..59cbeaaf 100644 --- a/helm/sequencer-faucet/Chart.yaml +++ b/charts/sequencer-faucet/Chart.yaml @@ -15,10 +15,18 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.0 +version: 0.2.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. appVersion: "0.1.0" + +maintainers: + - name: wafflesvonmaple + url: astria.org + - name: steezeburger + url: astria.org + - name: joroshiba + url: astria.org diff --git a/charts/sequencer-faucet/templates/_helpers.tpl b/charts/sequencer-faucet/templates/_helpers.tpl new file mode 100644 index 00000000..df67bd28 --- /dev/null +++ b/charts/sequencer-faucet/templates/_helpers.tpl @@ -0,0 +1,32 @@ +{{/* +Return if ingress is stable. +*/}} +{{- define "sequencer.ingress.isStable" -}} +{{- eq (include "sequencer.ingress.apiVersion" .) "networking.k8s.io/v1" }} +{{- end }} + +{{/* +Return if ingress supports ingressClassName. +*/}} +{{- define "sequencer.ingress.supportsIngressClassName" -}} +{{- or (eq (include "sequencer.ingress.isStable" .) "true") (and (eq (include "sequencer.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) }} +{{- end }} + +{{/* +Return if ingress supports pathType. +*/}} +{{- define "sequencer.ingress.supportsPathType" -}} +{{- or (eq (include "sequencer.ingress.isStable" .) "true") (and (eq (include "sequencer.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) }} +{{- end }} + +Return the appropriate apiVersion for ingress. +*/}} +{{- define "sequencer.ingress.apiVersion" -}} +{{- if and ($.Capabilities.APIVersions.Has "networking.k8s.io/v1") (semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version) }} +{{- print "networking.k8s.io/v1" }} +{{- else if $.Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }} +{{- print "networking.k8s.io/v1beta1" }} +{{- else }} +{{- print "extensions/v1beta1" }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/helm/sequencer-faucet/templates/configmap.yaml b/charts/sequencer-faucet/templates/configmap.yaml similarity index 100% rename from helm/sequencer-faucet/templates/configmap.yaml rename to charts/sequencer-faucet/templates/configmap.yaml diff --git a/helm/sequencer-faucet/templates/deployment.yaml b/charts/sequencer-faucet/templates/deployment.yaml similarity index 100% rename from helm/sequencer-faucet/templates/deployment.yaml rename to charts/sequencer-faucet/templates/deployment.yaml diff --git a/charts/sequencer-faucet/templates/ingress.yaml b/charts/sequencer-faucet/templates/ingress.yaml new file mode 100644 index 00000000..43b00d38 --- /dev/null +++ b/charts/sequencer-faucet/templates/ingress.yaml @@ -0,0 +1,73 @@ +{{- if .Values.ingress.enabled -}} +{{- $ingressApiIsStable := eq (include "sequencer.ingress.isStable" .) "true" -}} +{{- $ingressSupportsIngressClassName := eq (include "sequencer.ingress.supportsIngressClassName" .) "true" -}} +{{- $ingressSupportsPathType := eq (include "sequencer.ingress.supportsPathType" .) "true" -}} +{{- $servicePort := .Values.ingress.service.port -}} +{{- $serviceName := .Values.ingress.service.name -}} +{{- $ingressPath := .Values.ingress.path -}} +{{- $ingressPathType := .Values.ingress.pathType -}} +{{- $extraPaths := .Values.ingress.extraPaths -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: sequencer-faucet-ingress + namespace: {{ .Values.namespace }} + labels: + {{- with .Values.ingress.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.ingress.annotations }} + annotations: + {{- range $key, $value := . }} + {{ $key }}: {{ tpl $value $ | quote }} + {{- end }} + {{- end }} +spec: + {{- if and $ingressSupportsIngressClassName .Values.ingress.ingressClassName }} + ingressClassName: {{ .Values.ingress.ingressClassName }} + {{- end -}} + {{- with .Values.ingress.defaultBackend }} + defaultBackend: + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} + rules: + {{- if .Values.ingress.hosts }} + {{- range .Values.ingress.hosts }} + - host: {{ tpl . $ }} + http: + paths: + {{- with $extraPaths }} + {{- toYaml . | nindent 10 }} + {{- end }} + - path: {{ $ingressPath }} + {{- if $ingressSupportsPathType }} + pathType: {{ $ingressPathType }} + {{- end }} + backend: + {{- if $ingressApiIsStable }} + service: + name: {{ $serviceName }} + port: + number: {{ $servicePort }} + {{- else }} + serviceName: {{ $serviceName }} + servicePort: {{ $servicePort }} + {{- end }} + {{- end }} + {{- with .Values.ingress.tls }} + tls: + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} + {{- else }} + - host: sequencer-faucet.localdev.me + http: + paths: + - path: "/" + pathType: Prefix + backend: + service: + name: sequencer-faucet-service + port: + name: seq-faucet-svc + {{- end -}} +{{- end }} diff --git a/helm/sequencer-faucet/templates/secretproviderclass.yaml b/charts/sequencer-faucet/templates/secretproviderclass.yaml similarity index 100% rename from helm/sequencer-faucet/templates/secretproviderclass.yaml rename to charts/sequencer-faucet/templates/secretproviderclass.yaml diff --git a/helm/sequencer-faucet/templates/service.yaml b/charts/sequencer-faucet/templates/service.yaml similarity index 100% rename from helm/sequencer-faucet/templates/service.yaml rename to charts/sequencer-faucet/templates/service.yaml diff --git a/charts/sequencer-faucet/values.yaml b/charts/sequencer-faucet/values.yaml new file mode 100644 index 00000000..06c51588 --- /dev/null +++ b/charts/sequencer-faucet/values.yaml @@ -0,0 +1,75 @@ +namespace: "astria-dev-cluster" +replicaCount: 1 + +config: + sequencerRpcUrl: http://sequencer-service:26657 + # This private key will be replaced with `sequencerPrivateKey` when enabled + # For testing purposes only, do not use except with local development cluster, + # it corresponds with the following account: + # address: 00d75b270542084a54fcf0d0f6eab0402982d156 + # pubKey: db617d4ec61726efc4d993488931b37f7774bf04ad916b8f974d33c9241ee762 + fundingPrivateKey: 934ab488f9e1900f6a08f50605ce1409ca9d95ebdc400dafc2e8a4306419fd52 + # The amount of token to give per request + amount: 1800 + +images: + sequencerFaucet: "ghcr.io/astriaorg/seq-faucet:0.3.0" + +# When deploying in a production environment should use a secret provider +# This is configured for use with GCP, need to set own resource names +# and keys +secretProvider: + enabled: false + provider: gcp + secrets: + # Used in place of config.fundingPrivateKey value when provider enabled + sequencerPrivateKey: + filename: sequencerPrivateKey.txt + resourceName: "projects/$PROJECT_ID/secrets/sequencerPrivateKey/versions/latest" + key: token + +ports: + faucet: 8080 + +ingress: + enabled: true + # For Kubernetes >= 1.18 you should specify the ingress-controller via the field ingressClassName + # See https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#specifying-the-class-of-an-ingress + # ingressClassName: nginx + # Values can be templated + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + labels: {} + path: {} + # pathType is only for k8s >= 1.1= + pathType: Prefix + hosts: {} + # - chart-example.local + service: {} + # name: sequencer-faucet-service + # port: + # name: seq-faucet-svc + defaultBackend: {} + # service: + # name: sequencer-faucet-service + # port: + # name: seq-faucet-svc + ## Extra paths to prepend to every host configuration. This is useful when working with annotation based services. + extraPaths: {} + # - path: /* + # backend: + # serviceName: ssl-redirect + # servicePort: use-annotation + ## Or for k8s > 1.19 + # - path: /* + # pathType: Prefix + # backend: + # service: + # name: ssl-redirect + # port: + # name: use-annotation + tls: {} + # - secretName: chart-example-tls + # hosts: + # - chart-example.local diff --git a/helm/sequencer/.helmignore b/charts/sequencer/.helmignore similarity index 100% rename from helm/sequencer/.helmignore rename to charts/sequencer/.helmignore diff --git a/helm/sequencer/Chart.yaml b/charts/sequencer/Chart.yaml similarity index 88% rename from helm/sequencer/Chart.yaml rename to charts/sequencer/Chart.yaml index 64f1eba3..695a97bb 100644 --- a/helm/sequencer/Chart.yaml +++ b/charts/sequencer/Chart.yaml @@ -15,10 +15,18 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.3.0 +version: 0.3.3 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. appVersion: "0.5.1" + +maintainers: + - name: wafflesvonmaple + url: astria.org + - name: steezeburger + url: astria.org + - name: joroshiba + url: astria.org diff --git a/helm/sequencer/files/cometbft/config/config.toml b/charts/sequencer/files/cometbft/config/config.toml similarity index 100% rename from helm/sequencer/files/cometbft/config/config.toml rename to charts/sequencer/files/cometbft/config/config.toml diff --git a/helm/sequencer/files/cometbft/config/genesis.json b/charts/sequencer/files/cometbft/config/genesis.json similarity index 100% rename from helm/sequencer/files/cometbft/config/genesis.json rename to charts/sequencer/files/cometbft/config/genesis.json diff --git a/helm/sequencer/files/cometbft/config/node_key.json b/charts/sequencer/files/cometbft/config/node_key.json similarity index 100% rename from helm/sequencer/files/cometbft/config/node_key.json rename to charts/sequencer/files/cometbft/config/node_key.json diff --git a/helm/sequencer/files/cometbft/config/priv_validator_key.json b/charts/sequencer/files/cometbft/config/priv_validator_key.json similarity index 100% rename from helm/sequencer/files/cometbft/config/priv_validator_key.json rename to charts/sequencer/files/cometbft/config/priv_validator_key.json diff --git a/helm/sequencer/files/cometbft/data/priv_validator_state.json b/charts/sequencer/files/cometbft/data/priv_validator_state.json similarity index 100% rename from helm/sequencer/files/cometbft/data/priv_validator_state.json rename to charts/sequencer/files/cometbft/data/priv_validator_state.json diff --git a/helm/sequencer/files/scripts/start-relayer.sh b/charts/sequencer/files/scripts/start-relayer.sh similarity index 100% rename from helm/sequencer/files/scripts/start-relayer.sh rename to charts/sequencer/files/scripts/start-relayer.sh diff --git a/charts/sequencer/templates/_helpers.tpl b/charts/sequencer/templates/_helpers.tpl new file mode 100644 index 00000000..d6e21c67 --- /dev/null +++ b/charts/sequencer/templates/_helpers.tpl @@ -0,0 +1,32 @@ +{{/* +Return if ingress is stable. +*/}} +{{- define "sequencer.ingress.isStable" -}} +{{- eq (include "sequencer.ingress.apiVersion" .) "networking.k8s.io/v1" }} +{{- end }} + +{{/* +Return if ingress supports ingressClassName. +*/}} +{{- define "sequencer.ingress.supportsIngressClassName" -}} +{{- or (eq (include "sequencer.ingress.isStable" .) "true") (and (eq (include "sequencer.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) }} +{{- end }} + +{{/* +Return if ingress supports pathType. +*/}} +{{- define "sequencer.ingress.supportsPathType" -}} +{{- or (eq (include "sequencer.ingress.isStable" .) "true") (and (eq (include "sequencer.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) }} +{{- end }} + +Return the appropriate apiVersion for ingress. +*/}} +{{- define "sequencer.ingress.apiVersion" -}} +{{- if and ($.Capabilities.APIVersions.Has "networking.k8s.io/v1") (semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version) }} +{{- print "networking.k8s.io/v1" }} +{{- else if $.Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }} +{{- print "networking.k8s.io/v1beta1" }} +{{- else }} +{{- print "extensions/v1beta1" }} +{{- end }} +{{- end }} diff --git a/helm/sequencer/templates/configmaps.yaml b/charts/sequencer/templates/configmaps.yaml similarity index 100% rename from helm/sequencer/templates/configmaps.yaml rename to charts/sequencer/templates/configmaps.yaml diff --git a/helm/sequencer/templates/deployment.yaml b/charts/sequencer/templates/deployment.yaml similarity index 100% rename from helm/sequencer/templates/deployment.yaml rename to charts/sequencer/templates/deployment.yaml diff --git a/charts/sequencer/templates/ingress.yaml b/charts/sequencer/templates/ingress.yaml new file mode 100644 index 00000000..71297063 --- /dev/null +++ b/charts/sequencer/templates/ingress.yaml @@ -0,0 +1,73 @@ +{{- if .Values.ingress.enabled -}} +{{- $ingressApiIsStable := eq (include "sequencer.ingress.isStable" .) "true" -}} +{{- $ingressSupportsIngressClassName := eq (include "sequencer.ingress.supportsIngressClassName" .) "true" -}} +{{- $ingressSupportsPathType := eq (include "sequencer.ingress.supportsPathType" .) "true" -}} +{{- $servicePort := .Values.ingress.service.port -}} +{{- $serviceName := .Values.ingress.service.name -}} +{{- $ingressPath := .Values.ingress.path -}} +{{- $ingressPathType := .Values.ingress.pathType -}} +{{- $extraPaths := .Values.ingress.extraPaths -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: sequencer-ingress + namespace: {{ .Values.namespace }} + labels: + {{- with .Values.ingress.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.ingress.annotations }} + annotations: + {{- range $key, $value := . }} + {{ $key }}: {{ tpl $value $ | quote }} + {{- end }} + {{- end }} +spec: + {{- if and $ingressSupportsIngressClassName .Values.ingress.ingressClassName }} + ingressClassName: {{ .Values.ingress.ingressClassName }} + {{- end -}} + {{- with .Values.ingress.defaultBackend }} + defaultBackend: + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} + rules: + {{- if .Values.ingress.hosts }} + {{- range .Values.ingress.hosts }} + - host: {{ tpl . $ }} + http: + paths: + {{- with $extraPaths }} + {{- toYaml . | nindent 10 }} + {{- end }} + - path: {{ $ingressPath }} + {{- if $ingressSupportsPathType }} + pathType: {{ $ingressPathType }} + {{- end }} + backend: + {{- if $ingressApiIsStable }} + service: + name: {{ $serviceName }} + port: + number: {{ $servicePort }} + {{- else }} + serviceName: {{ $serviceName }} + servicePort: {{ $servicePort }} + {{- end }} + {{- end }} + {{- with .Values.ingress.tls }} + tls: + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} + {{- else }} + - host: sequencer.localdev.me + http: + paths: + - path: "/" + pathType: Prefix + backend: + service: + name: sequencer-service + port: + name: cometbft-rpc + {{- end -}} +{{- end }} diff --git a/helm/sequencer/templates/service.yaml b/charts/sequencer/templates/service.yaml similarity index 100% rename from helm/sequencer/templates/service.yaml rename to charts/sequencer/templates/service.yaml diff --git a/helm/sequencer/templates/storageclasses.yaml b/charts/sequencer/templates/storageclasses.yaml similarity index 100% rename from helm/sequencer/templates/storageclasses.yaml rename to charts/sequencer/templates/storageclasses.yaml diff --git a/helm/sequencer/templates/volumes.yaml b/charts/sequencer/templates/volumes.yaml similarity index 100% rename from helm/sequencer/templates/volumes.yaml rename to charts/sequencer/templates/volumes.yaml diff --git a/helm/sequencer/values.yaml b/charts/sequencer/values.yaml similarity index 63% rename from helm/sequencer/values.yaml rename to charts/sequencer/values.yaml index 7ce9e088..fdb8f5bf 100644 --- a/helm/sequencer/values.yaml +++ b/charts/sequencer/values.yaml @@ -57,3 +57,46 @@ storage: size: "5Gi" persistentVolumeName: "sequencer-shared-storage" path: "/data/sequencer-data" + +ingress: + enabled: true + # For Kubernetes >= 1.18 you should specify the ingress-controller via the field ingressClassName + # See https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#specifying-the-class-of-an-ingress + # ingressClassName: nginx + # Values can be templated + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + labels: {} + path: {} + # pathType is only for k8s >= 1.1= + pathType: Prefix + hosts: {} + # - chart-example.local + service: {} + # name: sequencer-service + # port: + # name: cometbft-rpc + defaultBackend: {} + # service: + # name: sequencer-service + # port: + # name: cometbft-rpc + ## Extra paths to prepend to every host configuration. This is useful when working with annotation based services. + extraPaths: {} + # - path: /* + # backend: + # serviceName: ssl-redirect + # servicePort: use-annotation + ## Or for k8s > 1.19 + # - path: /* + # pathType: Prefix + # backend: + # service: + # name: ssl-redirect + # port: + # name: use-annotation + tls: {} + # - secretName: chart-example-tls + # hosts: + # - chart-example.local diff --git a/helm/sequencer-faucet/templates/ingress.yaml b/helm/sequencer-faucet/templates/ingress.yaml deleted file mode 100644 index 2fd3943c..00000000 --- a/helm/sequencer-faucet/templates/ingress.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: sequencer-faucet-ingress - namespace: {{ .Values.namespace }} -spec: - rules: - - host: sequencer-faucet.localdev.me - http: - paths: - - path: "/" - pathType: Prefix - backend: - service: - name: sequencer-faucet-service - port: - name: seq-faucet-svc diff --git a/helm/sequencer-faucet/values.yaml b/helm/sequencer-faucet/values.yaml deleted file mode 100644 index 64059e56..00000000 --- a/helm/sequencer-faucet/values.yaml +++ /dev/null @@ -1,32 +0,0 @@ -namespace: "astria-dev-cluster" -replicaCount: 1 - -config: - sequencerRpcUrl: http://sequencer-service:26657 - # This private key will be replaced with `sequencerPrivateKey` when enabled - # For testing purposes only, do not use except with local development cluster, - # it corresponds with the following account: - # address: 00d75b270542084a54fcf0d0f6eab0402982d156 - # pubKey: db617d4ec61726efc4d993488931b37f7774bf04ad916b8f974d33c9241ee762 - fundingPrivateKey: 934ab488f9e1900f6a08f50605ce1409ca9d95ebdc400dafc2e8a4306419fd52 - # The amount of token to give per request - amount: 1800 - -images: - sequencerFaucet: "ghcr.io/astriaorg/seq-faucet:0.3.0" - -# When deploying in a production environment should use a secret provider -# This is configured for use with GCP, need to set own resource names -# and keys -secretProvider: - enabled: false - provider: gcp - secrets: - # Used in place of config.fundingPrivateKey value when provider enabled - sequencerPrivateKey: - filename: sequencerPrivateKey.txt - resourceName: "projects/$PROJECT_ID/secrets/sequencerPrivateKey/versions/latest" - key: token - -ports: - faucet: 8080 diff --git a/helm/sequencer/templates/ingress.yaml b/helm/sequencer/templates/ingress.yaml deleted file mode 100644 index 6942a4d6..00000000 --- a/helm/sequencer/templates/ingress.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: sequencer-ingress - namespace: {{ .Values.namespace }} -spec: - rules: - - host: sequencer.localdev.me - http: - paths: - - path: "/" - pathType: Prefix - backend: - service: - name: sequencer-service - port: - name: cometbft-rpc diff --git a/justfile b/justfile index d469cfb4..9f4dcfa4 100644 --- a/justfile +++ b/justfile @@ -20,14 +20,14 @@ load-image image: kind load docker-image {{image}} --name astria-dev-cluster deploy-chart chart: - helm install --debug {{chart}}-chart ./helm/{{chart}} + helm install --debug {{chart}}-chart ./charts/{{chart}} delete-chart chart: helm uninstall {{chart}}-chart redeploy-chart chart: helm uninstall {{chart}}-chart - helm install --debug {{chart}}-chart ./helm/{{chart}} + helm install --debug {{chart}}-chart ./charts/{{chart}} restart deployment: kubectl rollout restart -n astria-dev-cluster deployment {{deployment}} @@ -48,7 +48,7 @@ deploy-rollup rollupName=defaultRollupName networkId=defaultNetworkId genesisAll {{ if networkId != '' { replace('--set evmNetworkId=#', '#', networkId) } else { '' } }} \ {{ if genesisAllocAddress != '' { replace('--set genesisAllocAddress=#', '#', genesisAllocAddress) } else { '' } }} \ {{ if privateKey != '' { replace('--set privateKey=#', '#', privateKey) } else { '' } }} \ - {{rollupName}}chain-chart-deploy ./helm/rollup + {{rollupName}}chain-chart-deploy ./charts/rollup wait-for-rollup rollupName=defaultRollupName: kubectl wait -n astria-dev-cluster deployment {{rollupName}}-geth --for=condition=Available=True --timeout=600s