Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-50664] added missing fixed jenkins slave labels #320

Closed
wants to merge 1 commit into from

Conversation

antoniaklja
Copy link

@antoniaklja antoniaklja commented May 7, 2018

Regarding following issue https://issues.jenkins-ci.org/browse/JENKINS-50664

Jenkins slave pod doesn't have fixed label which can be used for generic NetworkPolicy to secure master-slave communication within Kubernetes namespace.

Example policy for JNLP access:

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: jenkins
  namespace: XXX
spec:
  podSelector:
    matchLabels:
      run: jenkins-master-XXX
  policyTypes:
  - Ingress
  ingress:
   - from:
    - podSelector:
        matchLabels:
          jenkins/slave: true
    ports:
    - protocol: TCP
      port: 50000

ofc it might be different label but should be present on every jenkins slave Pod.

@carlossg
Copy link
Contributor

carlossg commented May 7, 2018

were you trying to write a test that fails to show the issue ? because the test is passing

@carlossg
Copy link
Contributor

carlossg commented May 7, 2018

ah sorry, missed the one line

if (!labelSet.isEmpty()) {
for (LabelAtom label : labelSet) {
builder.put("jenkins/slave", "true");
Copy link

@hrishin hrishin May 11, 2018

Choose a reason for hiding this comment

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

Expecting default labels as follow, right?

labels:
   jenkins : 'slave'

rather than

labels:
   jenkins/slave : true

@carlossg
Copy link
Contributor

I think #322 is doing the correct fix for this one

@carlossg carlossg changed the title JENKINS-50664 added missing fixed jenkins slave labels [JENKINS-50664] added missing fixed jenkins slave labels May 22, 2018
@carlossg
Copy link
Contributor

Fixed in #325

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants