Skip to content

Commit 783d670

Browse files
authored
Add secondary ingress (#63)
1 parent ba723ae commit 783d670

File tree

4 files changed

+70
-1
lines changed

4 files changed

+70
-1
lines changed

charts/jenkins/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@ Use the following links to reference issues, PRs, and commits prior to v2.6.0.
1010

1111
The change log until v1.5.7 was auto-generated based on git commits. Those entries include a reference to the git commit to be able to get more details.
1212

13+
## 2.7.0
14+
15+
Add a secondary ingress template for those who want a second ingress with different labels or annotations or whatever else.
16+
17+
Example: You want /github-webhook to be on a public ingress, while the main Jenkins intance to be on a private locked down ingress.
18+
1319
## 2.6.5
20+
1421
Update configScripts example
1522

1623
## 2.6.4

charts/jenkins/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
name: jenkins
33
home: https://jenkins.io/
4-
version: 2.6.5
4+
version: 2.7.0
55
appVersion: lts
66
description: Open source continuous integration server. It supports multiple SCM tools
77
including CVS, Subversion and Git. It can execute Apache Ant and Apache Maven-based
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{{- if .Values.master.secondaryingress.enabled }}
2+
{{- $serviceName := include "jenkins.fullname" . -}}
3+
{{- $servicePort := .Values.master.servicePort -}}
4+
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
5+
apiVersion: networking.k8s.io/v1beta1
6+
{{- else -}}
7+
apiVersion: {{ .Values.master.secondaryingress.apiVersion }}
8+
{{- end }}
9+
kind: Ingress
10+
metadata:
11+
namespace: {{ template "jenkins.namespace" . }}
12+
labels:
13+
"app.kubernetes.io/name": '{{ template "jenkins.name" .}}'
14+
"helm.sh/chart": "{{ .Chart.Name }}-{{ .Chart.Version }}"
15+
"app.kubernetes.io/managed-by": "{{ .Release.Service }}"
16+
"app.kubernetes.io/instance": "{{ .Release.Name }}"
17+
"app.kubernetes.io/component": "{{ .Values.master.componentName }}"
18+
{{- if .Values.master.secondaryingress.labels -}}
19+
{{ toYaml .Values.master.secondaryingress.labels | nindent 4 }}
20+
{{- end }}
21+
{{- if .Values.master.secondaryingress.annotations }}
22+
annotations: {{ toYaml .Values.master.secondaryingress.annotations | nindent 4 }}
23+
{{- end }}
24+
name: {{ template "jenkins.fullname" . }}-secondary
25+
spec:
26+
rules:
27+
- host: {{ .Values.master.secondaryingress.hostName }}
28+
http:
29+
paths:
30+
{{- range .Values.master.secondaryingress.paths }}
31+
- path: {{ . | quote }}
32+
backend:
33+
serviceName: {{ $serviceName }}
34+
servicePort: {{ $servicePort }}
35+
{{- end}}
36+
{{- if .Values.master.secondaryingress.tls }}
37+
tls:
38+
{{ toYaml .Values.master.secondaryingress.tls | indent 4 }}
39+
{{- end -}}
40+
{{- end }}

charts/jenkins/values.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,28 @@ master:
404404
# hosts:
405405
# - jenkins.cluster.local
406406

407+
# often you want to have your controller all locked down and private
408+
# but you still want to get webhooks from your SCM
409+
# A secondary ingress will let you expose different urls
410+
# with a differnt configuration
411+
secondaryingress:
412+
enabled: false
413+
# paths you want forwarded to the backend
414+
# ex /github-webhook
415+
paths: []
416+
# For Kubernetes v1.14+, use 'networking.k8s.io/v1beta1'
417+
apiVersion: "extensions/v1beta1"
418+
labels: {}
419+
annotations: {}
420+
# kubernetes.io/ingress.class: nginx
421+
# kubernetes.io/tls-acme: "true"
422+
# configures the hostname e.g. jenkins-external.example.com
423+
hostName:
424+
tls:
425+
# - secretName: jenkins-external.example.com
426+
# hosts:
427+
# - jenkins-external.example.com
428+
407429
# If you're running on GKE and need to configure a backendconfig
408430
# to finish ingress setup, use the following values.
409431
# Docs: https://cloud.google.com/kubernetes-engine/docs/concepts/backendconfig

0 commit comments

Comments
 (0)