-
Notifications
You must be signed in to change notification settings - Fork 4
feat: create developer-portal-fe helm chart #266
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
Merged
+787
−0
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a69fb51
Initial plan
Claude ed4da35
feat: create developer-portal-fe helm chart
Claude 887a7a6
fix: correct health probe path and PostgreSQL image config
nic-6443 6d0b6c6
fix: independent existingSecret support for portal, db, and auth
nic-6443 af0b76f
fix: use api7/postgresql image to match api7 umbrella chart convention
nic-6443 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| # developer-portal-fe | ||
|
|
||
|    | ||
|
|
||
| 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.