Aisalkyn Aidarova1️⃣ Your Current Architecture That machine = Jenkins Controller (Master) Your Nodes...
That machine = Jenkins Controller (Master)
Your Nodes page:
So architecture is:
AWS EC2 (Ubuntu)
---------------------
Jenkins Controller
(Orchestrator)
---------------------
/ | \
/ | \
Linux Mac-Agent Mac-Agent
Agent (M1) (M1)
Controller (formerly Master):
In your case:
Controller = EC2 Ubuntu machine.
Path that matters:
/var/lib/jenkins
This is critical in production.
If this folder is lost → audit history lost.
DevOps must back this up.
Agent:
Agents DO NOT store pipeline history.
They just execute tasks.
Your mac-agent and node-mac1 are execution machines.
Very important.
You:
You DO NOT write code directly here.
Pipeline code lives in Git.
You:
Agents must have:
When you click:
Manage Jenkins → Nodes → New Node
You configure:
Example:
mac-agent
This is label reference.
If you set:
2
That agent can run 2 jobs at same time.
Production advice:
Keep low unless machine is powerful.
Example:
/Users/jenkins
This is where Jenkins stores workspace on that agent.
Example:
mac
Now in Jenkinsfile you can write:
pipeline {
agent { label 'mac' }
}
This forces job to run on Mac agent.
Usually via SSH.
On Mac:
Install Java.
On EC2:
Add SSH credentials.
In node config:
Then Jenkins connects and launches agent.jar automatically.
When you click Build:
Controller coordinates.
Agent executes.
Run on Linux:
pipeline {
agent { label 'linux' }
stages {
stage('Build') {
steps {
sh 'echo Running on Linux'
}
}
}
}
Run on Mac:
pipeline {
agent { label 'mac-agent' }
stages {
stage('Build') {
steps {
sh 'echo Running on Mac'
}
}
}
}
Real reasons:
DevOps must design node architecture.
This is very important for production.
If agent disk is full → build fails.
You saw:
Free Disk Space: 3.07 GiB (Linux)
3GB is LOW.
Production risk.
You have:
Free Swap Space: 0 B
No swap → memory pressure risk.
If time difference exists → build issues (certificates, tokens).
If high → network issue.
Never allow agent to access:
Agents must be isolated.
Important:
Shared library logic executes on:
Example:
script {
def version = "1.0"
}
sh "docker build ."
Groovy part runs in controller memory.
Shell runs on agent.
Real company:
Controller:
Agents:
Your setup is static agents.
Good for lab.
Enterprise often uses:
Jenkins Controller = Brain
Agents = Workers
Brain schedules.
Workers execute.
Never overload the brain.
If interviewer asks:
“How do you design Jenkins node architecture?”
You answer:
"I separate controller and execution nodes. The controller only orchestrates builds and stores state, while agents perform build execution. I assign labels based on workload type (Linux, Mac, Docker, etc.) and ensure disk monitoring, security isolation, and proper executor configuration."
That is senior-level answer.
On your EC2:
Check:
df -h
free -m
On Mac agents:
Check: