Skip to content

Commit f832cb4

Browse files
fabiolucianoclaude
andcommitted
feat: Add HTTPRoute configuration and Grafana integration
- Introduced `httpRoute` configuration in `values.schema.json` and `values.yaml` to enable Gateway API HTTPRoute with customizable properties such as `gatewayName`, `hostnames`, and `prefix`. - Updated `values.yaml` to enable Grafana by default and set MySQL as the database type. - Added HTTPRoute resource for routing traffic to Grafana and UI services. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent a41f4cb commit f832cb4

24 files changed

Lines changed: 550 additions & 340 deletions

charts/devlake/templates/backup-cronjob.yaml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1-
#
2-
# Licensed to the Apache Software Foundation (ASF) under one or more
3-
# contributor license agreements. See the NOTICE file distributed with
4-
# this work for additional information regarding copyright ownership.
5-
# The ASF licenses this file to You under the Apache License, Version 2.0
6-
# (the "License"); you may not use this file except in compliance with
7-
# the License. You may obtain a copy of the License at
8-
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
11-
# Unless required by applicable law or agreed to in writing, software
12-
# distributed under the License is distributed on an "AS IS" BASIS,
13-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
# See the License for the specific language governing permissions and
15-
# limitations under the License.
16-
#
1+
{{/*
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/}}
1717
{{- if .Values.backup.enabled }}
1818
apiVersion: batch/v1
1919
kind: CronJob
2020
metadata:
2121
name: {{ include "devlake.fullname" . }}-backup
22+
namespace: {{ .Release.Namespace }}
2223
labels:
2324
{{- include "devlake.labels" . | nindent 4 }}
2425
app.kubernetes.io/component: backup

charts/devlake/templates/backup-pvc.yaml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1-
#
2-
# Licensed to the Apache Software Foundation (ASF) under one or more
3-
# contributor license agreements. See the NOTICE file distributed with
4-
# this work for additional information regarding copyright ownership.
5-
# The ASF licenses this file to You under the Apache License, Version 2.0
6-
# (the "License"); you may not use this file except in compliance with
7-
# the License. You may obtain a copy of the License at
8-
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
11-
# Unless required by applicable law or agreed to in writing, software
12-
# distributed under the License is distributed on an "AS IS" BASIS,
13-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
# See the License for the specific language governing permissions and
15-
# limitations under the License.
16-
#
1+
{{/*
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/}}
1717
{{- if and .Values.backup.enabled (not .Values.backup.pvc.existingClaim) }}
1818
apiVersion: v1
1919
kind: PersistentVolumeClaim
2020
metadata:
2121
name: {{ include "devlake.fullname" . }}-backup
22+
namespace: {{ .Release.Namespace }}
2223
labels:
2324
{{- include "devlake.labels" . | nindent 4 }}
2425
app.kubernetes.io/component: storage

charts/devlake/templates/configmap.yaml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1-
#
2-
# Licensed to the Apache Software Foundation (ASF) under one or more
3-
# contributor license agreements. See the NOTICE file distributed with
4-
# this work for additional information regarding copyright ownership.
5-
# The ASF licenses this file to You under the Apache License, Version 2.0
6-
# (the "License"); you may not use this file except in compliance with
7-
# the License. You may obtain a copy of the License at
8-
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
11-
# Unless required by applicable law or agreed to in writing, software
12-
# distributed under the License is distributed on an "AS IS" BASIS,
13-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
# See the License for the specific language governing permissions and
15-
# limitations under the License.
16-
#
1+
{{/*
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/}}
1717
---
1818
apiVersion: v1
1919
kind: ConfigMap
2020
metadata:
2121
name: {{ include "devlake.db.configmap" . }}
22+
namespace: {{ .Release.Namespace }}
2223
labels:
2324
{{- include "devlake.labels" . | nindent 4 }}
2425
app.kubernetes.io/component: config

charts/devlake/templates/deployments.yaml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
#
2-
# Licensed to the Apache Software Foundation (ASF) under one or more
3-
# contributor license agreements. See the NOTICE file distributed with
4-
# this work for additional information regarding copyright ownership.
5-
# The ASF licenses this file to You under the Apache License, Version 2.0
6-
# (the "License"); you may not use this file except in compliance with
7-
# the License. You may obtain a copy of the License at
8-
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
11-
# Unless required by applicable law or agreed to in writing, software
12-
# distributed under the License is distributed on an "AS IS" BASIS,
13-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
# See the License for the specific language governing permissions and
15-
# limitations under the License.
16-
#
1+
{{/*
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/}}
1717
---
1818
# devlake-ui
1919
apiVersion: apps/v1
2020
kind: Deployment
2121
metadata:
2222
name: {{ include "devlake.fullname" . }}-ui
23+
namespace: {{ .Release.Namespace }}
2324
labels:
2425
{{- include "devlake.labels" . | nindent 4 }}
2526
app.kubernetes.io/component: ui
@@ -129,6 +130,7 @@ apiVersion: apps/v1
129130
kind: Deployment
130131
metadata:
131132
name: {{ include "devlake.fullname" . }}-lake
133+
namespace: {{ .Release.Namespace }}
132134
labels:
133135
{{- include "devlake.labels" . | nindent 4 }}
134136
app.kubernetes.io/component: lake

charts/devlake/templates/external-secret.yaml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
#
2-
# Licensed to the Apache Software Foundation (ASF) under one or more
3-
# contributor license agreements. See the NOTICE file distributed with
4-
# this work for additional information regarding copyright ownership.
5-
# The ASF licenses this file to You under the Apache License, Version 2.0
6-
# (the "License"); you may not use this file except in compliance with
7-
# the License. You may obtain a copy of the License at
8-
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
11-
# Unless required by applicable law or agreed to in writing, software
12-
# distributed under the License is distributed on an "AS IS" BASIS,
13-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
# See the License for the specific language governing permissions and
15-
# limitations under the License.
16-
#
1+
{{/*
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/}}
1717
{{- if .Values.externalSecrets.enabled }}
1818
---
1919
apiVersion: external-secrets.io/v1beta1
2020
kind: ExternalSecret
2121
metadata:
2222
name: {{ include "devlake.fullname" . }}-external-secret
23+
namespace: {{ .Release.Namespace }}
2324
labels:
2425
{{- include "devlake.labels" . | nindent 4 }}
2526
app.kubernetes.io/component: secret

charts/devlake/templates/extraresources.yaml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
{{/*
2-
#
3-
# Licensed to the Apache Software Foundation (ASF) under one or more
4-
# contributor license agreements. See the NOTICE file distributed with
5-
# this work for additional information regarding copyright ownership.
6-
# The ASF licenses this file to You under the Apache License, Version 2.0
7-
# (the "License"); you may not use this file except in compliance with
8-
# the License. You may obtain a copy of the License at
9-
#
10-
# http://www.apache.org/licenses/LICENSE-2.0
11-
#
12-
# Unless required by applicable law or agreed to in writing, software
13-
# distributed under the License is distributed on an "AS IS" BASIS,
14-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
# See the License for the specific language governing permissions and
16-
# limitations under the License.
17-
#
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
1816
*/}}
1917

