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

Add helm chart #3606

Open
wants to merge 2 commits into
base: main
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 22 additions & 0 deletions helm/adminpanel/.helmignore
@@ -0,0 +1,22 @@
# 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
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
8 changes: 8 additions & 0 deletions helm/adminpanel/Chart.yaml
@@ -0,0 +1,8 @@
apiVersion: v2
appVersion: "2023.8.2"
description: A free, fast and beautiful API request builder
name: hoppscotch
version: 0.4.0
home: https://github.com/hoppscotch/hoppscotch
sources:
- https://github.com/hoppscotch/hoppscotch
16 changes: 16 additions & 0 deletions helm/adminpanel/templates/_env.tpl
@@ -0,0 +1,16 @@
{{- define "env" -}}
- name: VITE_ALLOWED_AUTH_PROVIDERS
value: GOOGLE,GITHUB,MICROSOFT,EMAIL
- name: VITE_BASE_URL
value: http://app.hoppscotch
- name: VITE_SHORTCODE_BASE_URL
value: http://app.hoppscotch
- name: VITE_ADMIN_URL
value: http://admin.hoppscotch
- name: VITE_BACKEND_GQL_URL
value: http://backend.hoppscotch/graphql
- name: VITE_BACKEND_WS_URL
value: ws://backend.hoppscotch/graphql
- name: VITE_BACKEND_API_URL
value: http://backend.hoppscotch/v1
{{- end -}}
54 changes: 54 additions & 0 deletions helm/adminpanel/templates/_helpers.tpl
@@ -0,0 +1,54 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "hoppscotch.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 "hoppscotch.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" $name .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "hoppscotch.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "hoppscotch.labels" -}}
app.kubernetes.io/name: {{ include "hoppscotch.name" . }}
helm.sh/chart: {{ include "hoppscotch.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{/*
Extra labels
*/}}
{{- define "hoppscotch.extra_labels" -}}
{{- if .Values.extra_labels }}
{{ toYaml .Values.extra_labels }}
{{- end }}
{{- end -}}
51 changes: 51 additions & 0 deletions helm/adminpanel/templates/deployment.yaml
@@ -0,0 +1,51 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "hoppscotch.fullname" . }}
labels:
{{ include "hoppscotch.labels" . | indent 4 }}
{{ include "hoppscotch.extra_labels" . | indent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "hoppscotch.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "hoppscotch.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{ include "hoppscotch.extra_labels" . | indent 8 }}
spec:
{{- if .Values.image.pullSecret }}
imagePullSecrets:
- name: {{ .Values.image.pullSecret }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env: {{- include "env" . | nindent 12 }}
ports:
- name: http
containerPort: {{ .Values.service.containerPort }}
protocol: TCP
{{- if .Values.probes }}
{{- if .Values.probes.readinessProbe }}
readinessProbe:
{{ .Values.probes.readinessProbe_type }}:
path: {{ .Values.probes.readinessProbe_path }}
port: {{ .Values.service.containerPort }}
{{- toYaml .Values.probes.readinessProbe | nindent 12 }}
{{- end }}
{{- if .Values.probes.livenessProbe }}
livenessProbe:
{{ .Values.probes.livenessProbe_type }}:
path: {{ .Values.probes.livenessProbe_path }}
port: {{ .Values.service.containerPort }}
{{- toYaml .Values.probes.livenessProbe | nindent 12 }}
{{- end }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
42 changes: 42 additions & 0 deletions helm/adminpanel/templates/ingress.yaml
@@ -0,0 +1,42 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "hoppscotch.fullname" . -}}
{{- $svcPort := .Values.service.containerPort -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{ include "hoppscotch.labels" . | indent 4 }}
{{ include "hoppscotch.extra_labels" . | indent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- 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: {{ . }}
pathType: ImplementationSpecific
backend:
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}

16 changes: 16 additions & 0 deletions helm/adminpanel/templates/service.yaml
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "hoppscotch.fullname" . }}
labels:
{{ include "hoppscotch.labels" . | indent 4 }}
{{ include "hoppscotch.extra_labels" . | indent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- name: http
port: {{ .Values.service.containerPort }}
protocol: TCP
selector:
app.kubernetes.io/name: {{ include "hoppscotch.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
51 changes: 51 additions & 0 deletions helm/adminpanel/values.yaml
@@ -0,0 +1,51 @@
replicaCount: 1

image:
repository: hoppscotch/hoppscotch-admin
tag: latest
pullPolicy: Always
# pullSecret: regcred

nameOverride: ""
fullnameOverride: ""

service:
type: ClusterIP
containerPort: 8080

ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: admin.hoppscotch
paths: ["/"]
tls: []

extra_labels:
exposed-by-ingress: 'true'

resources:
limits:
cpu: 200m
memory: 256Mi
requests:
cpu: 100m
memory: 128Mi


probes:
readinessProbe_path: /
readinessProbe_type: httpGet
readinessProbe:
initialDelaySeconds: 10
periodSeconds: 5
failureThreshold: 15

livenessProbe_type: httpGet
livenessProbe_path: /
livenessProbe:
initialDelaySeconds: 30
periodSeconds: 5
failureThreshold: 10
22 changes: 22 additions & 0 deletions helm/app/.helmignore
@@ -0,0 +1,22 @@
# 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
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
8 changes: 8 additions & 0 deletions helm/app/Chart.yaml
@@ -0,0 +1,8 @@
apiVersion: v2
appVersion: "2023.8.2"
description: A free, fast and beautiful API request builder
name: hoppscotch
version: 0.4.0
home: https://github.com/hoppscotch/hoppscotch
sources:
- https://github.com/hoppscotch/hoppscotch
16 changes: 16 additions & 0 deletions helm/app/templates/_env.tpl
@@ -0,0 +1,16 @@
{{- define "env" -}}
- name: VITE_ALLOWED_AUTH_PROVIDERS
value: GOOGLE,GITHUB,MICROSOFT,EMAIL
- name: VITE_BASE_URL
value: http://app.hoppscotch
- name: VITE_SHORTCODE_BASE_URL
value: http://app.hoppscotch
- name: VITE_ADMIN_URL
value: http://admin.hoppscotch
- name: VITE_BACKEND_GQL_URL
value: http://backend.hoppscotch/graphql
- name: VITE_BACKEND_WS_URL
value: ws://backend.hoppscotch/graphql
- name: VITE_BACKEND_API_URL
value: http://backend.hoppscotch/v1
{{- end -}}
54 changes: 54 additions & 0 deletions helm/app/templates/_helpers.tpl
@@ -0,0 +1,54 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "hoppscotch.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 "hoppscotch.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" $name .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "hoppscotch.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "hoppscotch.labels" -}}
app.kubernetes.io/name: {{ include "hoppscotch.name" . }}
helm.sh/chart: {{ include "hoppscotch.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{/*
Extra labels
*/}}
{{- define "hoppscotch.extra_labels" -}}
{{- if .Values.extra_labels }}
{{ toYaml .Values.extra_labels }}
{{- end }}
{{- end -}}