Skip to content

Commit

Permalink
Merge pull request #383 from appuio/portal-env
Browse files Browse the repository at this point in the history
Allow configuring environment variables
  • Loading branch information
ccremer authored Jan 19, 2022
2 parents 676cbcf + 81cced9 commit 0922f5a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion appuio/cloud-portal/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ 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
version: 0.2.0

# Update this value by running `make prepare` as it takes it from values.yaml.
appVersion: v0.0.1
Expand Down
3 changes: 2 additions & 1 deletion appuio/cloud-portal/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cloud-portal

![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: v0.0.1](https://img.shields.io/badge/AppVersion-v0.0.1-informational?style=flat-square)
![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.0.1](https://img.shields.io/badge/AppVersion-v0.0.1-informational?style=flat-square)

APPUiO Cloud Portal (Web Frontend)

Expand Down Expand Up @@ -38,6 +38,7 @@ Edit the README.gotmpl.md template instead.
| podAnnotations | object | `{}` | Annotations to add to the Pod spec. |
| podSecurityContext | object | `{}` | Security context to add to the Pod spec. |
| portal.config | object | `{}` | Arbitrary (nested) keys and values that are put as JSON into `config.json` as a static frontend asset. Don't put secret values here, as this file is publicly accessible. |
| portal.env | object | `{}` | Arbitrary {key:string} values that are used to configure additional environment variables. They are meant to configure NGINX config files (envsubst) |
| replicaCount | int | `1` | |
| resources.limits.memory | string | `"128Mi"` | |
| resources.requests.cpu | string | `"20m"` | |
Expand Down
14 changes: 13 additions & 1 deletion appuio/cloud-portal/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "cloud-portal.fullname" . }}
name: {{ include "cloud-portal.fullname" . }}-frontend
labels:
{{- include "cloud-portal.labels" . | nindent 4 }}
data:
config.json: |
{{- toJson .Values.portal.config | nindent 4 }}
{{- if .Values.portal.env }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "cloud-portal.fullname" . }}-env
labels:
{{- include "cloud-portal.labels" . | nindent 4 }}
data:
{{- toYaml .Values.portal.env | nindent 2 }}
{{- end -}}
7 changes: 6 additions & 1 deletion appuio/cloud-portal/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,17 @@ spec:
- name: config
mountPath: /usr/share/nginx/html/config.json
subPath: config.json
{{- if .Values.portal.env }}
envFrom:
- configMapRef:
name: {{ include "cloud-portal.fullname" . }}-env
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: config
configMap:
name: {{ include "cloud-portal.fullname" . }}
name: {{ include "cloud-portal.fullname" . }}-frontend
items:
- key: config.json
path: config.json
Expand Down
6 changes: 6 additions & 0 deletions appuio/cloud-portal/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ portal:
# Don't put secret values here, as this file is publicly accessible.
config: {}

# -- Arbitrary {key:string} values that are used to configure additional environment variables.
# They are meant to configure NGINX config files (envsubst)
env: {}
# example:
# SOME_KEY: VALUE

serviceAccount:
# -- Specifies whether a service account should be created
create: true
Expand Down

0 comments on commit 0922f5a

Please sign in to comment.