Resources

OpenShift Day 2 Guide

Pods, Workloads, and Resource Management — a practical reference for running workloads on OpenShift.

Pod Fundamentals

A Pod is the smallest deployable unit in Kubernetes / OpenShift — one or more containers that share a network namespace, storage volumes, and lifecycle. Containers within a Pod communicate over localhost; storage mounts are shared across all containers in the Pod.

Minimal Pod Spec

apiVersion: v1
kind: Pod
metadata:
  name: example-pod
  namespace: mission-ops
  labels:
    app: example
    tier: backend
spec:
  containers:
  - name: app
    image: registry.example.com/myapp:1.2.3
    ports:
    - containerPort: 8080
    resources:
      requests:
        memory: "256Mi"
        cpu: "250m"
      limits:
        memory: "512Mi"
        cpu: "500m"
    env:
    - name: LOG_LEVEL
      value: "info"
    volumeMounts:
    - name: config
      mountPath: /etc/config
  volumes:
  - name: config
    configMap:
      name: app-config

Pod Lifecycle Phases

Pending

Pod accepted by cluster; containers not yet running. Scheduler is placing it or images are pulling.

Running

Pod bound to a node; at least one container is running or starting.

Succeeded

All containers exited with status 0 and will not restart (typical for Jobs).

Failed

All containers have exited; at least one exited non-zero or was terminated by the system.

Unknown

Pod state could not be retrieved — usually a node communication issue.

Pod Networking & DNS

Each Pod gets its own IP on the cluster network. Containers share that IP — they communicate on localhost with different ports.

DNS format for a Service:

<service>.<namespace>.svc.cluster.local

Pods in the same namespace resolve the short name. Cross-namespace calls need the full DNS name.

Init Containers

Init containers run to completion before app containers start. Use them for database migrations, secret fetching, or configuration bootstrapping. They share the same volume mounts as the main container.

Multi-Container Patterns

Sidecar

Runs alongside the main container. Common uses: log shipping, metrics scraping, service mesh proxy (Envoy/Istio).

Ambassador

Proxies network traffic on behalf of the main container. Useful for connection pooling or protocol translation.

Adapter

Transforms or normalises output from the main container — e.g. converting proprietary metrics to Prometheus format.

This guide reflects OpenShift 4.x / Kubernetes 1.28+. YAML examples are illustrative — adjust namespaces, images, and resource values for your environment.

Turtini uses cookies to improve your experience, analyze site traffic, and personalize content. By clicking Accept, you consent to our use of cookies. Privacy Policy

Wally

Your Turtini assistant

Hi, I'm Wally!

Ask me anything about Turtini — features, pricing, how things work, and more.

or

Already have an account? Sign in

Wally can make mistakes — verify important info.