Skip to content

Commit 2d27633

Browse files
authored
Feat: add HTTPRoute support (#1620)
1 parent 72d25f8 commit 2d27633

7 files changed

Lines changed: 275 additions & 130 deletions

File tree

charts/jenkins/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ Use the following links to reference issues, PRs, and commits prior to v2.6.0.
1212
The changelog until v1.5.7 was auto-generated based on git commits.
1313
Those entries include a reference to the git commit to be able to get more details.
1414

15+
## 5.9.0
16+
17+
Added [Gateway API](https://gateway-api.sigs.k8s.io/api-types/httproute/) support
18+
1519
## 5.8.142
1620

1721
Update `jenkins/jenkins` to version `2.541.2-jdk21`

charts/jenkins/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: jenkins
33
type: application
44
home: https://www.jenkins.io/
5-
version: 5.8.142
5+
version: 5.9.0
66
appVersion: 2.541.2
77
description: >
88
Jenkins - Build great things at any scale! As the leading open source automation server, Jenkins provides over 2000 plugins to support building, deploying and automating any project.

charts/jenkins/VALUES.md

Lines changed: 136 additions & 129 deletions
Large diffs are not rendered by default.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{{- if .Values.controller.httpRoute.enabled }}
2+
{{- $root := . }}
3+
{{- $hostnames := (list) }}
4+
{{- if .Values.controller.httpRoute.reuseIngressConfiguration }}
5+
{{- if .Values.controller.ingress.hostName }}
6+
{{- $hostnames = append $hostnames .Values.controller.ingress.hostName }}
7+
{{- end }}
8+
{{- if .Values.controller.ingress.resourceRootUrl }}
9+
{{- $hostnames = append $hostnames .Values.controller.ingress.resourceRootUrl }}
10+
{{- end }}
11+
{{- else }}
12+
{{- $hostnames = default (list) .Values.controller.httpRoute.hostnames }}
13+
{{- end }}
14+
apiVersion: {{ .Values.controller.httpRoute.apiVersion }}
15+
kind: {{ .Values.controller.httpRoute.kind }}
16+
metadata:
17+
name: {{ include "jenkins.fullname" . }}
18+
labels:
19+
{{- include "jenkins.labels" . | nindent 4 }}
20+
spec:
21+
{{- with .Values.controller.httpRoute.parentRefs }}
22+
parentRefs:
23+
{{- toYaml . | nindent 4 }}
24+
{{- end }}
25+
hostnames:
26+
{{- range $hostnames }}
27+
- {{ . | quote }}
28+
{{- end }}
29+
rules:
30+
{{- if .Values.controller.httpRoute.extraRules }}
31+
{{- toYaml .Values.controller.httpRoute.extraRules | nindent 2 }}
32+
{{- end }}
33+
- backendRefs:
34+
- name: {{ include "jenkins.fullname" $root }}
35+
port: {{ $root.Values.controller.servicePort }}
36+
{{- end }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
matches snapshot:
2+
1: |
3+
hostnames:
4+
- external.jenkins.example.com
5+
- internal.jenkins.example.com
6+
parentRefs:
7+
- name: shared-gateway
8+
namespace: networking
9+
rules:
10+
- backendRefs:
11+
- name: my-release-jenkins
12+
port: 8080
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
suite: Controller HTTPRoute
2+
release:
3+
name: my-release
4+
namespace: my-namespace
5+
templates:
6+
- jenkins-controller-httproute.yaml
7+
tests:
8+
- it: reuses ingress hostnames when reuse is enabled
9+
set:
10+
controller:
11+
ingress:
12+
hostName: jenkins.example.com
13+
resourceRootUrl: root.jenkins.example.com
14+
httpRoute:
15+
enabled: true
16+
apiVersion: gateway.networking.k8s.io/v1
17+
kind: HTTPRoute
18+
reuseIngressConfiguration: true
19+
parentRefs:
20+
- name: shared-gateway
21+
namespace: networking
22+
asserts:
23+
- isKind:
24+
of: HTTPRoute
25+
- equal:
26+
path: spec.hostnames
27+
value:
28+
- jenkins.example.com
29+
- root.jenkins.example.com
30+
- it: uses explicit hostnames when reuse is disabled
31+
set:
32+
controller:
33+
httpRoute:
34+
enabled: true
35+
apiVersion: gateway.networking.k8s.io/v1
36+
kind: HTTPRoute
37+
reuseIngressConfiguration: false
38+
hostnames:
39+
- external.jenkins.example.com
40+
- internal.jenkins.example.com
41+
parentRefs:
42+
- name: shared-gateway
43+
namespace: networking
44+
asserts:
45+
- isKind:
46+
of: HTTPRoute
47+
- equal:
48+
path: spec.hostnames
49+
value:
50+
- external.jenkins.example.com
51+
- internal.jenkins.example.com
52+
- it: matches snapshot
53+
set:
54+
controller:
55+
httpRoute:
56+
enabled: true
57+
apiVersion: gateway.networking.k8s.io/v1
58+
kind: HTTPRoute
59+
reuseIngressConfiguration: false
60+
hostnames:
61+
- external.jenkins.example.com
62+
- internal.jenkins.example.com
63+
parentRefs:
64+
- name: shared-gateway
65+
namespace: networking
66+
asserts:
67+
- matchSnapshot:
68+
path: spec
69+

charts/jenkins/values.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,23 @@ controller:
807807
# -- Route path
808808
path:
809809

810+
# Gateway API HTTPRoute
811+
httpRoute:
812+
# Toggle to create an HTTPRoute resource alongside the existing ingress definition
813+
enabled: false
814+
apiVersion: "gateway.networking.k8s.io/v1"
815+
kind: HTTPRoute
816+
# specify the Gateway instance to bind the HTTPRoute to.
817+
parentRefs: []
818+
# - name: envoy-gateway-bundle
819+
# namespace: envoy-gateway-system
820+
# Reuse ingress host information if true; set to false to manage hostnames below
821+
reuseIngressConfiguration: false
822+
# Hostnames to use for the http route, only used if reuseIngressConfiguration is false.
823+
hostnames: []
824+
# Extra HTTPRoute rules that will be appended before the default backend
825+
extraRules: []
826+
810827
# -- Allows for adding entries to Pod /etc/hosts
811828
hostAliases: []
812829
# ref: https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/

0 commit comments

Comments
 (0)