liveBook · Manning

Kubernetes Deployment

As explained in Quarkus in Action

A Kubernetes deployment is a declarative resource that manages the desired replicas and rollout state of a workload.

A Kubernetes Deployment defines an application declaratively and represents the workload that Kubernetes runs. In a Quarkus project, the Kubernetes extension generates this resource alongside a Service and, optionally, a ServiceMonitor. section 11.3.3

Use the Quarkus integration to generate and apply a Deployment:

  • Add the Kubernetes extension to the application project. section 11.3.3
  • Build the application to generate YAML and JSON manifests under target/kubernetes. section 11.3.3
  • Inspect the generated Deployment, including its container image and image-pull policy. section 11.3.3
  • Apply the YAML with kubectl, then inspect running pods or forward a pod port for local access. section 11.3.3

Inventory service

Building the Inventory service produces a Deployment using the image quay.io/quarkus-in-action/inventory-service:1.0.0. Applying the generated manifest creates the inventory-service Deployment; kubectl get pods confirms its pod is running. section 11.3.3

Listing 11.11 Simplified version of the generated kubernetes.yml
apiVersion: v1
kind: Service
  ...
spec:
  ports:
    - name: grpc
      port: 9000
      protocol: TCP
      targetPort: 9000
    - name: http
      port: 80
      protocol: TCP
      targetPort: 8083
---
apiVersion: apps/v1
kind: Deployment
  ...
spec:
  ...
    spec:
      containers:
        - env:
            ...
          image: quay.io/quarkus-in-action/inventory-service:1.0.0
          imagePullPolicy: Always

Inspect the simplified generated manifest to see how a Kubernetes Deployment declares the application image and container settings. section 11.3.3

How Quarkus in Action covers it

How deep it goes
Explains manifest generation, image configuration, application, and pod inspection, but omits cluster setup and detailed rollout mechanics.
Examples
Uses the Quarkus Inventory service, generated kubernetes.yml, quay.io image, kubectl apply, and running-pod inspection.
What it assumes
Assumes a Quarkus application and Kubernetes access while deliberately omitting cluster setup and kubectl installation.
What you can do after
Operate/configure a Quarkus application deployment by generating manifests, applying them with kubectl, and checking its pods.
How it connects
Connects Kubernetes Deployment with Kubernetes Service, Prometheus, Docker images, kubectl, and OpenShift.

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 Quarkus in Action. The section links point to the parts of the book it draws on.