Skip to content

Commit

Permalink
add mapping for devportal to inject cache-control header when loading…
Browse files Browse the repository at this point in the history
… assets
  • Loading branch information
acookin committed Jan 22, 2021
1 parent 02a90bf commit 45e93a6
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion templates/aes-internal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,39 @@ spec:
---
apiVersion: getambassador.io/v2
kind: Mapping
metadata:
name: {{ include "ambassador.fullname" . }}-devportal-assets
labels:
app.kubernetes.io/name: {{ include "ambassador.name" . }}
app.kubernetes.io/part-of: {{ .Release.Name }}
helm.sh/chart: {{ include "ambassador.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Values.deploymentTool }}
app.kubernetes.io/managed-by: {{ .Values.deploymentTool }}
{{- else }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
app.kubernetes.io/component: {{ include "ambassador.name" . }}-devportal-assets
product: aes
spec:
{{- if .Values.env }}
{{- if hasKey .Values.env "AMBASSADOR_ID" }}
ambassador_id: {{ .Values.env.AMBASSADOR_ID | quote }}
{{- end }}
{{- end }}
prefix: /documentation/(assets|styles)/(.*)(.css)
prefix_regex: true
regex_rewrite:
pattern: /documentation/(.*)
substitution: /docs/\1
service: "127.0.0.1:8500"
add_response_headers:
cache-control:
value: "public, max-age=3600, immutable"
append: false
---
apiVersion: getambassador.io/v2
kind: Mapping
metadata:
# This Mapping name is what the demo uses. Sigh.
name: {{ include "ambassador.fullname" . }}-devportal-demo
Expand Down Expand Up @@ -81,4 +114,4 @@ spec:
prefix: /openapi/
rewrite: ""
service: "127.0.0.1:8500"
{{ end }}
{{ end }}

0 comments on commit 45e93a6

Please sign in to comment.