Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds dedicated charts for console api, web and provider proxy #330

Open
wants to merge 2 commits into
base: console-api
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
key.pem
.idea
2 changes: 1 addition & 1 deletion charts/console-api/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ version: 0.1.0
# 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: "2.56.0"
appVersion: "2.62.1"
35 changes: 16 additions & 19 deletions charts/console-api/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.appName }}{{ if .Values.chain }}-{{ .Values.chain }}{{ end }}
namespace: {{ .Values.namespace }}
name: {{ .Chart.Name }}-{{ .Values.chain }}
namespace: {{ .Release.Namespace }}
labels:
app: {{ .Values.appName }}{{ if .Values.chain }}-{{ .Values.chain }}{{ end }}
app: {{ .Chart.Name }}-{{ .Values.chain }}
spec:
replicas: 1
selector:
matchLabels:
app: {{ .Values.appName }}{{ if .Values.chain }}-{{ .Values.chain }}{{ end }}
app: {{ .Chart.Name }}-{{ .Values.chain }}
template:
metadata:
labels:
app: {{ .Values.appName }}{{ if .Values.chain }}-{{ .Values.chain }}{{ end }}
app: {{ .Chart.Name }}-{{ .Values.chain }}
spec:
containers:
- name: {{ .Values.appName }}{{ if .Values.chain }}-{{ .Values.chain }}{{ end }}
image: {{ .Values.image }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
{{- if .Values.command }}
- name: {{ .Chart.Name }}-{{ .Values.chain }}
image: ghcr.io/akash-network/console-api:{{ .Chart.AppVersion }}
imagePullPolicy: "Always"
command:
{{- toYaml .Values.command | nindent 12 }}
{{- end }}
- node
- dist/server.js
ports:
- containerPort: 3000
name: api-port
Expand All @@ -31,16 +30,14 @@ spec:
- name: PORT
value: "3000"
resources:
requests:
cpu: "1"
memory: "2Gi"
ephemeral-storage: "2Gi"
limits:
cpu: "1"
memory: "2Gi"
ephemeral-storage: "2Gi"
{{- if and .Values.doppler (and .Values.doppler.project .Values.doppler.config) }}
memory: "1Gi"
requests:
cpu: "0.5"
ephemeral-storage: "1Gi"
memory: "512Mi"
envFrom:
- secretRef:
name: {{ .Values.appName }}{{ if .Values.chain }}-{{ .Values.chain }}{{ end }}-secret
{{- end }}
name: {{ .Chart.Name }}-{{ .Values.chain }}-secret
12 changes: 5 additions & 7 deletions charts/console-api/templates/doppler-secret.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
{{- if and .Values.doppler (and .Values.doppler.project .Values.doppler.config) }}
apiVersion: secrets.doppler.com/v1alpha1
kind: DopplerSecret
metadata:
name: {{ .Values.appName }}{{ if .Values.chain }}-{{ .Values.chain }}{{ end }}-dopplersecret
name: {{ .Chart.Name }}-{{ .Values.chain }}-dopplersecret
namespace: doppler-operator-system
spec:
config: {{ .Values.dopplerConfig }}
config: {{ .Release.Namespace }}-{{ .Values.chain }}
managedSecret:
name: {{ .Values.appName }}{{ if .Values.chain }}-{{ .Values.chain }}{{ end }}-secret
namespace: {{ .Values.namespace }}
name: {{ .Chart.Name }}-{{ .Values.chain }}-secret
namespace: {{ .Release.Namespace }}
type: Opaque
project: {{ .Values.doppler.project }}
project: {{ .Chart.Name }}
tokenSecret:
name: console-token-secret
verifyTLS: true
{{- end }}
8 changes: 4 additions & 4 deletions charts/console-api/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Values.appName }}{{ if .Values.chain }}-{{ .Values.chain }}{{ end }}-ingress
namespace: {{ .Values.namespace }}
name: {{ .Chart.Name }}-{{ .Values.chain }}-ingress
namespace: {{ .Release.Namespace }}
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 100m
nginx.ingress.kubernetes.io/proxy-connect-timeout: "140"
Expand All @@ -17,12 +17,12 @@ spec:
paths:
- backend:
service:
name: {{ .Values.appName }}{{ if .Values.chain }}-{{ .Values.chain }}{{ end }}-service
name: {{ .Chart.Name }}-{{ .Values.chain }}-service
port:
name: api-port
path: /
pathType: Prefix
tls:
- hosts:
- {{ .Values.hostName }}
secretName: {{ .Values.appName }}-{{ .Values.namespace }}-akash-network-tls
secretName: {{ .Chart.Name }}-{{ .Values.namespace }}-akash-network-tls
35 changes: 35 additions & 0 deletions charts/console-api/templates/jobs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{- range .Values.jobs }}
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ $.Chart.Name }}-{{ $.Values.chain }}-{{ .name }}
namespace: {{ $.Release.Namespace }}
spec:
schedule: {{ .schedule | quote }}
jobTemplate:
spec:
template:
metadata:
labels:
app: {{ $.Chart.Name }}-{{ $.Values.chain }}
spec:
restartPolicy: Never
containers:
- name: {{ $.Chart.Name }}-{{ $.Values.chain }}
image: ghcr.io/akash-network/console-api:{{ $.Chart.AppVersion }}
imagePullPolicy: "Always"
command: {{ .command | toJson }}
resources:
limits:
cpu: "1"
ephemeral-storage: "2Gi"
memory: "1Gi"
requests:
cpu: "0.5"
ephemeral-storage: "1Gi"
memory: "512Mi"
envFrom:
- secretRef:
name: {{ $.Chart.Name }}-{{ $.Values.chain }}-secret
{{- end }}
6 changes: 3 additions & 3 deletions charts/console-api/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.appName }}{{ if .Values.chain }}-{{ .Values.chain }}{{ end }}-service
namespace: {{ .Values.namespace }}
name: {{ .Chart.Name }}-{{ .Values.chain }}-service
namespace: {{ .Release.Namespace }}
spec:
selector:
app: {{ .Values.appName }}{{ if .Values.chain }}-{{ .Values.chain }}{{ end }}
app: {{ .Chart.Name }}-{{ .Values.chain }}
ports:
- protocol: TCP
port: 3000
Expand Down
26 changes: 26 additions & 0 deletions charts/console-api/values-mainnet.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
chain: mainnet
hostName: console-api-mainnet-staging.akash.network
jobs:
- name: top-up-deployments
schedule: "0 * * * *" # 0 minutes past the hour
command:
- node
- dist/console.js
- top-up-deployments
- name: refill-wallets
schedule: "45 * * * *" # 45 minutes past the hour
command:
- node
- dist/console.js
- refill-wallets
- name: cleanup-stale-deployments
schedule: "30 10 * * 2" # 10:30 AM every Tuesday
command:
- node
- dist/console.js
- cleanup-stale-deployments
- name: cleanup-stale-anonymous-users
schedule: "0 9 * * 1" # 9:00 AM every Monday
command:
- node
- dist/console.js
- cleanup-stale-anonymous-users
12 changes: 0 additions & 12 deletions charts/console-api/values-sample.yaml

