Skip to content

Commit

Permalink
allow creating an OpenShift route (#239)
Browse files Browse the repository at this point in the history
* charts/opencost/values.yaml: add possibility to create an OpenShift route

* ADD charts/opencost/templates/route.yaml: OpenShift route

* charts/opencost/Chart.yaml: bump version to 1.45.0

* charts/opencost/templates/route.yaml: add fixes suggested by mittal-ishaan PR239)

* charts/opencost/templates/route.yaml: add brackets
  • Loading branch information
kastl-ars authored Feb 28, 2025
1 parent f6fde32 commit d8553b3
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/opencost/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ keywords:
- finops
- monitoring
- opencost
version: 1.44.1
version: 1.45.0
maintainers:
- name: jessegoodier
- name: toscott
Expand Down
32 changes: 32 additions & 0 deletions charts/opencost/templates/route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{- if and (.Capabilities.APIVersions.Has "route.openshift.io/v1/Route") .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: {{ include "opencost.fullname" . }}
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 }}
16 changes: 16 additions & 0 deletions charts/opencost/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,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
Expand Down

0 comments on commit d8553b3

Please sign in to comment.