Skip to content
Merged
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
23 changes: 23 additions & 0 deletions charts/developer-portal-fe/.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/
6 changes: 6 additions & 0 deletions charts/developer-portal-fe/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 12.12.10
digest: sha256:c3d1e1b7e4e1f5f5e4a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0
generated: "2024-03-23T09:28:00Z"
15 changes: 15 additions & 0 deletions charts/developer-portal-fe/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v2
name: developer-portal-fe
description: A Helm chart for API7 Developer Portal Frontend
type: application
version: 0.1.0
appVersion: "0.5.7"
maintainers:
- name: API7
email: support@api7.ai
url: https://api7.ai
dependencies:
- name: postgresql
condition: postgresql.builtin
version: "12.12.10"
repository: "https://charts.bitnami.com/bitnami"
91 changes: 91 additions & 0 deletions charts/developer-portal-fe/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# developer-portal-fe

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.5.7](https://img.shields.io/badge/AppVersion-0.5.7-informational?style=flat-square)

A Helm chart for API7 Developer Portal Frontend

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| API7 | <support@api7.ai> | <https://api7.ai> |

## Requirements

| Repository | Name | Version |
|------------|------|---------|
| https://charts.bitnami.com/bitnami | postgresql | 12.12.10 |

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| app.baseURL | string | `"http://localhost"` | |
| app.trustedOrigins[0] | string | `"http://localhost"` | |
| auth.existingSecret | string | `""` | |
| auth.existingSecretKey | string | `"auth-secret"` | |
| auth.secret | string | `""` | |
| db.existingSecret | string | `""` | |
| db.existingSecretKey | string | `"db-url"` | |
| db.url | string | `"postgres://portal:portal123@developer-portal-fe-postgresql:5432/portal"` | |
| developerPortal.extraEnvVars | list | `[]` | |
| developerPortal.extraVolumeMounts | list | `[]` | |
| developerPortal.extraVolumes | list | `[]` | |
| developerPortal.image.pullPolicy | string | `"IfNotPresent"` | |
| developerPortal.image.repository | string | `"api7/api7-ee-developer-portal-fe"` | |
| developerPortal.image.tag | string | `"v0.5.7"` | |
| developerPortal.livenessProbe.failureThreshold | int | `10` | |
| developerPortal.livenessProbe.initialDelaySeconds | int | `30` | |
| developerPortal.livenessProbe.path | string | `"/"` | |
| developerPortal.livenessProbe.periodSeconds | int | `10` | |
| developerPortal.podAnnotations | object | `{}` | |
| developerPortal.podLabels | object | `{}` | |
| developerPortal.readinessProbe.failureThreshold | int | `3` | |
| developerPortal.readinessProbe.initialDelaySeconds | int | `10` | |
| developerPortal.readinessProbe.path | string | `"/"` | |
| developerPortal.readinessProbe.periodSeconds | int | `5` | |
| developerPortal.replicaCount | int | `1` | |
| developerPortal.resources | object | `{}` | |
| developerPortal.tlsRejectUnauthorized | bool | `true` | |
| developerPortal.topologySpreadConstraints | list | `[]` | |
| fullnameOverride | string | `""` | |
| imagePullSecret | string | `""` | |
| ingress.annotations | object | `{}` | |
| ingress.className | string | `""` | |
| ingress.enabled | bool | `false` | |
| ingress.hosts[0].host | string | `"developer-portal.local"` | |
| ingress.hosts[0].paths[0].path | string | `"/"` | |
| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | |
| ingress.tls | list | `[]` | |
| nameOverride | string | `""` | |
| nodeSelector | object | `{}` | |
| podAnnotations | object | `{}` | |
| podSecurityContext | object | `{}` | |
| portal.existingSecret | string | `""` | |
| portal.existingSecretKey | string | `"portal-token"` | |
| portal.token | string | `""` | |
| portal.url | string | `"https://api7-developer-portal:4321"` | |
| postgresql.auth.database | string | `"portal"` | |
| postgresql.auth.password | string | `"portal123"` | |
| postgresql.auth.username | string | `"portal"` | |
| postgresql.builtin | bool | `true` | |
| postgresql.fullnameOverride | string | `"developer-portal-fe-postgresql"` | |
| postgresql.image.registry | string | `"docker.io"` | |
| postgresql.image.repository | string | `"api7/postgresql"` | |
| postgresql.image.tag | string | `"15.4.0-debian-11-r45"` | |
| postgresql.primary.persistence.enabled | bool | `true` | |
| postgresql.primary.persistence.size | string | `"10Gi"` | |
| postgresql.primary.service.ports.postgresql | int | `5432` | |
| resources | object | `{}` | |
| securityContext | object | `{}` | |
| service.annotations | object | `{}` | |
| service.containerPort | int | `3001` | |
| service.port | int | `80` | |
| service.type | string | `"ClusterIP"` | |
| serviceAccount.annotations | object | `{}` | |
| serviceAccount.create | bool | `true` | |
| serviceAccount.name | string | `""` | |
| tolerations | list | `[]` | |
| topologySpreadConstraints | list | `[]` | |

Binary file not shown.
41 changes: 41 additions & 0 deletions charts/developer-portal-fe/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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 "developer-portal-fe.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 "developer-portal-fe.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "developer-portal-fe.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 "developer-portal-fe.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 }}

