Skip to content

Commit

Permalink
feat: ciarans attempt at solution
Browse files Browse the repository at this point in the history
  • Loading branch information
ciaransweet committed Oct 28, 2024
1 parent 5fdfec0 commit fd538cb
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,29 @@ metadata:
helm.sh/chart: webapp-polder-0.1.0
app.kubernetes.io/name: webapp-polder
app.kubernetes.io/instance: test
app.kubernetes.io/version: "0.1.0"
app.kubernetes.io/version: "0.2.0"
app.kubernetes.io/managed-by: Helm
automountServiceAccountToken: true
---
# Source: webapp-polder/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: webapp-polder-configmap
labels:
helm.sh/chart: webapp-polder-0.1.0
app.kubernetes.io/name: webapp-polder
app.kubernetes.io/instance: test
app.kubernetes.io/version: "0.2.0"
app.kubernetes.io/managed-by: Helm
data:
app_config.js: |
window.__APP_CONFIG__ = {
MAPBOX_TOKEN: "pk.eyJ1IjoiZGV2c2VlZCIsImEiOiJnUi1mbkVvIn0.018aLhX0Mb0tdtaT2QNe2Q",
STAC_API: "https://rx3hna9pbg.execute-api.eu-central-1.amazonaws.com",
TILER_API: "https://zbrrek3x0i.execute-api.eu-central-1.amazonaws.com",
};
---
# Source: webapp-polder/templates/service.yaml
apiVersion: v1
kind: Service
Expand All @@ -21,7 +40,7 @@ metadata:
helm.sh/chart: webapp-polder-0.1.0
app.kubernetes.io/name: webapp-polder
app.kubernetes.io/instance: test
app.kubernetes.io/version: "0.1.0"
app.kubernetes.io/version: "0.2.0"
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
Expand All @@ -43,7 +62,7 @@ metadata:
helm.sh/chart: webapp-polder-0.1.0
app.kubernetes.io/name: webapp-polder
app.kubernetes.io/instance: test
app.kubernetes.io/version: "0.1.0"
app.kubernetes.io/version: "0.2.0"
app.kubernetes.io/managed-by: Helm
spec:
replicas: 1
Expand All @@ -57,7 +76,7 @@ spec:
helm.sh/chart: webapp-polder-0.1.0
app.kubernetes.io/name: webapp-polder
app.kubernetes.io/instance: test
app.kubernetes.io/version: "0.1.0"
app.kubernetes.io/version: "0.2.0"
app.kubernetes.io/managed-by: Helm
spec:
serviceAccountName: test-webapp-polder
Expand All @@ -67,7 +86,7 @@ spec:
- name: webapp-polder
securityContext:
{}
image: "nginx:0.1.0"
image: "ghcr.io/developmentseed/polder:dev"
imagePullPolicy: IfNotPresent
ports:
- name: http
Expand All @@ -83,6 +102,14 @@ spec:
port: http
resources:
{}
volumeMounts:
- mountPath: /usr/share/nginx/html/app_config.js
name: webapp-polder-config
subPath: app_config.js
volumes:
- configMap:
name: webapp-polder-configmap
name: webapp-polder-config
---
# Source: webapp-polder/templates/tests/test-connection.yaml
apiVersion: v1
Expand All @@ -93,7 +120,7 @@ metadata:
helm.sh/chart: webapp-polder-0.1.0
app.kubernetes.io/name: webapp-polder
app.kubernetes.io/instance: test
app.kubernetes.io/version: "0.1.0"
app.kubernetes.io/version: "0.2.0"
app.kubernetes.io/managed-by: Helm
annotations:
"helm.sh/hook": test
Expand Down
9 changes: 9 additions & 0 deletions deployment/helm/webapp-polder/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: webapp-polder-configmap
labels:
{{- include "webapp-polder.labels" . | nindent 4 }}
data: {{ with .Values.config }}
{{- toYaml . | nindent 2}}
{{- end }}
18 changes: 16 additions & 2 deletions deployment/helm/webapp-polder/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,20 @@ autoscaling:
# targetMemoryUtilizationPercentage: 80

# Additional volumes on the output Deployment definition.
volumes: []
volumes:
- name: webapp-polder-config
configMap:
name: webapp-polder-configmap
# - name: foo
# secret:
# secretName: mysecret
# optional: false

# Additional volumeMounts on the output Deployment definition.
volumeMounts: []
volumeMounts:
- name: webapp-polder-config
mountPath: /usr/share/nginx/html/app_config.js
subPath: app_config.js
# - name: foo
# mountPath: "/etc/foo"
# readOnly: true
Expand All @@ -121,3 +127,11 @@ nodeSelector: {}
tolerations: []

affinity: {}

config:
app_config.js: |
window.__APP_CONFIG__ = {
MAPBOX_TOKEN: "pk.eyJ1IjoiZGV2c2VlZCIsImEiOiJnUi1mbkVvIn0.018aLhX0Mb0tdtaT2QNe2Q",
STAC_API: "https://rx3hna9pbg.execute-api.eu-central-1.amazonaws.com",
TILER_API: "https://zbrrek3x0i.execute-api.eu-central-1.amazonaws.com",
};

0 comments on commit fd538cb

Please sign in to comment.