2018
{{- if .Values.extraResources }}

charts/devlake/templates/hpa.yaml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
#
2-
# Licensed to the Apache Software Foundation (ASF) under one or more
3-
# contributor license agreements. See the NOTICE file distributed with
4-
# this work for additional information regarding copyright ownership.
5-
# The ASF licenses this file to You under the Apache License, Version 2.0
6-
# (the "License"); you may not use this file except in compliance with
7-
# the License. You may obtain a copy of the License at
8-
#
9-
# http://www.apache.org/licenses/LICENSE-2.0
10-
#
11-
# Unless required by applicable law or agreed to in writing, software
12-
# distributed under the License is distributed on an "AS IS" BASIS,
13-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
# See the License for the specific language governing permissions and
15-
# limitations under the License.
16-
#
1+
{{/*
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/}}
1717
{{- if .Values.lake.hpa.enabled }}
1818
---
1919
apiVersion: autoscaling/v2
2020
kind: HorizontalPodAutoscaler
2121
metadata:
2222
name: {{ include "devlake.fullname" . }}-lake
23+
namespace: {{ .Release.Namespace }}
2324
labels:
2425
{{- include "devlake.labels" . | nindent 4 }}
2526
app.kubernetes.io/component: lake
@@ -46,6 +47,7 @@ apiVersion: autoscaling/v2
4647
kind: HorizontalPodAutoscaler
4748
metadata:
4849
name: {{ include "devlake.fullname" . }}-ui
50+
namespace: {{ .Release.Namespace }}
4951
labels:
5052
{{- include "devlake.labels" . | nindent 4 }}
5153
app.kubernetes.io/component: ui
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{{/*
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/}}
17+
{{- if .Values.httpRoute.enabled -}}
18+
{{- $fullName := include "devlake.fullname" . -}}
19+
{{- $uiServiceName := printf "%s-%s" $fullName "ui" -}}
20+
---
21+
apiVersion: gateway.networking.k8s.io/v1
22+
kind: HTTPRoute
23+
metadata:
24+
name: {{ $fullName }}
25+
namespace: {{ .Release.Namespace }}
26+
labels:
27+
{{- include "devlake.labels" . | nindent 4 }}
28+
app.kubernetes.io/component: httproute
29+
{{- with .Values.httpRoute.extraLabels }}
30+
{{- toYaml . | nindent 4 }}
31+
{{- end }}
32+
annotations:
33+
{{- include "devlake.annotations" . | nindent 4 }}
34+
{{- with .Values.httpRoute.annotations }}
35+
{{- toYaml . | nindent 4 }}
36+
{{- end }}
37+
spec:
38+
parentRefs:
39+
- name: {{ .Values.httpRoute.gatewayName }}
40+
{{- if .Values.httpRoute.gatewayNamespace }}
41+
namespace: {{ .Values.httpRoute.gatewayNamespace }}
42+
{{- end }}
43+
{{- if .Values.httpRoute.sectionName }}
44+
sectionName: {{ .Values.httpRoute.sectionName }}
45+
{{- end }}
46+
{{- if .Values.httpRoute.hostnames }}
47+
hostnames:
48+
{{- range .Values.httpRoute.hostnames }}
49+
- {{ . | quote }}
50+
{{- end }}
51+
{{- end }}
52+
rules:
53+
{{- if .Values.grafana.enabled }}
54+
- matches:
55+
- path:
56+
type: PathPrefix
57+
value: /{{ include "devlake.grafanaEndpointPrefix" . }}
58+
backendRefs:
59+
- name: {{ .Values.grafana.ingressServiceName | default ( include "grafana.fullname" (dict "Values" .Values.grafana "Chart" (dict "Name" "grafana") "Release" .Release ) ) }}
60+
port: {{ .Values.grafana.ingressServicePort | default .Values.grafana.service.port | default 80 }}
61+
{{- end }}
62+
- matches:
63+
- path:
64+
type: PathPrefix
65+
value: {{ .Values.httpRoute.prefix | default "/" }}
66+
backendRefs:
67+
- name: {{ $uiServiceName }}
68+
port: 4000
69+
{{- end }}

0 commit comments

Comments
 (0)