2. Configuration notes:
- Portal API URL: {{ .Values.portal.url }}
- Database: {{ if .Values.postgresql.builtin }}Built-in PostgreSQL{{ else }}External database{{ end }}
- Base URL: {{ .Values.app.baseURL }}

3. Important security notes:
{{- if not .Values.portal.existingSecret }}
- Portal token is stored in plain text in the secret. For production, use portal.existingSecret.
{{- end }}
{{- if not .Values.auth.existingSecret }}
- Auth secret is stored in plain text in the secret. For production, use auth.existingSecret.
{{- end }}
{{- if not .Values.db.existingSecret }}
- Database URL is stored in plain text in the secret. For production, use db.existingSecret.
{{- end }}
{{- if not .Values.developerPortal.tlsRejectUnauthorized }}
- TLS verification is disabled (NODE_TLS_REJECT_UNAUTHORIZED=0). This should only be used in development.
{{- end }}
82 changes: 82 additions & 0 deletions charts/developer-portal-fe/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "developer-portal-fe.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 "developer-portal-fe.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 "developer-portal-fe.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "developer-portal-fe.labels" -}}
helm.sh/chart: {{ include "developer-portal-fe.chart" . }}
{{ include "developer-portal-fe.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "developer-portal-fe.selectorLabels" -}}
app.kubernetes.io/name: {{ include "developer-portal-fe.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "developer-portal-fe.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "developer-portal-fe.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Renders a value that contains template.
Usage:
{{ include "developer-portal-fe.tplvalues.render" (dict "value" .Values.path.to.the.Value "context" $) }}
*/}}
{{- define "developer-portal-fe.tplvalues.render" -}}
{{- if typeIs "string" .value }}
{{- tpl .value .context }}
{{- else}}
{{- tpl (.value | toYaml) .context }}
{{- end}}
{{- end -}}

{{/*
Get the chart-managed secret name
*/}}
{{- define "developer-portal-fe.secretName" -}}
{{- include "developer-portal-fe.fullname" . }}-secrets
{{- end }}
28 changes: 28 additions & 0 deletions charts/developer-portal-fe/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "developer-portal-fe.fullname" . }}-config
namespace: {{ .Release.Namespace | quote }}
labels:
{{- include "developer-portal-fe.labels" . | nindent 4 }}
data:
config.yaml: |
# Portal API connection configuration
portal:
url: {{ .Values.portal.url | quote }}
token: ${PORTAL_TOKEN}
# Database configuration
db:
url: ${DB_URL}
# Authentication configuration
auth:
secret: ${AUTH_SECRET}
# Application configuration
app:
name: "Developer Portal"
baseURL: {{ .Values.app.baseURL | quote }}
trustedOrigins:
{{- toYaml .Values.app.trustedOrigins | nindent 8 }}
Loading
Loading