liveBook · Manning

Kubernetes Deployment

As explained in Akka in Action, Second Edition

A Kubernetes Deployment is a workload resource that declaratively manages replicated pods and their rollout configuration.

A Kubernetes Deployment declares how an application runs as replicated pods. A minimal manifest sets the image, replica count, selector, pod labels, and image-pull policy. section 13.2.2

apiVersion: apps/v1
kind: Deployment
...
spec:
  replicas: 3                                               #1
...
  template:
    ...
    spec:
      containers:
      - name: testing-bootstrap13b                          #2
        image: my-docker-registry/chapter13b:0.1.0-SNAPSHOT #3
        imagePullPolicy: IfNotPresent                       #4

Use this manifest skeleton to create three identical pods from one Docker image. section 13.2.2

Keep spec.selector.matchLabels and template.metadata.labels aligned. Kubernetes uses that relationship to associate the Deployment with its pods; the label also supports commands such as kubectl get pod -l app=.... section 13.2.2

A Deployment for an Akka cluster commonly configures:

  • Node discovery through a service name or the AKKA_CLUSTER_BOOTSTRAP_SERVICE_NAME environment variable. section 13.2.2
  • Liveness and readiness HTTP probes on the management port, such as /alive and /ready. section 13.2.2
  • A Docker image containing the application and the ports required by Akka Management, Akka Remote, services, and projections. section 15.3.2

Deploying the betting-house application

After preparing the image and Kubernetes service account, create a namespace and apply the deployment: kubectl create ns akka-cluster; kubectl apply -f role.yml -n akka-cluster; kubectl apply -f deployment.yml -n akka-cluster. kubectl get deploy -n akka-cluster can then show three ready pods for my-deployment-name. section 15.3.2

How Akka in Action, Second Edition covers it

How deep it goes
Explains manifest fields, label matching, discovery settings, probes, image packaging, and deployment commands.
Examples
Uses three-pod manifests, label selectors, Akka discovery environment variables, health probes, and a betting-house deployment.
What it assumes
Assumes basic Kubernetes and database knowledge, then supplies the image-building, namespace, service-account, and deployment steps.
What you can do after
Operate/configure a Kubernetes-hosted Akka application with replicated pods, discoverable nodes, Docker images, and readiness checks.
How it connects
Connects Kubernetes pods, labels, Docker images, Akka Cluster Bootstrap, Akka Management, service discovery, and health probes.

Also explained in

Compare how 10 books explain Kubernetes Deployment →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Akka in Action, Second Edition. The section links point to the parts of the book it draws on.