Skip to content

Commit

Permalink
[stable/jenkins] Add networkPolicy podLabels (helm#22706)
Browse files Browse the repository at this point in the history
* [stable/jenkins] Add networkPolicy podLabels

Signed-off-by: Olivier Vernin <olivier@vernin.me>

* Update changelog

Signed-off-by: Olivier Vernin <olivier@vernin.me>

* Update version to 2.3.0

Signed-off-by: Olivier Vernin <olivier@vernin.me>
Signed-off-by: Miguel Mingorance <miguel.mingorance@deliveryhero.com>
  • Loading branch information
olblak authored and Miguel Mingorance committed Aug 28, 2020
1 parent 7fabf2a commit 69d00e1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions stable/jenkins/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ numbering uses [semantic versioning](http://semver.org).

NOTE: The change log until version 1.5.7 is auto generated based on git commits. Those include a reference to the git commit to be able to get more details.

## 2.3.0

Add an option to specify pod based on labels that can connect to master if NetworkPolicy is enabled

## 2.2.0 increase retry for config auto reload

Configure `REQ_RETRY_CONNECT` to `10` to give Jenkins more time to start up.
Expand Down
2 changes: 1 addition & 1 deletion stable/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.2.0
version: 2.3.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
Expand Down
1 change: 1 addition & 0 deletions stable/jenkins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ The following tables list the configurable parameters of the Jenkins chart and t
| `networkPolicy.enabled` | Enable creation of NetworkPolicy resources. | `false` |
| `networkPolicy.apiVersion` | NetworkPolicy ApiVersion | `networking.k8s.io/v1` |
| `networkPolicy.internalAgents.allowed` | Allow internal agents (from the same cluster) to connect to master. Agent pods would be filtered based on PodLabels. | `false` |
| `networkPolicy.internalAgents.podLabels` | A map of labels (keys/values) that agents pods must have to be able to connect to master. | `{}` |
| `networkPolicy.internalAgents.namespaceLabels` | A map of labels (keys/values) that agents namespaces must have to be able to connect to master. | `{}` |
| `networkPolicy.externalAgents.ipCIDR` | The IP range from which external agents are allowed to connect to master. | `` |
| `networkPolicy.externalAgents.except` | A list of IP sub-ranges to be excluded from the whitelisted IP range. | `[]` |
Expand Down
3 changes: 3 additions & 0 deletions stable/jenkins/templates/jenkins-master-networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ spec:
- podSelector:
matchLabels:
"jenkins/{{ .Release.Name }}-{{ .Values.agent.componentName }}": "true"
{{- range $k,$v:= .Values.networkPolicy.internalAgents.podLabels }}
{{ $k }}: {{ $v }}
{{- end }}
{{- if .Values.networkPolicy.internalAgents.namespaceLabels }}
namespaceSelector:
matchLabels:
Expand Down
1 change: 1 addition & 0 deletions stable/jenkins/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ networkPolicy:
# You can allow agents to connect from both within the cluster (from within specific/all namespaces) AND/OR from a given external IP range
internalAgents:
allowed: true
podLabels: {}
namespaceLabels: {}
# project: myproject
externalAgents: {}
Expand Down

0 comments on commit 69d00e1

Please sign in to comment.