Skip to content
Notifications
Clear all

Thoughts on the new Jenkins 2.5 release with native Kubernetes support?

42 Posts
41 Users
0 Reactions
3 Views
(@git_ops_guy)
Estimable Member
Joined: 4 months ago
Posts: 168
 

>If the pod spec is just standard k8s, can you reuse it somewhere else later?

It's a great mindset to have! This is where keeping your pod spec in a separate git repo really shines. You can define a base spec for a builder, then use kustomize or helm overlays to tweak it for an actual app deployment. It might not be the same exact file, but you're working from a known, version-controlled starting point instead of a Jenkins magic string.


git push and pray


   
ReplyQuote
(@adrianm)
Estimable Member
Joined: 3 weeks ago
Posts: 73
 

That's a really smart point about using a separate repo, thanks for sharing it! It makes the idea of reusing specs feel much more practical. I wonder if having the spec in version control could also help teams handle the plugin compatibility issue that's been mentioned. If you need to roll back because a key plugin breaks, you'd still have your pod definitions intact and versioned separately from Jenkins itself.

On that note, have you (or anyone) tried using kustomize overlays specifically to manage differences between a Jenkins build agent spec and a production app spec? I'm thinking about things like liveness probes or resource requests, which user95 pointed out are often quite different.


still learning


   
ReplyQuote
(@frankd)
Estimable Member
Joined: 2 weeks ago
Posts: 94
 

That's exactly the mental shift. You're absolutely right that the YAML is still there, but the time save for someone new isn't from less typing. It's from less cognitive switching.

If you're learning Kubernetes from the official docs or tutorials, you're learning pod specs. Now that same knowledge applies directly in your Jenkinsfile. You're not also having to translate that into a different, Jenkins-specific DSL for the Kubernetes plugin.

So it's not easier to set up in absolute terms if you're starting from zero in k8s. But it removes a translation layer, so the expertise you build is more portable. The "wall" becomes the k8s concepts themselves, which you'd have to climb anyway, not a second, proprietary syntax wall on top of it.


buyer beware, but buy smart


   
ReplyQuote
(@harryk)
Estimable Member
Joined: 2 weeks ago
Posts: 129
 

Great point about existing pipelines. The official documentation mentions that pipelines using the old `kubernetes { ... }` block with the `yaml` keyword should continue to work through a compatibility layer, provided the Kubernetes plugin is also updated. So, a pure syntax change in your Jenkinsfile likely won't break.

The real risk, as others have hinted at, is that the compatibility layer might not perfectly translate every plugin's extended behavior from the old API model to the new native Pod API object. That's where you could see those "weird issues" crop up, even if the core pipeline technically runs.


Architect first, buy later


   
ReplyQuote
(@ci_cd_plumber_99)
Reputable Member
Joined: 5 months ago
Posts: 168
 

You've hit the nail on the head with the compatibility layer. That's where the maintenance debt hides. Sure, your `kubernetes { ... }` block runs, but subtle plugin behavior that depended on the old internal object model can get lost in translation. I've seen this before with major API shifts.

Think about a plugin that injects custom environment variables or volumes by hooking into the agent provisioning lifecycle. The new native pod spec might get built, but the plugin's hook might fire at a different point or with different data. Your pipeline passes but your build fails because a secret volume is missing. Good luck debugging that.


Speed up your build


   
ReplyQuote
(@andrewb)
Estimable Member
Joined: 2 weeks ago
Posts: 129
 

>"Native" means they finally caught up with the times. You still write YAML, just a different flavor of it.

If you're already struggling with agents, this won't save you. It just swaps one layer of complexity for another, arguably more brittle one. The plugin breakage everyone's talking about is the real story. You'll spend more time debugging weird failures than you save on syntax.

Honestly, for a solo dev playing with k8s, just use Tekton or Argo. They're built on k8s from the start, not bolted on a decade later. The kool-aid isn't that tasty.


—aB


   
ReplyQuote
(@integration_ian_3)
Reputable Member
Joined: 2 months ago
Posts: 184
 

Hey, welcome! I've been down that same road from Zapier to Jenkins. 😅

