diff --git a/charts/nbs6/templates/ingress-cached.yaml b/charts/nbs6/templates/ingress-cached.yaml new file mode 100644 index 000000000..16a5f63bf --- /dev/null +++ b/charts/nbs6/templates/ingress-cached.yaml @@ -0,0 +1,35 @@ +{{- if .Values.ingress.enabled }} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-ingress-cached + namespace: {{ .Release.Namespace }} + {{- with .Values.ingress.annotationsCached }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + tls: + {{- range .Values.ingress.tlsCached }} + - secretName: {{ .secretName }} + hosts: + {{- range .hosts }} + - {{ . }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.rulesCached }} + - host: {{ .host }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + pathType: {{ .pathType }} + backend: + service: + name: {{ $.Release.Name }}-service + port: + number: {{ $.Values.service.ports.https }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/nbs6/templates/ingress.yaml b/charts/nbs6/templates/ingress.yaml index e8b9d3b3e..36bf97b2e 100644 --- a/charts/nbs6/templates/ingress.yaml +++ b/charts/nbs6/templates/ingress.yaml @@ -4,10 +4,10 @@ kind: Ingress metadata: name: {{ .Release.Name }}-ingress namespace: {{ .Release.Namespace }} + {{- with .Values.ingress.annotations }} annotations: - {{- range $key, $value := .Values.ingress.annotations }} - {{ $key }}: "{{ $value }}" - {{- end }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: tls: {{- range .Values.ingress.tls }} diff --git a/charts/nbs6/values.yaml b/charts/nbs6/values.yaml index b3d4e6e5e..81249f2d6 100644 --- a/charts/nbs6/values.yaml +++ b/charts/nbs6/values.yaml @@ -29,7 +29,25 @@ ingress: - host: app-classic.example.com paths: - path: / - pathType: Prefix + pathType: Prefix + annotationsCached: + kubernetes.io/ingress.class: "nginx" + nginx.ingress.kubernetes.io/service-upstream: "true" + nginx.ingress.kubernetes.io/configuration-snippet: | + more_set_headers "X-Frame-Options: Allow"; + more_set_headers "Cross-Origin-Opener-Policy: same-origin"; + more_set_headers "Cache-Content: max-age=1209600, immutable"; + tlsCached: + - secretName: app-classic.example.com + hosts: + - app-classic.example.com + rulesCached: + - host: app-classic.example.com + paths: + - path: '/.+\.(jpg|svg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|ttf|woff|woff2)$' + pathType: ImplementationSpecific + + resources: requests: