Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Deploying a frontend, two APIs, and a database means deciding where each component runs, how it finds the others, and which parts of the system are reachable from outside. A sound starting design keeps the database private, gives each API a stable internal endpoint, and exposes only the frontend unless there is a specific reason to make another service public.

Kubernetes and Docker Compose offer different ways to express that design. The examples below are documented patterns, not a claim that this particular installment uses either platform.

Plan the component boundaries before deploying

Think of the system as four workloads: one frontend, two APIs, and one database. The frontend handles browser-facing traffic and calls the APIs; the APIs perform application work and use the database as needed. The database should normally be reachable only by the workloads that require it.

Deployment has two related but distinct parts: defining the workloads and designing the traffic paths between them. A running container or Pod does not, by itself, give other components a reliable way to locate it. Nor does startup prove that the application is ready to serve requests or that network communication works.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
  • Workloads: Define how each application component runs and how it is replaced or replicated.
  • Discovery: Give callers stable names rather than relying on changing container or Pod addresses.
  • Exposure: Make the frontend public, while keeping APIs and the database internal by default.
  • State and configuration: Persist database files independently of a replaceable container, and manage configuration and secrets separately from application images where appropriate.

How the Kubernetes deployment pattern works

Kubernetes separates workload management from service discovery. A Deployment manages application Pods; a Kubernetes Service gives a stable network endpoint and routes requests to matching Pods. The official [Kubernetes frontend-to-backend example](https://kubernetes.io/docs/tasks/access-application-cluster/connecting-frontend-backend/) uses a backend Deployment with three replicas and a Service named hello, selected by labels. Other workloads in the cluster can reach that backend using the Service DNS name hello.

Give each API its own internal Service

For a frontend that calls two APIs, define a workload and an internal Service for each API. The frontend can call the APIs by their Service names instead of needing to know which Pod currently handles a request. Each Service selects the appropriate Pods through labels, so the labels on the workload and the selector on the Service must agree.

The cited Kubernetes example illustrates the same mechanism with one backend: it does not prescribe names, API responsibilities, database setup, or a four-component application architecture. Apply its discovery pattern to the two APIs rather than treating its sample as a complete application blueprint.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Proxy frontend requests to internal names

In the example, the frontend runs NGINX and proxies incoming requests to the internal DNS name hello. A frontend proxy can use the corresponding Service names for both APIs, keeping browser traffic directed to the public frontend while the frontend communicates with private in-cluster endpoints.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The tutorial builds the NGINX configuration into its image, but notes that a ConfigMap would make the configuration easier to change. Separating runtime configuration from image contents avoids rebuilding the frontend image solely to update an upstream address or related setting.

Expose only the frontend

The example exposes the frontend through a Service of type LoadBalancer; its backend Service is not externally resolvable. This makes the public boundary explicit: outside clients reach the frontend, while internal services call the backend over the cluster network.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

An external load balancer requires a supported environment. Where one is unavailable, the Kubernetes tutorial identifies NodePort as an alternative. The tutorial shows an external address becoming available after provisioning and then demonstrates a curl request returning {"message":"Hello"}; neither that provisioning behavior nor that sample response is guaranteed for every cluster. For a real system, choose the exposure method supported by its hosting environment and keep API and database endpoints private unless external access is intentionally required.

How the Docker Compose deployment pattern works

Docker Compose describes application components as services in a compose.yaml file. Services attached to the same Compose network can reach one another by service name, so an API can use the database service name rather than a container IP address. The [Compose application model documentation](https://docs.docker.com/compose/intro/compose-application-model/) also covers service lifecycle commands, configs, secrets, and persistent volumes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use networks to define who can communicate

Docker’s illustrative topology has a frontend on both a front-tier and back-tier network, while a backend joins only the back-tier. The frontend exposes port 443; the backend is not placed on the front-tier. This is an example, not a mandatory layout. For a frontend, two APIs, and a database, you can apply the same principle by joining components only to networks needed for their communication paths.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

For example, APIs that need database access can share a private network with the database. The frontend can communicate with the APIs on an application network without giving outside clients a direct route to the database. Exact network membership depends on how the application components call one another.

Persist database data and separate sensitive values

The Compose example declares a persistent volume for backend data, along with a configuration object and a secret for an HTTPS certificate. A volume gives data a lifecycle distinct from the container that uses it; without persistent storage, replacing a database container can put its data at risk. A volume alone is not a backup or recovery plan, and the example does not establish production database operating procedures.

Use configuration for non-sensitive runtime settings and secrets for sensitive values, rather than treating either as a substitute for secure handling. The Compose model supports these objects, but the particular certificate and HTTP configuration in Docker’s example are illustrative rather than required for every deployment.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Connect separate Compose projects deliberately

Service-name discovery applies to services sharing a Compose network. If services live in separate Compose projects, Docker documents creating an external shared network and attaching the relevant services to it. Its hybrid-network example lets an API join both a shared network and an internal network while keeping the database only on the internal network. That arrangement can allow selected cross-project communication without making every service mutually reachable.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose a pattern that fits the deployment scope

Decision Docker Compose Kubernetes
Typical scope Defines and operates a multi-container application through a Compose file. Manages workloads in a cluster; a Deployment manages Pods and a Service provides stable discovery and routing.
Service discovery Services on a shared network can connect using service names. Services provide stable in-cluster endpoints; the documented example uses a Service DNS name and label selector.
External access in the examples The frontend example exposes port 443; network and host exposure depend on the Compose configuration. The example uses a frontend LoadBalancer Service; NodePort is identified as an alternative when an external load balancer is unavailable.
State and runtime data The illustrative application model declares a persistent volume for backend data. Not stated in the cited frontend-to-backend example; it focuses on connecting frontend and backend services.
Configuration and secrets The illustrative model declares a config and a secret. The tutorial says a ConfigMap could make NGINX configuration easier to change; it does not provide a complete secrets design.

Compose is a practical way to describe connected containers for an application. Kubernetes adds cluster-level workload management and Service-based routing. Neither choice removes the need to decide which services should be reachable, how database state is protected, or how runtime settings are maintained.

Verify health and networking after startup

Successful startup is only the first check. Confirm that expected services are running, that each is attached to the intended network, and that a caller can reach its destination. Docker’s [Compose networking guide](https://docs.docker.com/compose/how-tos/networking) recommends checking network configuration and attachment before testing live connectivity.

  1. List service status: Run docker compose ps to inspect the project’s containers and status.
  2. Inspect application output: Run docker compose logs, or add a service name to focus on one component’s logs.
  3. Check network configuration: Run docker network inspect NETWORK_NAME to inspect a network and its attached containers.
  4. Test from the caller’s context: Use docker compose exec SERVICE_NAME COMMAND to run an appropriate connectivity check from a service container. Test the actual service name and port the application uses.

If a request fails, check that the caller and destination share a network, that the name resolves as expected, and that the application is listening on the target port. In Kubernetes, also check the Service selector against the Pod labels and confirm the intended Service is internal or externally exposed as designed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.