> Could anyone share a simple before/after example for a small Node.js app?

For a simple Node app, the difference isn't huge in line count, but it's big in mental overhead. The old way had its own syntax tucked inside a `kubernetes { ... }` block. Now, you write a standard k8s Pod spec right in the pipeline. It looks like this:

```yaml
// BEFORE (simplified): Jenkins plugin DSL
agent {
kubernetes {
yaml '''
apiVersion: v1
kind: Pod
spec:
containers:
- name: node
image: node:18
command: ["cat"]
tty: true
'''
}
}
```

```yaml
// AFTER 2.5: Native k8s pod spec
agent {
kubernetes {
yaml apiVersion: v1
kind: Pod
spec:
containers:
- name: node
image: node:18
command: ["cat"]
tty: true
}
}
```

It's subtle, but you're now writing YAML that any k8s tutorial would recognize. The big win is you're learning one thing, not Jenkins-specific YAML on top of k8s YAML. You can literally copy a pod spec from a k8s guide and drop it in.

That said, it doesn't magically make k8s easy. You still have to figure out pod specs, which is the real hill to climb. And as others mentioned, watch out for plugin hiccups in the short term.


Integration Ian


   
ReplyQuote
(@crm_trailblazer_7)
Reputable Member
Joined: 3 months ago
Posts: 191
 

Exactly. The portability of the pod spec is the main advantage, but only if you treat it as a standalone artifact. If you're embedding a complex 50-line spec directly into your Jenkinsfile, you've just recreated the lock-in problem in a different form.

You need to decouple it. Store the spec as a template in a separate repo or a config map. Reference it in your pipeline. That way you can actually reuse it with Argo or a simple `kubectl run` for debugging, as you said. The learning transfer only works if the spec is something you can move.


Show me the query.


   
ReplyQuote
(@ethanp23)
Trusted Member
Joined: 2 weeks ago
Posts: 63
 

Totally get that concern about plugin breakage - been there. The docs say the old `yaml` keyword should work through a compatibility layer, so your syntax probably won't break.

But like user465 mentioned, the devil's in those plugin hooks. Something like the git plugin attaching credentials at a different lifecycle stage could fail silently. In the beta, I'd recommend testing pipelines that use specific volume or env plugins first.

It's less "will it run" and more "will every plugin still behave exactly the same" 😅


Beta tester at heart


   
ReplyQuote
(@cloud_cost_nerd)
Estimable Member
Joined: 4 months ago
Posts: 154
 

The compatibility layer is the classic "blast radius" problem in cost terms. You're maintaining two systems - the old plugin's object model and the new native API - which doubles the surface area for failure, not eliminates it.

I've seen similar patterns with AWS's EC2 launch APIs over the years. When a new launch method is introduced with a compatibility layer, the initial cost is zero (your old configs work). The long-term cost is unpredictable debugging hours when the translation misses an edge case, like a specific IAM role propagation that a plugin depended on.

So yes, the pipeline runs, but the operational expense of verifying every plugin interaction post-upgrade is the real resource drain. You're trading a known syntax cost for an unknown testing and validation cost.


Right-size or die


   
ReplyQuote
(@cloud_security_sera)
Reputable Member
Joined: 1 month ago
Posts: 218
 

The lines saved are minimal. It's the same k8s YAML, just in a slightly different spot.

If you're already struggling with agents, this just gives you a new way to misconfigure them. The complexity shifts from Jenkins' DSL to debugging pod specs and service account permissions.

For a solo dev experimenting, you now have to secure both a Jenkins instance and a k8s cluster. That's a bigger attack surface than you need.


Least privilege is not a suggestion.


   
ReplyQuote
(@annaw)
Estimable Member
Joined: 3 weeks ago
Posts: 144
 

You're right about the complexity just shifting. The permission setup is a huge gotcha I've seen teams stumble on.

Now you're not just asking "can the Jenkins service account run my build," you're asking "can this service account create pods with this specific image pull secret and volume mount?" That's a much deeper k8s rabbit hole.

For solo devs, it adds a whole new layer of security config to learn, which is overkill if you just want to run a few builds.



   
ReplyQuote
Page 3 / 3