This file was deleted.

1 change: 1 addition & 0 deletions charts/console-api/values-sandbox.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
chain: sandbox
hostName: console-api-sandbox-staging.akash.network
1 change: 1 addition & 0 deletions charts/console-api/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

23 changes: 23 additions & 0 deletions charts/console-web/.helmignore
Original file line number Diff line number Diff line change
@@ -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/
22 changes: 22 additions & 0 deletions charts/console-web/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: v2
name: console-web
description: Akash Console-Web 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: "2.44.0"
8 changes: 8 additions & 0 deletions charts/console-web/secret.sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: console-token-secret
namespace: doppler-operator-system
type: Opaque
stringData:
serviceToken: <YOUR_SECRET>
40 changes: 40 additions & 0 deletions charts/console-web/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Chart.Name }}
namespace: {{ .Release.Namespace }}
labels:
app: {{ .Chart.Name }}
spec:
replicas: 1
selector:
matchLabels:
app: {{ .Chart.Name }}
template:
metadata:
labels:
app: {{ .Chart.Name }}
spec:
containers:
- name: {{ .Chart.Name }}
image: ghcr.io/akash-network/deploy-web:{{ .Chart.AppVersion }}{{ if eq .Release.Namespace "staging" }}-beta{{ end }}
imagePullPolicy: "Always"
ports:
- containerPort: 3000
name: api-port
protocol: TCP
env:
- name: PORT
value: "3000"
resources:
limits:
cpu: "1"
ephemeral-storage: "2Gi"
memory: "1Gi"
requests:
cpu: "0.5"
ephemeral-storage: "1Gi"
memory: "512Mi"
envFrom:
- secretRef:
name: {{ .Chart.Name }}-secret
15 changes: 15 additions & 0 deletions charts/console-web/templates/doppler-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: secrets.doppler.com/v1alpha1
kind: DopplerSecret
metadata:
name: {{ .Chart.Name }}-dopplersecret
namespace: doppler-operator-system
spec:
config: {{ .Release.Namespace }}
managedSecret:
name: {{ .Chart.Name }}-secret
namespace: {{ .Release.Namespace }}
type: Opaque
project: {{ .Chart.Name }}
tokenSecret:
name: console-token-secret
verifyTLS: true
28 changes: 28 additions & 0 deletions charts/console-web/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Chart.Name }}-ingress
namespace: {{ .Release.Namespace }}
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 100m
nginx.ingress.kubernetes.io/proxy-connect-timeout: "140"
nginx.ingress.kubernetes.io/proxy-read-timeout: "140"
nginx.ingress.kubernetes.io/proxy-send-timeout: "140"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
ingressClassName: nginx
rules:
- host: {{ .Values.hostName }}
http:
paths:
- backend:
service:
name: {{ .Chart.Name }}-service
port:
name: api-port
path: /
pathType: Prefix
tls:
- hosts:
- {{ .Values.hostName }}
secretName: {{ .Chart.Name }}-{{ .Release.Namespace }}-akash-network-tls
14 changes: 14 additions & 0 deletions charts/console-web/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Chart.Name }}-service
namespace: {{ .Release.Namespace }}
spec:
selector:
app: {{ .Chart.Name }}
ports:
- protocol: TCP
port: 3000
targetPort: api-port
name: api-port
type: ClusterIP
1 change: 1 addition & 0 deletions charts/console-web/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hostName: console-beta.akash.network
Loading
Loading