From 003be5f0689102eb7a326a601c4981b9773abecc Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Sat, 6 Nov 2021 21:30:32 +0100 Subject: [PATCH] feat: add istio support to kubezero-ci/gocd --- charts/kubezero-ci/Chart.yaml | 3 +++ charts/kubezero-ci/README.md | 6 ++++++ .../templates/gocd/istio-service.yaml | 18 ++++++++++++++++++ charts/kubezero-ci/values.yaml | 5 +++++ 4 files changed, 32 insertions(+) create mode 100644 charts/kubezero-ci/templates/gocd/istio-service.yaml diff --git a/charts/kubezero-ci/Chart.yaml b/charts/kubezero-ci/Chart.yaml index de3f873..4c329d2 100644 --- a/charts/kubezero-ci/Chart.yaml +++ b/charts/kubezero-ci/Chart.yaml @@ -12,6 +12,9 @@ keywords: maintainers: - name: Quarky9 dependencies: + - name: kubezero-lib + version: ">= 0.1.4" + repository: https://zero-down-time.github.io/kubezero/ - name: gocd version: 1.39.4 repository: https://gocd.github.io/helm-chart diff --git a/charts/kubezero-ci/README.md b/charts/kubezero-ci/README.md index 9d17283..4842a8c 100644 --- a/charts/kubezero-ci/README.md +++ b/charts/kubezero-ci/README.md @@ -19,6 +19,7 @@ Kubernetes: `>= 1.18.0` | Repository | Name | Version | |------------|------|---------| | https://gocd.github.io/helm-chart | gocd | 1.39.4 | +| https://zero-down-time.github.io/kubezero/ | kubezero-lib | >= 0.1.4 | # Jenkins @@ -31,4 +32,9 @@ Kubernetes: `>= 1.18.0` | Key | Type | Default | Description | |-----|------|---------|-------------| | gocd.enabled | bool | `false` | | +| gocd.istio.enabled | bool | `false` | | +| gocd.istio.gateway | string | `"istio-ingress/private-ingressgateway"` | | +| gocd.istio.url | string | `""` | | +| gocd.server.ingress.enabled | bool | `false` | | +| gocd.server.service.type | string | `"ClusterIP"` | | | jenkins.enabled | bool | `false` | | diff --git a/charts/kubezero-ci/templates/gocd/istio-service.yaml b/charts/kubezero-ci/templates/gocd/istio-service.yaml new file mode 100644 index 0000000..3a59541 --- /dev/null +++ b/charts/kubezero-ci/templates/gocd/istio-service.yaml @@ -0,0 +1,18 @@ +{{- if and .Values.gocd.enabled .Values.gocd.istio.enabled }} +apiVersion: networking.istio.io/v1beta1 +kind: VirtualService +metadata: + name: {{ include "kubezero-lib.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "kubezero-lib.labels" . | nindent 4 }} +spec: + gateways: + - {{ .Values.gocd.istio.gateway }} + hosts: + - {{ .Values.gocd.istio.url }} + http: + - route: + - destination: + host: {{ .Release.Name }}-gocd-server +{{- end }} diff --git a/charts/kubezero-ci/values.yaml b/charts/kubezero-ci/values.yaml index 9e6b2c4..23a436e 100644 --- a/charts/kubezero-ci/values.yaml +++ b/charts/kubezero-ci/values.yaml @@ -7,5 +7,10 @@ gocd: ingress: enabled: false + istio: + enabled: false + gateway: istio-ingress/private-ingressgateway + url: "" # gocd.example.com + jenkins: enabled: false