liveBook · Manning

Pod

As explained in Developer Experience on Kubernetes

A Pod is the smallest deployable Kubernetes unit and represents one or more co-located application containers.

A Pod represents an application container in Kubernetes. A Deployment manages the lifecycle of a stateless, replicated application, with each replica consisting of a Pod. section 3.3.3

Connect a Pod to the surrounding application workflow:

  • Define the Pod through a Deployment manifest, including its container image, labels, and environment configuration. section 3.3.3
  • Expose the replicated application with a Service, and make it reachable from outside the cluster through an Ingress. section 3.3.3
  • Supply configuration or credentials with ConfigMap and Secret resources. section 3.3.3

Appointments service

A Deployment runs the appointments application as a Pod, using an image and PostgreSQL settings obtained from Secret references. Apply the configuration, inspect resources with kubectl, and call the service over HTTP. section 3.3.3

Listing 3.1 Deployment configuration for a cloud native application.
apiVersion: apps/v1
kind: Deployment
metadata:
  name: appointments #A
  labels:
    app: appointments
spec:
  selector:
    matchLabels:
      app: appointments
  template:
    metadata:
      labels:
        app: appointments
    spec:
      containers:
        - name: appointments #B
          image: ko.local/appointments:0.0.1-SNAPSHOT #C
          env: #D
            - name: POSTGRES_HOST
              valueFrom:
                secretKeyRef:
                  name: db-appointments-app
                  key: host
            - name: POSTGRES_PORT
              valueFrom:
                secretKeyRef:
                  name: db-appointments-app
                  key: port
            - name: POSTGRES_DB
              valueFrom:
                secretKeyRef:
                  name: db-appointments-app
                  key: dbname
            - name: POSTGRES_USERNAME
              valueFrom:
                secretKeyRef:
                  name: db-appointments-app
                  key: username
            - name: POSTGRES_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: db-appointments-app
                  key: password
          ...

Inspect the Deployment manifest that declares the Pod template, container image, labels, and environment variables. section 3.3.3

How Developer Experience on Kubernetes covers it

How deep it goes
Defines Pods through a Deployment manifest and stops short of explaining Pod internals.
Examples
Uses an appointments service, PostgreSQL configuration, container images, kubectl commands, and HTTP requests.
What it assumes
Assumes familiarity with Kubernetes APIs, YAML manifests, container images, and basic application configuration.
What you can do after
Operate Pods through Deployment manifests, kubectl, ko, and application-specific Kubernetes commands.
How it connects
Connects Pods to Deployments, Services, Ingresses, ConfigMaps, Secrets, and Kubernetes manifests.

Also explained in

Compare how 16 books explain pod →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Developer Experience on Kubernetes. The section links point to the parts of the book it draws on.