diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f8b40c9eb..36cca6815 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -102,7 +102,7 @@ jobs: runs-on: ubuntu-latest needs: test-multiple-go-versions # Until we have developer environments, we don't need the images built on other that main branches. - if: github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'push-image') + if: github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'push-image') || contains(github.event.pull_request.labels.*.name, 'e2e-devnet-test') strategy: matrix: # Build dev & prod images @@ -117,6 +117,8 @@ jobs: - name: Docker Metadata action id: meta uses: docker/metadata-action@v4 + env: + DOCKER_METADATA_PR_HEAD_SHA: "true" with: images: | ghcr.io/pokt-network/pocket-v1 @@ -128,6 +130,7 @@ jobs: type=ref,event=branch${{ matrix.imageType == 'dev' && ',suffix=-dev' || '' }} type=ref,event=pr${{ matrix.imageType == 'dev' && ',suffix=-dev' || '' }} type=sha${{ matrix.imageType == 'dev' && ',suffix=-dev' || '' }} + type=sha,format=long${{ matrix.imageType == 'dev' && ',suffix=-dev' || '' }} type=raw,value=latest,enable={{is_default_branch}}${{ matrix.imageType == 'dev' && ',suffix=-dev' || '' }} - name: Login to GitHub Container Registry uses: docker/login-action@v2 @@ -142,7 +145,7 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} # NB: Uncomment below if arm64 build is needed; arm64 builds are off by default because build times are significant. - platforms: linux/amd64 #,linux/arm64 + platforms: linux/amd64 #,linux/arm64 file: build/Dockerfile.${{ matrix.osType }}.${{ matrix.imageType }} cache-from: type=gha cache-to: type=gha,mode=max diff --git a/build/docs/CHANGELOG.md b/build/docs/CHANGELOG.md index c5c7cf393..5973da9f9 100644 --- a/build/docs/CHANGELOG.md +++ b/build/docs/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.0.36] - 2023-04-19 + +- Changed validator DNS names to match new naming convention (again, helm chart was renamed) +- Changed the way `cluster-manager` looks up the new validators to be staked. + ## [0.0.0.35] - 2023-04-17 - Removed runtime/configs.Config#UseLibp2p field diff --git a/build/localnet/README.md b/build/localnet/README.md index 23fba00e9..02211a3c0 100644 --- a/build/localnet/README.md +++ b/build/localnet/README.md @@ -153,7 +153,7 @@ For example: Configurations can be changed in helm charts where network protocol actor configs are maintained. You can find them in [this directory](../../charts). -`config.json` file is created using the `config` section content in`values.yaml`. For example, you can find the configuration for a validator [here](../../charts/pocket-validator/values.yaml#70). +`config.json` file is created using the `config` section content in `values.yaml`. For example, you can find the configuration for a validator [here](../../charts/pocket/values.yaml#70). If you need to add a new parameter – feel free to modify the section in place. Some of the parameters that contain secrets (e.g. private key), are stored in Secrets object and injected as environment variables. diff --git a/build/localnet/Tiltfile b/build/localnet/Tiltfile index 057025dac..052b8cf19 100644 --- a/build/localnet/Tiltfile +++ b/build/localnet/Tiltfile @@ -159,15 +159,16 @@ k8s_resource('pocket-v1-cli-client', labels=['client']) k8s_yaml(['manifests/cluster-manager.yaml']) k8s_resource('pocket-v1-cluster-manager', labels=['cluster-manager']) -check_helm_dependencies_for_chart(root_dir + "/charts/pocket-validator") +check_helm_dependencies_for_chart(root_dir + "/charts/pocket") for x in range(localnet_config["validators"]["count"]): validator_number = x + 1 formatted_validator_number = local('printf "%03d" ' + str(validator_number)) - k8s_yaml(helm(root_dir + "/charts/pocket-validator", + k8s_yaml(helm(root_dir + "/charts/pocket", name="validator-%s" % formatted_validator_number, namespace="default", set=[ + "global.postgresql.auth.postgresPassword=LocalNetPassword", "image.repository=validator-image", "privateKeySecretKeyRef.name=v1-localnet-validators-private-keys", "privateKeySecretKeyRef.key=%s" % formatted_validator_number, diff --git a/build/localnet/cluster-manager/main.go b/build/localnet/cluster-manager/main.go index f0874781b..e2c06589d 100644 --- a/build/localnet/cluster-manager/main.go +++ b/build/localnet/cluster-manager/main.go @@ -20,6 +20,7 @@ import ( ) const cliPath = "/usr/local/bin/client" +const validatorServiceUrlFormat = "validator-%s-pocket:%d" var ( rpcURL string @@ -33,7 +34,7 @@ var ( ) func init() { - rpcURL = fmt.Sprintf("http://%s:%s", runtime.GetEnv("RPC_HOST", "v1-validator001"), defaults.DefaultRPCPort) + rpcURL = fmt.Sprintf("http://%s:%s", runtime.GetEnv("RPC_HOST", defaults.Validator1EndpointK8S), defaults.DefaultRPCPort) } func main() { @@ -77,7 +78,7 @@ func main() { continue } - validatorServiceUrl := fmt.Sprintf("v1-validator%s:%d", validatorId, defaults.DefaultP2PPort) + validatorServiceUrl := fmt.Sprintf(validatorServiceUrlFormat, validatorId, defaults.DefaultP2PPort) if err := stakeValidator(privateKey, autoStakeAmount, autoStakeChains, validatorServiceUrl); err != nil { logger.Err(err).Msg("Error staking validator") } diff --git a/build/localnet/cluster-manager/utils.go b/build/localnet/cluster-manager/utils.go index 251b76bec..3c44d1952 100644 --- a/build/localnet/cluster-manager/utils.go +++ b/build/localnet/cluster-manager/utils.go @@ -1,20 +1,23 @@ package main import ( + "regexp" + cryptoPocket "github.com/pokt-network/pocket/shared/crypto" v1 "k8s.io/api/core/v1" ) func isValidator(service *v1.Service) bool { - return service.Labels["v1-purpose"] == "validator" + return service.Labels["pokt.network/purpose"] == "validator" } -// extractValidatorId extracts the validator id from the validator name (e.g. v1-validator001 -> 001) +// extractValidatorId extracts the validator id from the validator name (e.g. validator-001-pocket -> 001) // -// it follows the pattern defined in the v1-validator template (/build/localnet/templates/v1-validator-template.yaml.tpl) +// it follows the pattern defined in the pocket helm chart. func extractValidatorId(validatorName string) string { if len(validatorName) >= 3 { - return validatorName[len(validatorName)-3:] + re := regexp.MustCompile(`validator-(\d+)-pocket`) + return re.FindStringSubmatch(validatorName)[1] } return validatorName } diff --git a/build/localnet/manifests/cli-client.yaml b/build/localnet/manifests/cli-client.yaml index d797f3db7..69ed252b2 100644 --- a/build/localnet/manifests/cli-client.yaml +++ b/build/localnet/manifests/cli-client.yaml @@ -17,13 +17,13 @@ spec: spec: serviceAccountName: debug-client-account initContainers: - - name: wait-for-validator-001-pocket-validator + - name: wait-for-validator-001-pocket image: busybox command: [ "sh", "-c", - 'until wget -q -O - "http://validator-001-pocket-validator:50832/v1/health" --timeout=2 --tries=2 --spider >/dev/null 2>&1; do echo waiting for validator-001-pocket-validator to be online and healthy...; sleep 2; done;', + 'until wget -q -O - "http://validator-001-pocket:50832/v1/health" --timeout=2 --tries=2 --spider >/dev/null 2>&1; do echo waiting for validator-001-pocket to be online and healthy...; sleep 2; done;', ] containers: - name: pocket @@ -91,7 +91,7 @@ spec: volumes: - name: config-volume configMap: - name: validator-001-pocket-validator-config + name: validator-001-pocket-config defaultMode: 420 - name: genesis-volume configMap: diff --git a/build/localnet/manifests/cluster-manager.yaml b/build/localnet/manifests/cluster-manager.yaml index e600fdd38..f84e97656 100644 --- a/build/localnet/manifests/cluster-manager.yaml +++ b/build/localnet/manifests/cluster-manager.yaml @@ -4,13 +4,13 @@ metadata: name: pocket-v1-cluster-manager spec: initContainers: - - name: wait-for-validator-001-pocket-validator + - name: wait-for-validator-001-pocket image: busybox command: [ "sh", "-c", - 'until wget -q -O - "http://validator-001-pocket-validator:50832/v1/health" --timeout=2 --tries=2 --spider >/dev/null 2>&1; do echo waiting for validator-001-pocket-validator to be online and healthy...; sleep 2; done;', + 'until wget -q -O - "http://validator-001-pocket:50832/v1/health" --timeout=2 --tries=2 --spider >/dev/null 2>&1; do echo waiting for validator-001-pocket to be online and healthy...; sleep 2; done;', ] containers: - name: cluster-manager diff --git a/build/localnet/manifests/configs.yaml b/build/localnet/manifests/configs.yaml index f99bd29d1..0b781ea88 100644 --- a/build/localnet/manifests/configs.yaml +++ b/build/localnet/manifests/configs.yaml @@ -4044,7 +4044,7 @@ data: "address": "00104055c00bed7c983a48aac7dc6335d7c607a7", "public_key": "dfe357de55649e6d2ce889acf15eb77e94ab3c5756fe46d3c7538d37f27f115e", "chains": null, - "service_url": "validator-001-pocket-validator:42069", + "service_url": "validator-001-pocket:42069", "staked_amount": "1000000000000", "paused_height": -1, "unstaking_height": -1, @@ -4055,7 +4055,7 @@ data: "address": "00204737d2a165ebe4be3a7d5b0af905b0ea91d8", "public_key": "eb2c78364525a210d994a83e02d18b4287ab81f6670cf4510ab6c9f51e296d91", "chains": null, - "service_url": "validator-002-pocket-validator:42069", + "service_url": "validator-002-pocket:42069", "staked_amount": "1000000000000", "paused_height": -1, "unstaking_height": -1, @@ -4066,7 +4066,7 @@ data: "address": "00304d0101847b37fd62e7bebfbdddecdbb7133e", "public_key": "1041a9c76539791fef9bee5b4fcd5bf4a1a489e0790c44cbdfa776b901e13b50", "chains": null, - "service_url": "validator-003-pocket-validator:42069", + "service_url": "validator-003-pocket:42069", "staked_amount": "1000000000000", "paused_height": -1, "unstaking_height": -1, @@ -4077,7 +4077,7 @@ data: "address": "00404a570febd061274f72b50d0a37f611dfe339", "public_key": "d6cea8706f6ee6672c1e013e667ec8c46231e0e7abcf97ba35d89fceb8edae45", "chains": null, - "service_url": "validator-004-pocket-validator:42069", + "service_url": "validator-004-pocket:42069", "staked_amount": "1000000000000", "paused_height": -1, "unstaking_height": -1, @@ -4102,7 +4102,7 @@ data: "address": "43d9ea9d9ad9c58bb96ec41340f83cb2cabb6496", "public_key": "16cd0a304c38d76271f74dd3c90325144425d904ef1b9a6fbab9b201d75a998b", "chains": ["0001"], - "service_url": "validator-001-pocket-validator:42069", + "service_url": "validator-001-pocket:42069", "staked_amount": "1000000000000", "paused_height": -1, "unstaking_height": -1, @@ -4115,7 +4115,7 @@ data: "address": "9ba047197ec043665ad3f81278ab1f5d3eaf6b8b", "public_key": "68efd26af01692fcd77dc135ca1de69ede464e8243e6832bd6c37f282db8c9cb", "chains": ["0001"], - "service_url": "validator-001-pocket-validator:42069", + "service_url": "validator-001-pocket:42069", "staked_amount": "1000000000000", "paused_height": -1, "unstaking_height": -1, diff --git a/charts/CHANGELOG.md b/charts/CHANGELOG.md index fc778139f..757a7bbe1 100644 --- a/charts/CHANGELOG.md +++ b/charts/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.0.3] - 2023-04-19 + +- Rename `pocket-validator` to `pocket`, as we are not going to ship different artifacts, but will have just one. + ## [0.0.0.2] - 2023-04-17 - Removed `runtime/configs.Config#UseLibp2p` field diff --git a/charts/pocket-validator/.helmignore b/charts/pocket/.helmignore similarity index 100% rename from charts/pocket-validator/.helmignore rename to charts/pocket/.helmignore diff --git a/charts/pocket-validator/Chart.lock b/charts/pocket/Chart.lock similarity index 100% rename from charts/pocket-validator/Chart.lock rename to charts/pocket/Chart.lock diff --git a/charts/pocket-validator/Chart.yaml b/charts/pocket/Chart.yaml similarity index 98% rename from charts/pocket-validator/Chart.yaml rename to charts/pocket/Chart.yaml index 8cab57eaa..c97417d2d 100644 --- a/charts/pocket-validator/Chart.yaml +++ b/charts/pocket/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -name: pocket-validator +name: pocket description: Validator for Pocket Network - decentralized blockchain infrastructure home: https://pokt.network sources: diff --git a/charts/pocket-validator/README.md b/charts/pocket/README.md similarity index 99% rename from charts/pocket-validator/README.md rename to charts/pocket/README.md index db8b813d2..5261fd67a 100644 --- a/charts/pocket-validator/README.md +++ b/charts/pocket/README.md @@ -4,7 +4,7 @@ -# pocket-validator +# pocket Validator for Pocket Network - decentralized blockchain infrastructure @@ -118,6 +118,7 @@ privateKeySecretKeyRef: | resources | object | `{}` | resources limits and requests | | securityContext | object | `{}` | | | service.annotations | object | `{}` | service annotations | +| service.nameOverride | string | `""` | | | service.ports.consensus | int | `42069` | consensus port of the node | | service.ports.metrics | int | `9000` | OpenTelemetry metrics port of the node | | service.ports.rpc | int | `50832` | rpc port of the node | diff --git a/charts/pocket-validator/README.md.gotmpl b/charts/pocket/README.md.gotmpl similarity index 100% rename from charts/pocket-validator/README.md.gotmpl rename to charts/pocket/README.md.gotmpl diff --git a/charts/pocket-validator/templates/_helpers.tpl b/charts/pocket/templates/_helpers.tpl similarity index 77% rename from charts/pocket-validator/templates/_helpers.tpl rename to charts/pocket/templates/_helpers.tpl index 40ce3d20e..51e6cfc36 100644 --- a/charts/pocket-validator/templates/_helpers.tpl +++ b/charts/pocket/templates/_helpers.tpl @@ -1,7 +1,7 @@ {{/* Expand the name of the chart. */}} -{{- define "pocket-validator.name" -}} +{{- define "pocket.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} @@ -10,7 +10,7 @@ Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). If release name contains chart name it will be used as a full name. */}} -{{- define "pocket-validator.fullname" -}} +{{- define "pocket.fullname" -}} {{- if .Values.fullnameOverride }} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} @@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name. {{/* Create chart name and version as used by the chart label. */}} -{{- define "pocket-validator.chart" -}} +{{- define "pocket.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels */}} -{{- define "pocket-validator.labels" -}} -helm.sh/chart: {{ include "pocket-validator.chart" . }} -{{ include "pocket-validator.selectorLabels" . }} +{{- define "pocket.labels" -}} +helm.sh/chart: {{ include "pocket.chart" . }} +{{ include "pocket.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} @@ -45,8 +45,8 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{/* Selector labels */}} -{{- define "pocket-validator.selectorLabels" -}} -app.kubernetes.io/name: {{ include "pocket-validator.name" . }} +{{- define "pocket.selectorLabels" -}} +app.kubernetes.io/name: {{ include "pocket.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} pokt.network/purpose: validator {{- end }} @@ -54,9 +54,9 @@ pokt.network/purpose: validator {{/* Create the name of the service account to use */}} -{{- define "pocket-validator.serviceAccountName" -}} +{{- define "pocket.serviceAccountName" -}} {{- if .Values.serviceAccount.create }} -{{- default (include "pocket-validator.fullname" .) .Values.serviceAccount.name }} +{{- default (include "pocket.fullname" .) .Values.serviceAccount.name }} {{- else }} {{- default "default" .Values.serviceAccount.name }} {{- end }} @@ -65,7 +65,7 @@ Create the name of the service account to use {{/* Determine the PostgreSQL hostname based on whether the subchart is enabled. */}} -{{- define "pocket-validator.postgresqlHost" -}} +{{- define "pocket.postgresqlHost" -}} {{- if .Values.postgresql.enabled -}} {{- printf "%s-%s" .Release.Name "postgresql" -}} {{- else -}} @@ -76,7 +76,7 @@ Determine the PostgreSQL hostname based on whether the subchart is enabled. {{/* Determine the PostgreSQL port based on whether the subchart is enabled. */}} -{{- define "pocket-validator.postgresqlPort" -}} +{{- define "pocket.postgresqlPort" -}} {{- if .Values.postgresql.enabled -}} {{- .Values.global.postgresql.service.ports.postgresql | toString -}} {{- else -}} @@ -87,7 +87,7 @@ Determine the PostgreSQL port based on whether the subchart is enabled. {{/* Determine the PostgreSQL schema based on whether the subchart is enabled. */}} -{{- define "pocket-validator.postgresqlDatabase" -}} +{{- define "pocket.postgresqlDatabase" -}} {{- if .Values.postgresql.enabled -}} {{- "postgres" -}} {{- else -}} @@ -98,14 +98,14 @@ Determine the PostgreSQL schema based on whether the subchart is enabled. {{/* Determine the PostgreSQL schema based on whether the subchart is enabled. */}} -{{- define "pocket-validator.postgresqlSchema" -}} +{{- define "pocket.postgresqlSchema" -}} {{- .Values.config.persistence.node_schema -}} {{- end -}} {{/* Determine the PostgreSQL user SecretKeyRef based on whether the subchart is enabled. */}} -{{- define "pocket-validator.postgresqlUserValueOrSecretRef" -}} +{{- define "pocket.postgresqlUserValueOrSecretRef" -}} {{- if .Values.postgresql.enabled -}} value: postgres {{- else -}} @@ -119,7 +119,7 @@ valueFrom: {{/* Determine the PostgreSQL password SecretKeyRef based on whether the subchart is enabled. */}} -{{- define "pocket-validator.postgresqlPasswordSecretKeyRef" -}} +{{- define "pocket.postgresqlPasswordSecretKeyRef" -}} {{- if .Values.postgresql.enabled -}} valueFrom: secretKeyRef: @@ -136,9 +136,9 @@ valueFrom: {{/* Determine the genesis ConfigMap based on whether pre-provisioned genesis is enabled. */}} -{{- define "pocket-validator.genesisConfigMap" -}} +{{- define "pocket.genesisConfigMap" -}} {{- if .Values.genesis.preProvisionedGenesis.enabled -}} -{{- printf "%s-%s" (include "pocket-validator.fullname" .) "genesis" -}} +{{- printf "%s-%s" (include "pocket.fullname" .) "genesis" -}} {{- else -}} {{- .Values.genesis.externalConfigMap.name -}} {{- end -}} diff --git a/charts/pocket-validator/templates/configmap-config.yaml b/charts/pocket/templates/configmap-config.yaml similarity index 51% rename from charts/pocket-validator/templates/configmap-config.yaml rename to charts/pocket/templates/configmap-config.yaml index 4225d3189..15efb1e55 100644 --- a/charts/pocket-validator/templates/configmap-config.yaml +++ b/charts/pocket/templates/configmap-config.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ include "pocket-validator.fullname" . }}-config + name: {{ include "pocket.fullname" . }}-config labels: - {{- include "pocket-validator.labels" . | nindent 4 }} + {{- include "pocket.labels" . | nindent 4 }} data: config.json: | {{ .Values.config | toPrettyJson | nindent 4 }} diff --git a/charts/pocket-validator/templates/configmap-genesis.yaml b/charts/pocket/templates/configmap-genesis.yaml similarity index 78% rename from charts/pocket-validator/templates/configmap-genesis.yaml rename to charts/pocket/templates/configmap-genesis.yaml index eeacae163..460f1436b 100644 --- a/charts/pocket-validator/templates/configmap-genesis.yaml +++ b/charts/pocket/templates/configmap-genesis.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ include "pocket-validator.fullname" . }}-genesis + name: {{ include "pocket.fullname" . }}-genesis labels: - {{- include "pocket-validator.labels" . | nindent 4 }} + {{- include "pocket.labels" . | nindent 4 }} data: {{- if eq .Values.genesis.preProvisionedGenesis.type "devnet" }} genesis.json: | diff --git a/charts/pocket-validator/templates/ingress.yaml b/charts/pocket/templates/ingress.yaml similarity index 94% rename from charts/pocket-validator/templates/ingress.yaml rename to charts/pocket/templates/ingress.yaml index 9962cef9f..191d3d190 100644 --- a/charts/pocket-validator/templates/ingress.yaml +++ b/charts/pocket/templates/ingress.yaml @@ -1,5 +1,5 @@ {{- if .Values.ingress.enabled -}} -{{- $fullName := include "pocket-validator.fullname" . -}} +{{- $fullName := include "pocket.fullname" . -}} {{- $svcPort := .Values.service.ports.rpc -}} {{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} @@ -17,7 +17,7 @@ kind: Ingress metadata: name: {{ $fullName }}-rpc labels: - {{- include "pocket-validator.labels" . | nindent 4 }} + {{- include "pocket.labels" . | nindent 4 }} {{- with .Values.ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/charts/pocket-validator/templates/pvc.yaml b/charts/pocket/templates/pvc.yaml similarity index 70% rename from charts/pocket-validator/templates/pvc.yaml rename to charts/pocket/templates/pvc.yaml index 2a99e381f..0ac7dd8cb 100644 --- a/charts/pocket-validator/templates/pvc.yaml +++ b/charts/pocket/templates/pvc.yaml @@ -2,9 +2,9 @@ kind: PersistentVolumeClaim apiVersion: v1 metadata: - name: {{ include "pocket-validator.fullname" . }}-data + name: {{ include "pocket.fullname" . }}-data labels: - {{- include "pocket-validator.labels" . | nindent 4 }} + {{- include "pocket.labels" . | nindent 4 }} {{- with .Values.persistence.annotations }} annotations: {{- toYaml . | nindent 4 }} @@ -26,9 +26,6 @@ spec: {{- toYaml . | nindent 4 }} {{- end }} {{- if .Values.persistence.storageClass }} - storageClass: {{ .Values.persistence.storageClass | quote }} - {{ else }} - storageClass: "" + storageClassName: {{ .Values.persistence.storageClass | quote }} {{- end }} - persistentVolumeReclaimPolicy: {{ .Values.persistence.reclaimPolicy | quote }} {{- end -}} diff --git a/charts/pocket-validator/templates/service.yaml b/charts/pocket/templates/service.yaml similarity index 63% rename from charts/pocket-validator/templates/service.yaml rename to charts/pocket/templates/service.yaml index 71ea5c516..0ba6711a4 100644 --- a/charts/pocket-validator/templates/service.yaml +++ b/charts/pocket/templates/service.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "pocket-validator.fullname" . }} + name: {{ if .Values.service.nameOverride }}{{ .Values.service.nameOverride }}{{ else }}{{ include "pocket.fullname" . }}{{ end }} labels: - {{- include "pocket-validator.labels" . | nindent 4 }} + {{- include "pocket.labels" . | nindent 4 }} {{- with .Values.service.annotations }} annotations: {{- toYaml . | nindent 4 }} @@ -18,4 +18,4 @@ spec: - port: {{ .Values.service.ports.metrics }} name: metrics selector: - {{- include "pocket-validator.selectorLabels" . | nindent 4 }} + {{- include "pocket.selectorLabels" . | nindent 4 }} diff --git a/charts/pocket-validator/templates/serviceaccount.yaml b/charts/pocket/templates/serviceaccount.yaml similarity index 64% rename from charts/pocket-validator/templates/serviceaccount.yaml rename to charts/pocket/templates/serviceaccount.yaml index 5456bd57b..254860167 100644 --- a/charts/pocket-validator/templates/serviceaccount.yaml +++ b/charts/pocket/templates/serviceaccount.yaml @@ -2,9 +2,9 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: {{ include "pocket-validator.serviceAccountName" . }} + name: {{ include "pocket.serviceAccountName" . }} labels: - {{- include "pocket-validator.labels" . | nindent 4 }} + {{- include "pocket.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/charts/pocket-validator/templates/statefulset.yaml b/charts/pocket/templates/statefulset.yaml similarity index 77% rename from charts/pocket-validator/templates/statefulset.yaml rename to charts/pocket/templates/statefulset.yaml index 108975ef9..0452b8433 100644 --- a/charts/pocket-validator/templates/statefulset.yaml +++ b/charts/pocket/templates/statefulset.yaml @@ -1,14 +1,18 @@ apiVersion: apps/v1 kind: StatefulSet metadata: - name: {{ include "pocket-validator.fullname" . }} + name: {{ include "pocket.fullname" . }} + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} labels: - {{- include "pocket-validator.labels" . | nindent 4 }} + {{- include "pocket.labels" . | nindent 4 }} spec: replicas: 1 # One StatefulSet = 1 validator selector: matchLabels: - {{- include "pocket-validator.selectorLabels" . | nindent 6 }} + {{- include "pocket.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} @@ -16,13 +20,13 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "pocket-validator.selectorLabels" . | nindent 8 }} + {{- include "pocket.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "pocket-validator.serviceAccountName" . }} + serviceAccountName: {{ include "pocket.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} initContainers: @@ -40,11 +44,11 @@ spec: fieldRef: fieldPath: status.podIP - name: POSTGRES_HOST - value: {{ include "pocket-validator.postgresqlHost" . }} + value: {{ include "pocket.postgresqlHost" . }} - name: POSTGRES_PORT - value: {{ include "pocket-validator.postgresqlPort" . | quote }} + value: {{ include "pocket.postgresqlPort" . | quote }} containers: - - name: pocket-validator + - name: pocket securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" @@ -75,19 +79,19 @@ spec: name: {{ .Values.privateKeySecretKeyRef.name }} key: {{ .Values.privateKeySecretKeyRef.key | quote }} - name: POSTGRES_USER - {{ include "pocket-validator.postgresqlUserValueOrSecretRef" . | nindent 14 }} + {{ include "pocket.postgresqlUserValueOrSecretRef" . | nindent 14 }} - name: POSTGRES_PASSWORD - {{ include "pocket-validator.postgresqlPasswordSecretKeyRef" . | nindent 14 }} + {{ include "pocket.postgresqlPasswordSecretKeyRef" . | nindent 14 }} - name: POSTGRES_HOST - value: {{ include "pocket-validator.postgresqlHost" . }} + value: {{ include "pocket.postgresqlHost" . }} - name: POSTGRES_PORT - value: {{ include "pocket-validator.postgresqlPort" . | quote }} + value: {{ include "pocket.postgresqlPort" . | quote }} - name: POSTGRES_DB - value: {{ include "pocket-validator.postgresqlDatabase" . }} + value: {{ include "pocket.postgresqlDatabase" . }} - name: POCKET_PERSISTENCE_POSTGRES_URL value: "postgres://$(POSTGRES_USER):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT)/$(POSTGRES_DB)" - name: POCKET_PERSISTENCE_NODE_SCHEMA - value: {{ include "pocket-validator.postgresqlSchema" . }} + value: {{ include "pocket.postgresqlSchema" . }} - name: POCKET_P2P_HOSTNAME valueFrom: fieldRef: @@ -126,14 +130,14 @@ spec: volumes: - name: config-volume configMap: - name: {{ include "pocket-validator.fullname" . }}-config + name: {{ include "pocket.fullname" . }}-config - name: genesis-volume configMap: - name: {{ include "pocket-validator.genesisConfigMap" . }} + name: {{ include "pocket.genesisConfigMap" . }} - name: validator-storage {{- if .Values.persistence.enabled }} persistentVolumeClaim: - claimName: {{ default (printf "%s-%s" (include "pocket-validator.fullname" .) "data") .Values.persistence.existingClaim }} + claimName: {{ default (printf "%s-%s" (include "pocket.fullname" .) "data") .Values.persistence.existingClaim }} {{- else }} emptyDir: {} {{- end }} diff --git a/charts/pocket-validator/values.yaml b/charts/pocket/values.yaml similarity index 99% rename from charts/pocket-validator/values.yaml rename to charts/pocket/values.yaml index 7ae121492..c443e4e39 100644 --- a/charts/pocket-validator/values.yaml +++ b/charts/pocket/values.yaml @@ -162,6 +162,7 @@ securityContext: # runAsUser: 1000 service: + nameOverride: "" # -- service annotations annotations: {} # -- service type diff --git a/e2e/docs/CHANGELOG.md b/e2e/docs/CHANGELOG.md index 53124a118..841d94458 100644 --- a/e2e/docs/CHANGELOG.md +++ b/e2e/docs/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.0.4] - 2023-04-19 + +- Changed validator DNS names to match new naming convention (again, helm chart was renamed) + ## [0.0.0.3] - 2023-04-14 - Changed validator DNS names to match new naming convention diff --git a/e2e/tests/steps_init_test.go b/e2e/tests/steps_init_test.go index 12c94be1a..8badb06ae 100644 --- a/e2e/tests/steps_init_test.go +++ b/e2e/tests/steps_init_test.go @@ -35,7 +35,7 @@ var ( const ( // defines the host & port scheme that LocalNet uses for naming validators. // e.g. validator-001 thru validator-999 - validatorServiceURLTmpl = "validator-%s-pocket-validator:%d" + validatorServiceURLTmpl = "validator-%s-pocket:%d" // validatorA maps to suffix ID 001 and is also used by the cluster-manager // though it has no special permissions. validatorA = "001" diff --git a/runtime/defaults/defaults.go b/runtime/defaults/defaults.go index dea12c7fd..46bd9e4c1 100644 --- a/runtime/defaults/defaults.go +++ b/runtime/defaults/defaults.go @@ -27,7 +27,7 @@ const ( DefaultBusBufferSize = 100 DefaultRPCHost = "localhost" Validator1EndpointDockerCompose = "node1.consensus" - Validator1EndpointK8S = "v1-validator001" + Validator1EndpointK8S = "validator-001-pocket" ) var ( diff --git a/runtime/docs/CHANGELOG.md b/runtime/docs/CHANGELOG.md index 662cd6c21..9eee6f9db 100644 --- a/runtime/docs/CHANGELOG.md +++ b/runtime/docs/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.0.34] - 2023-04-19 + +- Changed `Validator1EndpointK8S` which now reflects the new value. + ## [0.0.0.33] - 2023-04-17 - Removed `runtime/configs.Config#UseLibp2p` field