From 0b89e10942960017a708835e9de6e40b3d9a7525 Mon Sep 17 00:00:00 2001 From: Pedro <5179251+pedrohdz@users.noreply.github.com> Date: Mon, 25 Feb 2019 17:12:27 +0100 Subject: [PATCH] [stable/jenkins] Add hostAliases (#11701) Signed-off-by: Pedro Hernandez --- stable/jenkins/Chart.yaml | 2 +- stable/jenkins/README.md | 1 + .../jenkins/templates/jenkins-master-deployment.yaml | 4 ++++ stable/jenkins/values.yaml | 10 ++++++++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/stable/jenkins/Chart.yaml b/stable/jenkins/Chart.yaml index ddea11fee1fa..9efc0ce99102 100755 --- a/stable/jenkins/Chart.yaml +++ b/stable/jenkins/Chart.yaml @@ -1,6 +1,6 @@ name: jenkins home: https://jenkins.io/ -version: 0.32.10 +version: 0.33.0 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 diff --git a/stable/jenkins/README.md b/stable/jenkins/README.md index d0111d32782d..2442821d52d0 100644 --- a/stable/jenkins/README.md +++ b/stable/jenkins/README.md @@ -52,6 +52,7 @@ The following tables list the configurable parameters of the Jenkins chart and t | `Master.UsePodSecurityContext` | Enable pod security context (must be `true` if `RunAsUser` or `FsGroup` are set) | `true` | | `Master.RunAsUser` | uid that jenkins runs with | `0` | | `Master.FsGroup` | uid that will be used for persistent volume | `0` | +| `Master.HostAliases` | Aliases for IPs in `/etc/hosts` | `[]` | | `Master.ServiceAnnotations` | Service annotations | `{}` | | `Master.ServiceType` | k8s service type | `LoadBalancer` | | `Master.ServicePort` | k8s service port | `8080` | diff --git a/stable/jenkins/templates/jenkins-master-deployment.yaml b/stable/jenkins/templates/jenkins-master-deployment.yaml index 6ec247bc0e5d..779662baf646 100644 --- a/stable/jenkins/templates/jenkins-master-deployment.yaml +++ b/stable/jenkins/templates/jenkins-master-deployment.yaml @@ -65,6 +65,10 @@ spec: hostNetwork: true dnsPolicy: ClusterFirstWithHostNet {{- end }} + {{- if .Values.Master.HostAliases }} + hostAliases: + {{- toYaml .Values.Master.HostAliases | nindent 8 }} + {{- end }} initContainers: - name: "copy-default-config" image: "{{ .Values.Master.Image }}:{{ .Values.Master.ImageTag }}" diff --git a/stable/jenkins/values.yaml b/stable/jenkins/values.yaml index 6bcf59398864..d3f42f350ea8 100644 --- a/stable/jenkins/values.yaml +++ b/stable/jenkins/values.yaml @@ -258,6 +258,16 @@ Master: # - jenkins.cluster.local AdditionalConfig: {} + # Master.HostAliases allows for adding entries to Pod /etc/hosts: + # https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/ + HostAliases: [] + # - ip: 192.168.50.50 + # hostnames: + # - something.local + # - ip: 10.0.50.50 + # hostnames: + # - other.local + Agent: Enabled: true Image: jenkins/jnlp-slave