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

console-api Helm chart #311

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
23 changes: 23 additions & 0 deletions charts/console-api/.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/
25 changes: 25 additions & 0 deletions charts/console-api/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: v2
name: console-api
shimpa1 marked this conversation as resolved.
Show resolved Hide resolved
description: Helm chart for Akash Console API deployment
type: application
version: 0.1.0

Check failure on line 5 in charts/console-api/Chart.yaml

View workflow job for this annotation

GitHub Actions / lint-helm

[trailing-spaces] trailing spaces
appVersion: "2.53.0"

Check failure on line 6 in charts/console-api/Chart.yaml

View workflow job for this annotation

GitHub Actions / lint-helm

[trailing-spaces] trailing spaces

# Dependencies if needed
# dependencies:
# - name: common
# version: 1.x.x
# repository: https://charts.bitnami.com/bitnami

maintainers:
- name: Akash Network
url: https://akash.network

keywords:
- akash
- api
- console

home: https://github.com/akash-network/helm-charts/console-api
sources:
- https://github.com/akash-network/helm-charts/console-api
7 changes: 7 additions & 0 deletions charts/console-api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Deploy using

# For mainnet
helm install console-api . -f values-mainnet.yaml

# For sandbox
helm install console-api . -f values-sandbox.yaml
106 changes: 106 additions & 0 deletions charts/console-api/sandbox-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
---
# Source: console-api/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: console-api-sandbox-service
namespace: staging
spec:
selector:
app: console-api-sandbox
ports:
- protocol: TCP
port: 3000
targetPort: api-port
name: api-port
type: ClusterIP
---
# Source: console-api/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: console-api-sandbox
namespace: staging
labels:
app: console-api-sandbox
spec:
replicas: 1
selector:
matchLabels:
app: console-api-sandbox
template:
metadata:
labels:
app: console-api-sandbox
spec:
containers:
- name: console-api-sandbox
image: "ghcr.io/akash-network/console-api:2.53.0"
imagePullPolicy: Always
command: ["node", "dist/server.js"]
ports:
- containerPort: 3000
name: api-port
protocol: TCP
env:
- name: PORT
value: "3000"
resources:
limits:
cpu: 500m
ephemeral-storage: 1Gi
memory: 1Gi
requests:
cpu: 500m
ephemeral-storage: 1Gi
memory: 1Gi
envFrom:
- secretRef:
name: console-api-sandbox-secret
---
# Source: console-api/templates/ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: console-api-sandbox-ingress
namespace: staging
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: console-api-staging-sandbox.akash.network
http:
paths:
- backend:
service:
name: console-api-sandbox-service
port:
name: api-port
path: /
pathType: Prefix
tls:
- hosts:
- console-api-staging-sandbox.akash.network
secretName: console-api-staging-akash-network-tls
---
# Source: console-api/templates/doppler-secret.yaml
apiVersion: secrets.doppler.com/v1alpha1
kind: DopplerSecret
metadata:
name: console-api-sandbox-dopplersecret
namespace: doppler-operator-system
spec:
config: staging-sandbox
managedSecret:
name: console-api-sandbox-secret
namespace: staging
type: Opaque
project: console-api
tokenSecret:
name: console-token-secret
verifyTLS: true
38 changes: 38 additions & 0 deletions charts/console-api/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: console-api-{{ .Values.global.environment }}
namespace: {{ .Values.global.namespace }}
labels:
app: console-api-{{ .Values.global.environment }}
spec:
replicas: 1
selector:
matchLabels:
app: console-api-{{ .Values.global.environment }}
template:
metadata:
labels:
app: console-api-{{ .Values.global.environment }}
spec:
containers:
- name: console-api-{{ .Values.global.environment }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
shimpa1 marked this conversation as resolved.
Show resolved Hide resolved
command: ["node", "dist/server.js"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is set in docker and would be hard to debug if this changes.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I'll try a different approach

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ygrishajev I've made a number of changes, would you please take another look, thanks

ports:
- containerPort: {{ .Values.service.port }}
name: {{ .Values.service.targetPort }}
protocol: TCP
env:
- name: PORT
value: "{{ .Values.service.port }}"
resources:
{{- with index .Values.environments .Values.global.environment "resources" }}
{{- toYaml . | nindent 12 }}
{{- end }}
envFrom:
- secretRef:
name: console-api-{{ .Values.global.environment }}-secret

---
15 changes: 15 additions & 0 deletions charts/console-api/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: console-api-{{ .Values.global.environment }}-dopplersecret
namespace: doppler-operator-system
spec:
config: {{ index .Values.environments .Values.global.environment "doppler" "config" }}
managedSecret:
name: console-api-{{ .Values.global.environment }}-secret
namespace: {{ .Values.global.namespace }}
type: Opaque
project: console-api
tokenSecret:
name: console-token-secret
verifyTLS: true
28 changes: 28 additions & 0 deletions charts/console-api/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: console-api-{{ .Values.global.environment }}-ingress
namespace: {{ .Values.global.namespace }}
annotations:
{{- with .Values.ingress.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ingressClassName: {{ .Values.ingress.className }}
rules:
- host: {{ index .Values.environments .Values.global.environment "host" }}
http:
paths:
- backend:
service:
name: console-api-{{ .Values.global.environment }}-service
port:
name: {{ .Values.service.targetPort }}
path: /
pathType: Prefix
tls:
- hosts:
- {{ index .Values.environments .Values.global.environment "host" }}
secretName: console-api-staging-akash-network-tls

---
14 changes: 14 additions & 0 deletions charts/console-api/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: console-api-{{ .Values.global.environment }}-service
namespace: {{ .Values.global.namespace }}
spec:
selector:
app: console-api-{{ .Values.global.environment }}
ports:
- protocol: TCP
port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetPort }}
name: {{ .Values.service.targetPort }}
type: {{ .Values.service.type }}
2 changes: 2 additions & 0 deletions charts/console-api/values-mainnet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
global:
environment: mainnet
2 changes: 2 additions & 0 deletions charts/console-api/values-sandbox.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
global:
environment: sandbox
52 changes: 52 additions & 0 deletions charts/console-api/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
global:
environment: mainnet # or sandbox
namespace: staging

image:
repository: ghcr.io/akash-network/console-api
tag: "2.53.0"
pullPolicy: Always

service:
port: 3000
targetPort: api-port
type: ClusterIP

ingress:
className: nginx
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"

environments:
mainnet:
host: console-api-staging-next.akash.network
doppler:
config: staging-mainnet
resources:
requests:
cpu: "1"
memory: "2Gi"
ephemeral-storage: "2Gi"
limits:
cpu: "1"
memory: "2Gi"
ephemeral-storage: "2Gi"
sandbox:
host: console-api-staging-sandbox.akash.network
doppler:
config: staging-sandbox
resources:
requests:
cpu: "500m"
memory: "1Gi"
ephemeral-storage: "1Gi"
limits:
cpu: "500m"
memory: "1Gi"
ephemeral-storage: "1Gi"

---
23 changes: 23 additions & 0 deletions charts/provider-console-api/.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/
24 changes: 24 additions & 0 deletions charts/provider-console-api/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: provider-console-api
description: A Helm chart for Kubernetes

# 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: "1.16.0"
Loading
Loading