Chapter 01Lesson 05~45 minutes

Linux Roles Across Development, CI/CD, Cloud, and Production

Linux is not one isolated tool in a DevOps stack. It is the runtime and control surface connecting source code, build agents, containers, cloud hosts, production services, monitoring, security, and incident response.

BeginnerDevOps workflowCapstone lab

Learning objectives

By the end of this lesson

  • Map Linux responsibilities to development, build, test, deployment, and operations stages.
  • Explain how CI runners and container hosts depend on Linux isolation and resource controls.
  • Recognize the operational state that must be observed in production.
  • Distinguish environment consistency from environment-specific configuration.
  • Create a practical Linux responsibility map for a delivery system.

1. Linux across the delivery system

Linux connects the software-delivery lifecycle
flowchart TD
  DEV["Development environment"] --> SCM["Source and review"]
  SCM --> CI["Linux CI runner"]
  CI --> ART["Artifact or image"]
  ART --> CD["Deployment automation"]
  CD --> PROD["Linux production runtime"]
  PROD --> OBS["Logs, metrics, traces, and alerts"]
  OBS --> OPS["Operations and incident response"]
  OPS -. feedback .-> DEV

The specific distribution or hosting model may change, but the same operating concepts recur: processes, users, files, permissions, network sockets, resource limits, packages, logs, services, and automation.

2. Development environments

Workstation

Native Linux or WSL

Developers use shells, package tools, language runtimes, containers, SSH, and local services.

Dev container

Reproducible user space

A versioned image standardizes compilers and dependencies while sharing a host kernel.

Remote environment

Cloud VM or workspace

Centralized environments improve access to shared networks and larger resources but require identity and cost controls.

Developer convenience should not silently become production configuration. Local shortcuts—broad permissions, embedded credentials, disabled TLS checks—must not cross the delivery boundary.

3. CI runners and build agents

A CI runner is an automation identity executing untrusted or semi-trusted repository instructions. Its Linux host must manage workspace isolation, credentials, caches, processes, network access, and cleanup.

01Checkout

Git writes source into a controlled workspace with a known identity and permissions.

02Dependency resolution

Package managers contact registries, validate metadata, and populate caches.

03Build and test

Processes consume CPU, memory, disk, file descriptors, and network sockets under time and resource limits.

04Artifact publication

Outputs are signed, checksummed, and uploaded using short-lived credentials.

05Cleanup

Workspaces, child processes, containers, mounts, and secrets must be removed reliably.

Runner trust boundary

A long-lived shared runner can leak credentials or state between jobs when isolation and cleanup are weak. Ephemeral runners reduce persistence but still require hardened base images and constrained permissions.

4. Containers, orchestration, and cloud hosts

Containers rely on Linux namespaces, cgroups, capabilities, seccomp, filesystems, and networking. Kubernetes schedules containers, but node health still depends on the host kernel, runtime, storage, DNS, time synchronization, certificates, and system services.

LayerLinux responsibilityEvidence
Cloud VMBoot, kernel, identity, storage, network, patchessystemctl, journalctl, ip, lsblk
Container hostRuntime, namespaces, cgroups, images, mountsps, /proc, systemd-cgls
Kubernetes nodekubelet, runtime, CNI, volumes, resource pressurejournalctl, crictl, ss, df
Managed platformApplication logs and runtime behavior remain visible even when host control is reducedplatform logs and shell diagnostics

5. Production services and runtime state

In production, configuration files describe intended state, but the live host reveals actual state. Operators must compare both.

  • Which process is listening on a port?
  • Which user and groups own the process?
  • Which executable and configuration file were loaded?
  • What environment variables, limits, capabilities, and cgroup constraints apply?
  • Which filesystems and volumes are mounted?
  • What changed since the last healthy deployment?
# Examples of live-state inspection
systemctl --failed
ps -eo user,pid,ppid,stat,etimes,comm --sort=-etimes | head
ss -lntup
findmnt
free -h
df -hT
journalctl -p warning -b --no-pager | tail -n 50

Some commands require privileges to display every process or socket owner. Absence of evidence under an unprivileged account does not always prove absence of activity.

6. Observability, security, and compliance agents

Logs

Events and context

systemd journal, application files, audit records, and forwarded streams preserve operational evidence.

Metrics

Resource behavior

CPU, memory, disk, network, process, and application measurements support trends and alerts.

Security

Control and detection

Permissions, MAC policies, firewalls, audit rules, integrity tools, and endpoint agents enforce or observe policy.

Compliance

Desired-state evidence

Inventory, patch status, configuration baselines, and immutable logs show whether controls are operating.

7. Environment parity without pretending environments are identical

Development, CI, staging, and production should share versioned application dependencies and deployment logic. They should not necessarily share secrets, scale, network exposure, data, or privilege.

Keep consistentKeep environment-specificControl method
Build inputs and runtime versionsCredentials and endpointsLocked dependencies and secret stores
Deployment artifactReplica counts and capacityImmutable artifact plus configuration
Health checks and startup contractExternal integrationsAutomated tests and environment policy
Filesystem paths and service user modelData classification and retentionInfrastructure and configuration as code

8. Linux as the incident-response control surface

When a deployment fails, start with evidence rather than random restarts:

01Define impact

Which users, services, nodes, and time window are affected?

02Check recent change

Deployment, package, configuration, certificate, secret, or infrastructure events.

03Inspect service state

Processes, exit codes, logs, sockets, dependencies, permissions, and resource pressure.

04Mitigate safely

Rollback, isolate, scale, restart, or fail over with an explicit verification step.

05Preserve evidence

Capture timestamps, commands, logs, versions, and decisions for follow-up.

9. Capstone lab: create a Linux responsibility map

Build a report that connects the current machine to DevOps stages. The commands are read-only.

lab="$HOME/devops-academy/linux/chapter01/lesson05"
mkdir -p "$lab"
cd "$lab"

{
  printf '=== host identity ===\n'
  hostname
  uname -srmo
  cat /etc/os-release

  printf '\n=== development and build tools ===\n'
  for tool in git bash make gcc python3 node docker kubectl; do
    if command -v "$tool" >/dev/null 2>&1; then
      printf '%-10s %s\n' "$tool" "$(command -v "$tool")"
    fi
  done

  printf '\n=== service and runtime state ===\n'
  ps -p 1 -o pid,comm,args
  systemctl --failed --no-pager 2>/dev/null || true

  printf '\n=== listening TCP sockets ===\n'
  ss -lnt 2>/dev/null || true

  printf '\n=== capacity ===\n'
  free -h
  df -hT

  printf '\n=== recent warnings ===\n'
  journalctl -p warning -b -n 20 --no-pager 2>/dev/null || true
} > devops-role-report.txt

less devops-role-report.txt

Verification checklist

10. Common operating mistakes

Treating Linux as only a list of commands

Commands are interfaces to processes, files, identities, networks, and kernel state. The underlying model matters more.

Running CI agents as unrestricted root

Automation should receive the minimum host, repository, cloud, and secret permissions required.

Assuming containers eliminate host operations

Kernel, node storage, runtime, DNS, networking, time, and resource pressure remain host responsibilities.

Restarting before collecting evidence

A restart may restore service while destroying the process and log context needed to identify the cause.

11. Knowledge check

Question 1. Why is a CI runner a security boundary rather than merely a build machine?

Question 2. Which Linux components remain relevant when Kubernetes is managed by a cloud provider?

Question 3. What should happen before restarting a failed production service?

12. Chapter summary

Linux forms the operational substrate across development, CI/CD, cloud, containers, production, observability, security, and incident response. Chapter 1 established the mental model: kernel and user space, distribution lifecycle, ecosystem licensing, and Linux responsibilities across delivery.

Next lesson

Choosing Ubuntu, Debian, Fedora, Rocky Linux, or AlmaLinux

Chapter 2 begins by comparing Linux distributions and choosing a supportable, reproducible platform for the course laboratory.

13. Further reading

  • Linux Foundation and kernel documentation — Linux architecture and production operations.
  • systemd documentation — services, journal, resource control, and host lifecycle.
  • Open Container Initiative specifications — runtime and image contracts.
  • Kubernetes documentation — node architecture, workloads, logging, and cluster operations.
  • Site Reliability Engineering resources — monitoring, incident response, change management, and reliability practices.

Keep the academy open

Support free, practical DevOps education.

Every lesson is designed to remain readable in a browser, downloadable from GitHub, and usable without a paid learning platform. Contributions help expand and maintain the curriculum.

Ethereum / ERC-20
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0 Send only Ethereum/ERC-20 compatible assets to this address.