Skip to content

Commit

Permalink
Add secondary ingress
Browse files Browse the repository at this point in the history
  • Loading branch information
halkeye committed Sep 18, 2020
1 parent f251fce commit a6ed240
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/jenkins/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: jenkins
home: https://jenkins.io/
version: 2.6.4
version: 2.6.5
appVersion: lts
description: Open source continuous integration server. It supports multiple SCM tools
including CVS, Subversion and Git. It can execute Apache Ant and Apache Maven-based
Expand Down
40 changes: 40 additions & 0 deletions charts/jenkins/templates/jenkins-master-secondary-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{{- if .Values.master.secondaryingress.enabled }}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: {{ .Values.master.secondaryingress.apiVersion }}
{{- end }}
kind: Ingress
metadata:
namespace: {{ template "jenkins.namespace" . }}
labels:
"app.kubernetes.io/name": '{{ template "jenkins.name" .}}'
"helm.sh/chart": "{{ .Chart.Name }}-{{ .Chart.Version }}"
"app.kubernetes.io/managed-by": "{{ .Release.Service }}"
"app.kubernetes.io/instance": "{{ .Release.Name }}"
"app.kubernetes.io/component": "{{ .Values.master.componentName }}"
{{- if .Values.master.secondaryingress.labels }}
{{ toYaml .Values.master.secondaryingress.labels | indent 4 }}
{{- end }}
{{- if .Values.master.secondaryingress.annotations }}
annotations:
{{ toYaml .Values.master.secondaryingress.annotations | indent 4 }}
{{- end }}
name: {{ template "jenkins.fullname" . }}
spec:
rules:
- host:
http:
paths:
- path: /testpath
backend:
serviceName: {{ template "jenkins.fullname" . }}
servicePort: {{ .Values.master.servicePort }}
{{- if .Values.master.secondaryingress.hostName }}
host: {{ .Values.master.secondaryingress.hostName | quote }}
{{- end }}
{{- if .Values.master.secondaryingress.tls }}
tls:
{{ toYaml .Values.master.secondaryingress.tls | indent 4 }}
{{- end -}}
{{- end }}
22 changes: 22 additions & 0 deletions charts/jenkins/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,28 @@ master:
# - secretName: jenkins.cluster.local
# hosts:
# - jenkins.cluster.local

# often you want to have your controller all locked down and private
# but you still want to get webhooks from your SCM
# A secondary ingress will let you expose different urls
# with a differnt configuration
secondaryingress:
enabled: false
# paths you want forwarded to the backend
# ex /github-webhook
paths: []
# For Kubernetes v1.14+, use 'networking.k8s.io/v1beta1'
apiVersion: "extensions/v1beta1"
labels: {}
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
# configures the hostname e.g. jenkins-external.example.com
hostName:
tls:
# - secretName: jenkins-external.example.com
# hosts:
# - jenkins-external.example.com

# If you're running on GKE and need to configure a backendconfig
# to finish ingress setup, use the following values.
Expand Down

0 comments on commit a6ed240

Please sign in to comment.