From 78eeec25da6367e82f5c6df7886a763395455290 Mon Sep 17 00:00:00 2001 From: Wesley Charles Blake Date: Thu, 3 Nov 2022 15:10:35 +0200 Subject: [PATCH] [T-14416]: portal typescript chart (#61) * [T-14416]: fleshing out initial helm chart for portal * [T-144616]: add env file config * [T-14416]: some minor tweaks * [T-14416]: reference central dockerhub image * [T-14416]: more tweaks to chart with ext secrets config * [T-14416]: fix chart-test helm repos for influxdb2 * [T-14416]: default values * [T-14416]: more tweaks to get the base chart passing * [T-14416]: disable redis and influx and mongo default * fix chart deps * fix linting issues * get default vars working * adds in mongodb, influx and redis * change influx subchart params to work correctly * updated chart lockfile * adds pre-commit * remove yammlint from precommit for now closes T-14416 --- .gitignore | 1 + .pre-commit-config.yaml | 8 + charts/pokt-portal/.helmignore | 23 ++ charts/pokt-portal/Chart.lock | 12 + charts/pokt-portal/Chart.yaml | 59 +++++ charts/pokt-portal/templates/NOTES.txt | 22 ++ charts/pokt-portal/templates/_helpers.tpl | 82 +++++++ charts/pokt-portal/templates/deployment.yaml | 74 ++++++ .../templates/external-secret.yaml | 19 ++ charts/pokt-portal/templates/hpa.yaml | 28 +++ charts/pokt-portal/templates/ingress.yaml | 61 +++++ .../pokt-portal/templates/secret-store.yaml | 22 ++ charts/pokt-portal/templates/secret.yaml | 16 ++ charts/pokt-portal/templates/service.yaml | 15 ++ .../pokt-portal/templates/serviceaccount.yaml | 12 + .../templates/tests/test-connection.yaml | 15 ++ charts/pokt-portal/values.yaml | 214 ++++++++++++++++++ ct.yaml | 3 +- 18 files changed, 685 insertions(+), 1 deletion(-) create mode 100644 .pre-commit-config.yaml create mode 100644 charts/pokt-portal/.helmignore create mode 100644 charts/pokt-portal/Chart.lock create mode 100644 charts/pokt-portal/Chart.yaml create mode 100644 charts/pokt-portal/templates/NOTES.txt create mode 100644 charts/pokt-portal/templates/_helpers.tpl create mode 100644 charts/pokt-portal/templates/deployment.yaml create mode 100644 charts/pokt-portal/templates/external-secret.yaml create mode 100644 charts/pokt-portal/templates/hpa.yaml create mode 100644 charts/pokt-portal/templates/ingress.yaml create mode 100644 charts/pokt-portal/templates/secret-store.yaml create mode 100644 charts/pokt-portal/templates/secret.yaml create mode 100644 charts/pokt-portal/templates/service.yaml create mode 100644 charts/pokt-portal/templates/serviceaccount.yaml create mode 100644 charts/pokt-portal/templates/tests/test-connection.yaml create mode 100644 charts/pokt-portal/values.yaml diff --git a/.gitignore b/.gitignore index ebc921f..77a133c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ docker-secret.yaml .idea +.DS_Store diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..ae97ec8 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,8 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.2.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + # - id: check-yaml + - id: check-added-large-files diff --git a/charts/pokt-portal/.helmignore b/charts/pokt-portal/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/pokt-portal/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/pokt-portal/Chart.lock b/charts/pokt-portal/Chart.lock new file mode 100644 index 0000000..985c224 --- /dev/null +++ b/charts/pokt-portal/Chart.lock @@ -0,0 +1,12 @@ +dependencies: +- name: redis + repository: https://charts.bitnami.com/bitnami + version: 17.3.7 +- name: influxdb2 + repository: https://helm.influxdata.com/ + version: 2.1.1 +- name: mongodb + repository: https://charts.bitnami.com/bitnami + version: 13.3.0 +digest: sha256:645a760a28f1fda2b3e7903022b77f115053ba78101b8ec785ff14d02a2d2aa5 +generated: "2022-11-02T19:46:44.046796+02:00" diff --git a/charts/pokt-portal/Chart.yaml b/charts/pokt-portal/Chart.yaml new file mode 100644 index 0000000..618b7fb --- /dev/null +++ b/charts/pokt-portal/Chart.yaml @@ -0,0 +1,59 @@ +apiVersion: v2 +name: pokt-portal +description: A Helm chart for deploying the POKT Portal API services +maintainers: + - name: WesleyCharlesBlake + url: https://github.com/WesleyCharlesBlake/ + - name: pokt-foundation + url: https://github.com/pokt-foundation/charts + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +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.0.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: "0.0.1" + +dependencies: +- name: redis + version: "17.3.7" + repository: "https://charts.bitnami.com/bitnami" + condition: redis.enabled +- name: influxdb2 + version: "2.1.1" + repository: "https://helm.influxdata.com/" + condition: influxdb2.enabled +- name: mongodb + version: "13.3.0" + repository: "https://charts.bitnami.com/bitnami" + condition: mongodb.enabled +# - name: pokt-relay-meter +# version: "0.0.1" +# repository: "https://pokt-foundation.github.io/charts" +# condition: relayMeter.enabled +# - name: pokt-rate-limiter +# version: "0.0.1" +# repository: "https://pokt-foundation.github.io/charts" +# condition: rateLimiter.enabled +# - name: pokt-portal-workers +# version: "0.0.1" +# repository: "https://pokt-foundation.github.io/charts" +# condition: workers.enabled +# - name: pokt-go-mev-proxy +# version: "0.0.1" +# repository: "https://pokt-foundation.github.io/charts" +# condition: goMevProxy.enabled diff --git a/charts/pokt-portal/templates/NOTES.txt b/charts/pokt-portal/templates/NOTES.txt new file mode 100644 index 0000000..b6cde66 --- /dev/null +++ b/charts/pokt-portal/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "pokt-portal.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "pokt-portal.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "pokt-portal.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "pokt-portal.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/charts/pokt-portal/templates/_helpers.tpl b/charts/pokt-portal/templates/_helpers.tpl new file mode 100644 index 0000000..13c6c8f --- /dev/null +++ b/charts/pokt-portal/templates/_helpers.tpl @@ -0,0 +1,82 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "pokt-portal.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +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 "pokt-portal.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "pokt-portal.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "pokt-portal.labels" -}} +helm.sh/chart: {{ include "pokt-portal.chart" . }} +{{ include "pokt-portal.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "pokt-portal.selectorLabels" -}} +app.kubernetes.io/name: {{ include "pokt-portal.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "pokt-portal.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "pokt-portal.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +{{/* +Create env vars from a values.env +*/}} + + +{{- define "helpers.list-env-variables"}} +{{- $secretName := printf "%s-vars" .Release.Name -}} +{{- range $key, $val := .Values.env.secret }} +- name: {{ $key }} + valueFrom: + secretKeyRef: + name: {{ $secretName }} + key: {{ $key }} +{{- end}} +{{- range $key, $val := .Values.env.normal }} +- name: {{ $key }} + value: {{ $val | quote }} +{{- end}} +{{- end }} diff --git a/charts/pokt-portal/templates/deployment.yaml b/charts/pokt-portal/templates/deployment.yaml new file mode 100644 index 0000000..8dd2a0b --- /dev/null +++ b/charts/pokt-portal/templates/deployment.yaml @@ -0,0 +1,74 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "pokt-portal.fullname" . }} + labels: + {{- include "pokt-portal.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "pokt-portal.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "pokt-portal.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "pokt-portal.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + command: ["npm", "run", "start"] + ports: + - name: http + containerPort: {{ .Values.service.port }} + protocol: TCP + {{- if .Values.probes.enabled }} + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + {{- end }} + env: + {{- if not .Values.externalSecrets.enabled }} + {{- include "helpers.list-env-variables" . | indent 12 }} + {{- end }} + {{- if .Values.externalSecrets.enabled }} + envFrom: + - secretRef: + name: {{ include "pokt-portal.fullname" . }}-es + {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/pokt-portal/templates/external-secret.yaml b/charts/pokt-portal/templates/external-secret.yaml new file mode 100644 index 0000000..a15ed66 --- /dev/null +++ b/charts/pokt-portal/templates/external-secret.yaml @@ -0,0 +1,19 @@ +{{- if .Values.externalSecrets.enabled -}} +kind: ExternalSecret +apiVersion: external-secrets.io/v1beta1 +metadata: + name: {{ include "pokt-portal.fullname" . }} +spec: + refreshInterval: "60s" + secretStoreRef: + name: {{ include "pokt-portal.fullname" . }}-ss + kind: SecretStore + target: + name: {{ include "pokt-portal.fullname" . }}-es + deletionPolicy: "Delete" + + dataFrom: + - extract: + key: {{ .Values.externalSecrets.key}} + decodingStrategy: Auto +{{- end -}} diff --git a/charts/pokt-portal/templates/hpa.yaml b/charts/pokt-portal/templates/hpa.yaml new file mode 100644 index 0000000..bb88db5 --- /dev/null +++ b/charts/pokt-portal/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "pokt-portal.fullname" . }} + labels: + {{- include "pokt-portal.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "pokt-portal.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/charts/pokt-portal/templates/ingress.yaml b/charts/pokt-portal/templates/ingress.yaml new file mode 100644 index 0000000..e80a802 --- /dev/null +++ b/charts/pokt-portal/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "pokt-portal.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "pokt-portal.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/pokt-portal/templates/secret-store.yaml b/charts/pokt-portal/templates/secret-store.yaml new file mode 100644 index 0000000..5674df6 --- /dev/null +++ b/charts/pokt-portal/templates/secret-store.yaml @@ -0,0 +1,22 @@ +{{- if .Values.externalSecrets.enabled -}} + +kind: SecretStore +apiVersion: external-secrets.io/v1beta1 +metadata: + name: {{ include "pokt-portal.fullname" . }}-ss +spec: + controller: "" + provider: + vault: + auth: + kubernetes: + mountPath: {{ .Values.externalSecrets.vault.mountPath }} + role: {{ .Values.externalSecrets.vault.role }} + serviceAccountRef: + name: {{ .Values.externalSecrets.vault.serviceAccount }} + namespace: {{ .Values.externalSecrets.vault.namespace }} + path: {{ .Values.externalSecrets.vault.path }} + server: {{ .Values.externalSecrets.vault.server }} + version: {{ .Values.externalSecrets.vault.version }} +{{- end -}} + diff --git a/charts/pokt-portal/templates/secret.yaml b/charts/pokt-portal/templates/secret.yaml new file mode 100644 index 0000000..f53e5bf --- /dev/null +++ b/charts/pokt-portal/templates/secret.yaml @@ -0,0 +1,16 @@ +{{- if .Values.env.secret -}} +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Release.Name }}-vars + labels: + app: {{ template "pokt-portal.fullname" . }} + chart: {{ template "pokt-portal.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +type: Opaque +data: + {{- range $key, $val := .Values.env.secret }} + {{ $key }}: {{ $val | b64enc }} + {{- end}} +{{- end }} diff --git a/charts/pokt-portal/templates/service.yaml b/charts/pokt-portal/templates/service.yaml new file mode 100644 index 0000000..1495891 --- /dev/null +++ b/charts/pokt-portal/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "pokt-portal.fullname" . }} + labels: + {{- include "pokt-portal.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: {{ .Values.service.port }} + protocol: TCP + name: http + selector: + {{- include "pokt-portal.selectorLabels" . | nindent 4 }} diff --git a/charts/pokt-portal/templates/serviceaccount.yaml b/charts/pokt-portal/templates/serviceaccount.yaml new file mode 100644 index 0000000..6ab5491 --- /dev/null +++ b/charts/pokt-portal/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "pokt-portal.serviceAccountName" . }} + labels: + {{- include "pokt-portal.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/pokt-portal/templates/tests/test-connection.yaml b/charts/pokt-portal/templates/tests/test-connection.yaml new file mode 100644 index 0000000..ced32ae --- /dev/null +++ b/charts/pokt-portal/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "pokt-portal.fullname" . }}-test-connection" + labels: + {{- include "pokt-portal.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "pokt-portal.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/charts/pokt-portal/values.yaml b/charts/pokt-portal/values.yaml new file mode 100644 index 0000000..8b63362 --- /dev/null +++ b/charts/pokt-portal/values.yaml @@ -0,0 +1,214 @@ +# Default values for pokt-portal. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: pocketfoundation/portal-api + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "develop" + +imagePullSecrets: [] + # - name: "regcred" +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "portal-api" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 3000 + +probes: + enabled: false + +ingress: + enabled: false + className: "" + annotations: {} + hosts: + - host: mydomain.com + paths: + - path: / + pathType: ImplementationSpecific + tls: + - secretName: mydomain-com-tls + hosts: + - mydomain.com + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 3 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +externalSecrets: + enabled: false + # key: "path" + # vault: + # mountPath: "somepath" + # role: "demo" + # serviceAccount: "demo" + # key: "path" + # namespace: "demo" + # path: "demo" + # server: "demo" + # version: "demo" + + +# Environment variable listing +env: + # non sensitive variables + normal: + # remote cache + REDIS_PORT: "6379" + # sensitive variables stored in a secret + secret: + # Pocket-js keys + GATEWAY_CLIENT_PRIVATE_KEY: "v3rys3cr3tk3yud0nt3venkn0w" + GATEWAY_CLIENT_PASSPHRASE: "v3rys3cr3tp4ssphr4ze" + BLOCKED_ADDRESSES_URL: "https://blocked-addresses.s3.us-west-2.amazonaws.com/blocked_address.json" + # Mongodb env + MONGO_ENDPOINT: "mongodb://pokt:P0K7m0ngod8@mongodb:27017/gateway" + DATABASE_ENCRYPTION_KEY: "00000000000000000000000000000000" + + # remote cache + REMOTE_REDIS_ENDPOINT: "redis-master:6379" + + # local cache + LOCAL_REDIS_ENDPOINT: "redis-master:6379" + REDIS_LOCAL_TTL_FACTOR: "1" + + # Influx DB + INFLUX_URLS: "http://influxdb" + INFLUX_TOKENS: "xbvafasvxgxg1262619" + INFLUX_ORGS: "demand-infra" + + # Metrics DB + PSQL_CONNECTION: "postgres://pguser:pgpassword@metricsdb:5432/gateway" + PSQL_CERTIFICATE: "https://s3.amazonaws.com/" + + # logz + LOGZ_TOKEN: "12345" + + # pocket protocol dispatch and fallback nodes + DISPATCH_URL: "https://node1.mainnet.pokt.network" + POCKET_SESSION_BLOCK_FREQUENCY: "4" + POCKET_BLOCK_TIME: "1038000" + POCKET_RELAY_RETRIES: "0" + DEFAULT_SYNC_ALLOWANCE: "5" + DEFAULT_LOG_LIMIT_BLOCKS: "10000" + + # Choose your AAT plan + # values: freemium, premium + AAT_PLAN: "freemium" + + # Development environment + WATCH: "true" + NODE_ENV: "development" + REGION: "localhost" + ARCHIVAL_CHAINS: "0022,0028,0010,000A,000B,000C" + + # For connection to the metrics db using self-signed cert + NODE_TLS_REJECT_UNAUTHORIZED: "0" + + LOG_TO_CLOUDWATCH: "false" + AWS_ACCESS_KEY_ID: "AXAI" + AWS_SECRET_ACCESS_KEY: "xYansdlapq912n" + + # Datadog logging + LOG_TO_DATADOG: "false" + DATADOG_API_KEY: myApiKey + +## @section redis subcharts parameters +## @param redis.enabled Deploy redis subchart +redis: + enabled: true + fullnameOverride: "redis" + architecture: "standalone" + auth: + enabled: false + master: + persistence: + enabled: false + replica: + persistence: + enabled: false + sentinel: + persistence: + enabled: false + +## @section influxdb subchart parameters +## @param influxdb.enabled Deploy influx subchart +## +influxdb2: + enabled: true + fullnameOverride: "influxdb" + persistence: + enabled: false + adminUser: + organization: "demand-infra" + bucket: "default" + user: "admin" + retention_policy: "0s" + password: "SuperS3cr37P@5$w0rd" + token: "xbvafasvxgxg1262619" + +## @section mongodb subchart parameters +## @param mongodb.enabled Deploy mongodb subchart +## +mongodb: + enabled: true + fullnameOverride: "mongodb" + port: 27017 + auth: + rootPassword: SuperS3cr37P@5$w0rd + usernames: + - pokt + passwords: + - P0K7m0ngod8 + databases: + - gateway + persistence: + enabled: false diff --git a/ct.yaml b/ct.yaml index 865c239..1ad951d 100644 --- a/ct.yaml +++ b/ct.yaml @@ -3,6 +3,7 @@ target-branch: master chart-dirs: - charts chart-repos: -# - pokt=https://pokt-foundation.gitlab.io/charts +# - pokt=https://pokt-foundation.github.io/charts/ - bitnami=https://charts.bitnami.com/bitnami + - influxdata=https://helm.influxdata.com/ helm-extra-args: --timeout 600s