From eafd8a84298c2157c77a04020ca69b5c1f9d156c Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Thu, 28 Apr 2022 11:17:49 +0200 Subject: [PATCH] feat: add optional ingress for jenkins-agents --- charts/kubezero-ci/Chart.yaml | 4 ++-- .../templates/jenkins/istio-service.yaml | 19 +++++++++++++++++++ charts/kubezero-ci/values.yaml | 6 ++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/charts/kubezero-ci/Chart.yaml b/charts/kubezero-ci/Chart.yaml index f840cf2b..9ad5e332 100644 --- a/charts/kubezero-ci/Chart.yaml +++ b/charts/kubezero-ci/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: kubezero-ci description: KubeZero umbrella chart for all things CI type: application -version: 0.4.45 +version: 0.4.46 home: https://kubezero.com icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png keywords: @@ -26,7 +26,7 @@ dependencies: repository: https://dl.gitea.io/charts/ condition: gitea.enabled - name: jenkins - version: 3.11.10 + version: 3.12.0 repository: https://charts.jenkins.io condition: jenkins.enabled - name: trivy diff --git a/charts/kubezero-ci/templates/jenkins/istio-service.yaml b/charts/kubezero-ci/templates/jenkins/istio-service.yaml index 300aef0e..c84e33b5 100644 --- a/charts/kubezero-ci/templates/jenkins/istio-service.yaml +++ b/charts/kubezero-ci/templates/jenkins/istio-service.yaml @@ -44,4 +44,23 @@ spec: method: exact: "POST" {{- end }} +{{- if .Values.jenkins.istio.agent.enabled }} +--- +apiVersion: networking.istio.io/v1beta1 +kind: VirtualService +metadata: + name: {{ template "kubezero-lib.fullname" (merge (dict "subchart" "jenkins") .) }}-agent + namespace: {{ template "jenkins.namespace" . }} +spec: + hosts: + - {{ .Values.jenkins.istio.agent.url }} + gateways: + - {{ .Values.jenkins.istio.agent.gateway }} + http: + - route: + - destination: + host: {{ template "kubezero-lib.fullname" (merge (dict "subchart" "jenkins") .) }} + port: + number: 50000 +{{- end }} {{- end }} diff --git a/charts/kubezero-ci/values.yaml b/charts/kubezero-ci/values.yaml index e4674655..aa1a9aa0 100644 --- a/charts/kubezero-ci/values.yaml +++ b/charts/kubezero-ci/values.yaml @@ -194,6 +194,12 @@ jenkins: gateway: istio-ingress/ingressgateway url: jenkins-webhook.example.com + # Remote Agents + agent: + enabled: false + gateway: istio-ingress/private-ingressgateway + url: jenkins-agent.example.com + trivy: enabled: false persistence: