From dc1e0466c845197485d2d5a35e9d5ee2aaedd7fb Mon Sep 17 00:00:00 2001 From: Johannes Kastl Date: Fri, 6 Dec 2024 14:02:05 +0100 Subject: [PATCH 1/2] charts/opencost/values.yaml: add possibility to create an OpenShift route --- charts/opencost/values.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/charts/opencost/values.yaml b/charts/opencost/values.yaml index 3d57aff..1a42f58 100644 --- a/charts/opencost/values.yaml +++ b/charts/opencost/values.yaml @@ -453,6 +453,22 @@ opencost: # - secretName: chart-example-tls # hosts: # - chart-example.local + route: + # -- OpenShift route for OpenCost UI + enabled: false + # -- Annotations for Ingress resource + annotations: {} + # haproxy.router.openshift.io/timeout: 1m + # @default -- See [values.yaml](values.yaml) + host: example.local + path: + # -- Redirect ingress to an extraPort defined on the service such as oauth-proxy + targetPort: http-ui + # targetPort: oauth-proxy + # -- Ingress TLS configuration + tls: [] + # insecureEdgeTerminationPolicy: Redirect + # termination: edge sigV4Proxy: image: public.ecr.aws/aws-observability/aws-sigv4-proxy:latest From 7147e1e8caa9ed65ec04b02b13e547ee4b1af3ea Mon Sep 17 00:00:00 2001 From: Johannes Kastl Date: Fri, 6 Dec 2024 14:02:14 +0100 Subject: [PATCH 2/2] ADD charts/opencost/templates/route.yaml: OpenShift route --- charts/opencost/templates/route.yaml | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 charts/opencost/templates/route.yaml diff --git a/charts/opencost/templates/route.yaml b/charts/opencost/templates/route.yaml new file mode 100644 index 0000000..e11fc05 --- /dev/null +++ b/charts/opencost/templates/route.yaml @@ -0,0 +1,32 @@ +{{- if and .Values.opencost.ui.enabled .Values.opencost.ui.route.enabled }} +apiVersion: route.openshift.io/v1 +kind: Route +metadata: + name: {{ include "opencost.fullname" . }}-route + namespace: {{ include "opencost.namespace" . }} + labels: {{- include "opencost.labels" . | nindent 4 }} + {{- with .Values.opencost.ui.route.annotations }} + annotations: {{- toYaml . | nindent 4 }} + {{- end }} +spec: + host: {{ .Values.opencost.ui.route.host | quote }} + {{- if .Values.opencost.ui.route.path }} + path: {{ .Values.opencost.ui.route.path }} + {{- end }} + port: + targetPort: {{ .Values.opencost.ui.route.targetPort }} + to: + kind: Service + name: opencost + weight: 100 + wildcardPolicy: None + {{- if .Values.opencost.ui.route.tls }} + tls: + {{- if .Values.opencost.ui.route.tls.insecureEdgeTerminationPolicy }} + insecureEdgeTerminationPolicy: {{ .Values.opencost.ui.route.tls.insecureEdgeTerminationPolicy }} + {{- end }} + {{- if .Values.opencost.ui.route.tls.termination }} + termination: {{ .Values.opencost.ui.route.tls.termination }} + {{- end }} + {{- end }} +{{- end }}