diff --git a/charts/provider-inventory/Chart.lock b/charts/provider-inventory/Chart.lock new file mode 100644 index 00000000..6b09eeb0 --- /dev/null +++ b/charts/provider-inventory/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: nodejs-app + repository: file://../nodejs-app + version: 0.4.1 +digest: sha256:94e236aa9486039f873f0eecce286baf1cf811fa57966a1807eb7d289c66dcea +generated: "2026-05-20T00:00:00.000000+00:00" diff --git a/charts/provider-inventory/Chart.yaml b/charts/provider-inventory/Chart.yaml new file mode 100644 index 00000000..3d5f5501 --- /dev/null +++ b/charts/provider-inventory/Chart.yaml @@ -0,0 +1,27 @@ +apiVersion: v2 +name: provider-inventory +description: Akash Provider-Inventory Helm Chart + +# 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.1.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.1.0" + +dependencies: + - name: nodejs-app + version: 0.4.1 + repository: "file://../nodejs-app" diff --git a/charts/provider-inventory/secret.sample.yaml b/charts/provider-inventory/secret.sample.yaml new file mode 100644 index 00000000..6fb36bec --- /dev/null +++ b/charts/provider-inventory/secret.sample.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Secret +metadata: + name: console-token-secret + namespace: doppler-operator-system +type: Opaque +stringData: + serviceToken: diff --git a/charts/provider-inventory/templates/configmap.yaml b/charts/provider-inventory/templates/configmap.yaml new file mode 100644 index 00000000..91e77259 --- /dev/null +++ b/charts/provider-inventory/templates/configmap.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Chart.Name }}-{{ .Values.chain }}-config +data: +{{ include "app.env" . | indent 2 }} + NETWORK: {{ .Values.chain }} diff --git a/charts/provider-inventory/templates/deployment-providers-sync.yaml b/charts/provider-inventory/templates/deployment-providers-sync.yaml new file mode 100644 index 00000000..21cdbfd7 --- /dev/null +++ b/charts/provider-inventory/templates/deployment-providers-sync.yaml @@ -0,0 +1,57 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Chart.Name }}-{{ .Values.chain }}-providers-sync + namespace: {{ .Release.Namespace }} + labels: + app: {{ .Chart.Name }}-{{ .Values.chain }}-providers-sync + annotations: + secrets.doppler.com/reload: 'true' +spec: + replicas: {{ .Values.providersSync.replicas | default 1 }} + strategy: + type: Recreate + selector: + matchLabels: + app: {{ .Chart.Name }}-{{ .Values.chain }}-providers-sync + template: + metadata: + labels: + app: {{ .Chart.Name }}-{{ .Values.chain }}-providers-sync + spec: + containers: + - name: {{ .Chart.Name }}-{{ .Values.chain }}-providers-sync + image: ghcr.io/akash-network/console-provider-inventory:{{ .Values.appVersion }} + imagePullPolicy: "Always" + ports: + - containerPort: 3000 + name: api-port + protocol: TCP + envFrom: + - secretRef: + name: {{ .Chart.Name }}-{{ .Values.chain }}-secret + - configMapRef: + name: {{ .Chart.Name }}-{{ .Values.chain }}-config + env: + - name: OTEL_SERVICE_NAME + value: {{ .Chart.Name }}-{{ .Values.chain }}-providers-sync + - name: INTERFACE + value: "providers-sync" + resources: + {{- toYaml .Values.providersSync.resources | nindent 12 }} + readinessProbe: + httpGet: + path: /private/v1/healthz/readiness + port: 3000 + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 10 + failureThreshold: 3 + livenessProbe: + httpGet: + path: /private/v1/healthz/liveness + port: 3000 + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 10 + failureThreshold: 3 diff --git a/charts/provider-inventory/templates/deployment.yaml b/charts/provider-inventory/templates/deployment.yaml new file mode 100644 index 00000000..de0f161c --- /dev/null +++ b/charts/provider-inventory/templates/deployment.yaml @@ -0,0 +1,55 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Chart.Name }}-{{ .Values.chain }} + namespace: {{ .Release.Namespace }} + labels: + app: {{ .Chart.Name }}-{{ .Values.chain }} + annotations: + secrets.doppler.com/reload: 'true' +spec: + replicas: {{ .Values.replicas | default 1 }} + selector: + matchLabels: + app: {{ .Chart.Name }}-{{ .Values.chain }} + template: + metadata: + labels: + app: {{ .Chart.Name }}-{{ .Values.chain }} + spec: + containers: + - name: {{ .Chart.Name }}-{{ .Values.chain }} + image: ghcr.io/akash-network/console-provider-inventory:{{ .Values.appVersion }} + imagePullPolicy: "Always" + ports: + - containerPort: 3000 + name: api-port + protocol: TCP + envFrom: + - secretRef: + name: {{ .Chart.Name }}-{{ .Values.chain }}-secret + - configMapRef: + name: {{ .Chart.Name }}-{{ .Values.chain }}-config + env: + - name: OTEL_SERVICE_NAME + value: {{ .Chart.Name }}-{{ .Values.chain }} + - name: INTERFACE + value: "rest" + resources: + {{- toYaml .Values.resources | nindent 12 }} + readinessProbe: + httpGet: + path: /private/v1/healthz/readiness + port: 3000 + initialDelaySeconds: 5 + periodSeconds: 5 + timeoutSeconds: 5 + failureThreshold: 3 + livenessProbe: + httpGet: + path: /private/v1/healthz/liveness + port: 3000 + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 3 diff --git a/charts/provider-inventory/templates/doppler-secret.yaml b/charts/provider-inventory/templates/doppler-secret.yaml new file mode 100644 index 00000000..f301adf0 --- /dev/null +++ b/charts/provider-inventory/templates/doppler-secret.yaml @@ -0,0 +1,15 @@ +apiVersion: secrets.doppler.com/v1alpha1 +kind: DopplerSecret +metadata: + name: {{ .Chart.Name }}-{{ .Release.Namespace }}-{{ .Values.chain }}-dopplersecret + namespace: doppler-operator-system +spec: + config: {{ .Release.Namespace }} + managedSecret: + name: {{ .Chart.Name }}-{{ .Values.chain }}-secret + namespace: {{ .Release.Namespace }} + type: Opaque + project: {{ .Chart.Name }} + tokenSecret: + name: console-token-secret + verifyTLS: true diff --git a/charts/provider-inventory/templates/job-migrations.yaml b/charts/provider-inventory/templates/job-migrations.yaml new file mode 100644 index 00000000..8d2fedb1 --- /dev/null +++ b/charts/provider-inventory/templates/job-migrations.yaml @@ -0,0 +1,40 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ .Chart.Name }}-{{ .Values.chain }}-migrations + namespace: {{ .Release.Namespace }} + labels: + app: {{ .Chart.Name }}-{{ .Values.chain }}-migrations + annotations: + "helm.sh/hook": pre-install,pre-upgrade + "helm.sh/hook-weight": "0" + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded +spec: + backoffLimit: {{ .Values.migrations.backoffLimit | default 1 }} + template: + metadata: + labels: + app: {{ .Chart.Name }}-{{ .Values.chain }}-migrations + spec: + restartPolicy: Never + containers: + - name: {{ .Chart.Name }}-{{ .Values.chain }}-migrations + image: ghcr.io/akash-network/console-provider-inventory:{{ .Values.appVersion }} + imagePullPolicy: "Always" + command: {{ .Values.migrations.command | toJson }} + envFrom: + - secretRef: + name: {{ .Chart.Name }}-{{ .Values.chain }}-secret + - secretRef: + name: {{ .Chart.Name }}-{{ .Values.chain }}-migrations-secret + env: + - name: NETWORK + value: {{ .Values.chain | quote }} + - name: DEPLOYMENT_ENV + value: {{ .Values.deploymentEnv | quote }} + - name: NODE_OPTIONS + value: >- + --enable-source-maps + --stack-trace-limit=25 + resources: + {{- toYaml .Values.migrations.resources | nindent 12 }} diff --git a/charts/provider-inventory/templates/migrations-doppler-secret.yaml b/charts/provider-inventory/templates/migrations-doppler-secret.yaml new file mode 100644 index 00000000..58776882 --- /dev/null +++ b/charts/provider-inventory/templates/migrations-doppler-secret.yaml @@ -0,0 +1,19 @@ +apiVersion: secrets.doppler.com/v1alpha1 +kind: DopplerSecret +metadata: + name: {{ .Chart.Name }}-{{ .Release.Namespace }}-{{ .Values.chain }}-migrations-dopplersecret + namespace: doppler-operator-system + annotations: + "helm.sh/hook": pre-install,pre-upgrade + "helm.sh/hook-weight": "-10" + "helm.sh/hook-delete-policy": before-hook-creation +spec: + config: {{ .Values.migrations.dopplerConfig | default (printf "%s_migrations" .Release.Namespace) }} + managedSecret: + name: {{ .Chart.Name }}-{{ .Values.chain }}-migrations-secret + namespace: {{ .Release.Namespace }} + type: Opaque + project: {{ .Chart.Name }} + tokenSecret: + name: console-token-secret + verifyTLS: true diff --git a/charts/provider-inventory/templates/service.yaml b/charts/provider-inventory/templates/service.yaml new file mode 100644 index 00000000..635a1a54 --- /dev/null +++ b/charts/provider-inventory/templates/service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Chart.Name }}-{{ .Values.chain }}-service + namespace: {{ .Release.Namespace }} +spec: + selector: + app: {{ .Chart.Name }}-{{ .Values.chain }} + ports: + - protocol: TCP + port: 3000 + targetPort: api-port + name: api-port + type: ClusterIP diff --git a/charts/provider-inventory/values.yaml b/charts/provider-inventory/values.yaml new file mode 100644 index 00000000..c5a9536f --- /dev/null +++ b/charts/provider-inventory/values.yaml @@ -0,0 +1,45 @@ +appVersion: "0.1.0" + +deploymentEnv: staging +chain: sandbox + +replicas: 1 + +resources: + limits: + cpu: 1 + ephemeral-storage: 200Mi + memory: 2Gi + requests: + cpu: 1 + ephemeral-storage: 100Mi + memory: 1Gi + +providersSync: + replicas: 1 + resources: + limits: + cpu: 1 + ephemeral-storage: 200Mi + memory: 1Gi + requests: + cpu: 500m + ephemeral-storage: 100Mi + memory: 512Mi + +migrations: + command: ["npm", "run", "migration:exec"] + backoffLimit: 1 + # dopplerConfig: "" # defaults to "{Release.Namespace}-migrations" + resources: + limits: + cpu: 500m + ephemeral-storage: 100Mi + memory: 512Mi + requests: + cpu: 200m + ephemeral-storage: 50Mi + memory: 256Mi + +otel: + enabled: true