Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/jenkins] Render agent.nodeSelector in pod template JCasC #22431

Merged
merged 1 commit into from
May 18, 2020

Conversation

wmcdona89
Copy link
Collaborator

@wmcdona89 wmcdona89 commented May 17, 2020

What this PR does / why we need it:

Render agent.nodeSelector in the kubernetes pod template JCasC.

Which issue this PR fixes

(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)

  • fixes #

Special notes for your reviewer:

helm template

Given the following in stable/jenkins/agent-values.yaml

agent:
  nodeSelector:
    "app.kubernetes.io/component": "{{ .Values.agent.componentName }}"
    "env": "dev"

default JCasC with auto-reload (jcasc-config.yaml)

helm template stable/jenkins \
--show-only templates/jcasc-config.yaml \
--values stable/jenkins/ci/casc-values.yaml \
--values stable/jenkins/agent-values.yaml

rendering of agent.nodeSelector in kubernetes pod template nodeSelector

data:
  jcasc-default-config.yaml: |-
    jenkins:
      clouds:
      - kubernetes:
          templates:
            - name: "default"
              nodeSelector: app.kubernetes.io/component=jenkins-slave,env=dev

helm install

helm install nodeselector-test stable/jenkins \
--values stable/jenkins/ci/casc-values.yaml \
--values stable/jenkins/agent-values.yaml \
--set master.enableXmlConfig=false

Jenkins Configure Clouds screenshot
image

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

  • DCO signed
  • Chart Version bumped
  • Variables are documented in the README.md
  • Title of the PR starts with chart name (e.g. [stable/mychartname])

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 17, 2020
@helm-bot helm-bot added the Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). label May 17, 2020
@helm-bot helm-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 17, 2020
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 17, 2020
@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@wmcdona89 wmcdona89 changed the title [stable/jenkins] Render agent.volumes in kubernetes pod template JCasC [stable/jenkins] Render agent.nodeSelector in kubernetes pod template JCasC May 18, 2020
@helm-bot helm-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 18, 2020
@wmcdona89 wmcdona89 changed the title [stable/jenkins] Render agent.nodeSelector in kubernetes pod template JCasC [stable/jenkins] Render agent.nodeSelector in pod template JCasC May 18, 2020
@@ -222,6 +222,7 @@ Some third-party systems, e.g. GitHub, use HTML-formatted data in their payload
| `agent.resources` | Resources allocation (Requests and Limits) | `{requests: {cpu: 512m, memory: 512Mi}, limits: {cpu: 512m, memory: 512Mi}}` |
| `agent.volumes` | Additional volumes | `[]` |
| `agent.envVars` | Environment variables for the agent Pod | `[]` |
| `agent.nodeSelector` | Node labels for pod assignment | `{}` |
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was in values.yaml but missing in the README

@wmcdona89 wmcdona89 marked this pull request as ready for review May 18, 2020 03:10
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 18, 2020
@wmcdona89
Copy link
Collaborator Author

/assign @torstenwalter

@wmcdona89
Copy link
Collaborator Author

wmcdona89 commented May 18, 2020

Merge #22400 first.

@torstenwalter
Copy link
Collaborator

@wmcdona89 #22400 is merged now. Can you fix merge conflicts? PR looks for fine for me.

Signed-off-by: Aaron McDonald <wmcdona89@gmail.com>
@helm-bot helm-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 18, 2020
{{- $key }}={{ tpl $value $ }}
{{- $_ := set $local "first" false }}
{{- end }}
{{- end }}
Copy link
Collaborator Author

@wmcdona89 wmcdona89 May 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI. I'd kept this similar to the nodeSelector templating in the XML configuration and had updated it to insert a space at the beginning of the "value"

@wmcdona89
Copy link
Collaborator Author

wmcdona89 commented May 18, 2020

@torstenwalter rebased

Copy link
Collaborator

@torstenwalter torstenwalter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 18, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: torstenwalter, wmcdona89

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit fffc299 into helm:master May 18, 2020
iwilltry42 pushed a commit to iwilltry42/charts that referenced this pull request May 19, 2020
steakunderscore added a commit to steakunderscore/charts that referenced this pull request May 20, 2020
* upstream/master: (46 commits)
  [stable/anchore-engine] Fix upgrade jobs (helm#22451)
  Update MongoDB Exporter (helm#22241)
  [stable/efs-provisioner] Add podLabels support (helm#22439)
  [stable/rabbitmq-ha]  add configuration for initContainer (helm#22005)
  fix: missing labels in secret object (helm#21756)
  [stable/openebs]: fix README image repository typo (helm#22445)
  [stable/graylog] Adding option to define environment variables in raw yaml format (helm#22007)
  [stable/anchore-engine] Allow loading custom CA certificate (helm#22440)
  [stable/jenkins] Cleanup agent.yamlTemplate rendering in XML config (helm#22124)
  [stable/spring-cloud-data-flow] Update to new SCDF version 2.5.1 (helm#22438)
  [stable/neo4j] Deprecated. replacement: https://github.com/neo4j-contrib/neo4j-helm (helm#22437)
  [stable/jenkins] Render agent.nodeSelector in pod template JCasC (helm#22431)
  [incubator/sparkoperator] Add webhookNamespaceSelector (helm#22434)
  [stable/jenkins] Adding override for ingress paths (helm#22400)
  stable/unifi implements subPath functionality (helm#22432)
  [stable/prometheus] Add Namespace to applicable Resources (helm#22378)
  [incubator/patroni] Update patroni to 1.5-p5 (helm#21986)
  [kube2iam] - add labels to ServiceMonitor (helm#21605)
  [stable/fluent-bit] Enabling dnsConfig option in the Chart (helm#22419)
  [stable/jenkins] add k8s plugin config parameters (helm#22403)
  ...
irlevesque pushed a commit to quantopian/charts that referenced this pull request Jul 13, 2020
…m#22431)

Signed-off-by: Aaron McDonald <wmcdona89@gmail.com>
includerandom pushed a commit to includerandom/helm_charts that referenced this pull request Jul 19, 2020
li-adrienloiseau pushed a commit to li-adrienloiseau/charts that referenced this pull request Jul 29, 2020
…m#22431)

Signed-off-by: Aaron McDonald <wmcdona89@gmail.com>
Signed-off-by: Adrien Loiseau <adrien.loiseau@logic-immo.com>
mmingorance-dh pushed a commit to mmingorance-dh/charts that referenced this pull request Aug 28, 2020
…m#22431)

Signed-off-by: Aaron McDonald <wmcdona89@gmail.com>
Signed-off-by: Miguel Mingorance <miguel.mingorance@deliveryhero.com>
wmcdona89 added a commit to wmcdona89/charts that referenced this pull request Aug 30, 2020
…m#22431)

Signed-off-by: Aaron McDonald <wmcdona89@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants