Skip to content

Commit 1818ff3

Browse files
feat: add Ingress for opencost UI (#41)
* feat: add Ingress for UI * version bump Signed-off-by: Rafał Boniecki <rafal@boniecki.cc> * Documentation for all possible values Co-authored-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com> Signed-off-by: Rafał Boniecki <rafal@boniecki.cc> --------- Signed-off-by: Rafał Boniecki <rafal@boniecki.cc> Co-authored-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
1 parent 74a68da commit 1818ff3

File tree

3 files changed

+60
-1
lines changed

3 files changed

+60
-1
lines changed

charts/opencost/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ keywords:
99
- kubecost
1010
- opencost
1111
- monitoring
12-
version: 1.7.0
12+
version: 1.8.0
1313
maintainers:
1414
- name: mattray
1515
url: https://mattray.dev
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{{- if and .Values.opencost.ui.enabled .Values.opencost.ui.ingress.enabled -}}
2+
apiVersion: networking.k8s.io/v1
3+
kind: Ingress
4+
metadata:
5+
name: {{ include "opencost.fullname" . }}-ingress
6+
labels:
7+
{{- include "opencost.labels" . | nindent 4 }}
8+
{{- with .Values.opencost.ui.ingress.annotations }}
9+
annotations: {{ toYaml .Values.opencost.ui.ingress.annotations | nindent 4 }}
10+
{{- end }}
11+
spec:
12+
{{- if .Values.opencost.ui.ingress.ingressClassName }}
13+
ingressClassName: {{ .Values.opencost.ui.ingress.ingressClassName }}
14+
{{- end }}
15+
{{- if .Values.opencost.ui.ingress.tls }}
16+
tls:
17+
{{- range .Values.opencost.ui.ingress.tls }}
18+
- hosts:
19+
{{- range .hosts }}
20+
- {{ . | quote }}
21+
{{- end }}
22+
secretName: {{ .secretName }}
23+
{{- end }}
24+
{{- end }}
25+
rules:
26+
{{- range .Values.opencost.ui.ingress.hosts }}
27+
- host: {{ .host | quote }}
28+
http:
29+
paths:
30+
{{- range .paths }}
31+
- path: {{ . }}
32+
pathType: Prefix
33+
backend:
34+
service:
35+
name: {{ include "opencost.fullname" $ }}
36+
port:
37+
name: http-ui
38+
{{- end }}
39+
{{- end }}
40+
{{- end }}

charts/opencost/values.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,25 @@ opencost:
136136
# -- A list of volume mounts to be added to the pod
137137
extraVolumeMounts: []
138138

139+
ingress:
140+
# -- Ingress for OpenCost UI
141+
enabled: false
142+
# -- Ingress controller which implements the resource
143+
ingressClassName: ""
144+
# -- Annotations for Ingress resource
145+
annotations: {}
146+
# kubernetes.io/tls-acme: "true"
147+
# -- A list of host rules used to configure the Ingress
148+
# @default -- See [values.yaml](values.yaml)
149+
hosts:
150+
- host: example.local
151+
paths:
152+
- /
153+
# -- Ingress TLS configuration
154+
tls: []
155+
# - secretName: chart-example-tls
156+
# hosts:
157+
# - chart-example.local
139158
# -- Toleration labels for pod assignment
140159
tolerations: []
141160
# -- Node labels for pod assignment

0 commit comments

Comments
 (0)