Docker Certified Associate Exam Course
Docker Engine Enterprise
Demo Deployment in Kubernetes from UCP
In this tutorial, you’ll learn how to deploy an NGINX Pod, expose it via a Service, and clean up resources using the Docker Enterprise Universal Control Plane (UCP). By the end, you’ll have a working application accessible through a NodePort and know how to uninstall DTR and UCP components cleanly.
Prerequisites
- A running UCP cluster with at least one manager node.
kubectl
configured to communicate with UCP’s Kubernetes API.- Access to a node’s external IP for Service testing.
For more background on Kubernetes primitives, see Kubernetes Basics.
1. Creating an NGINX Pod
In the UCP console, go to Kubernetes → Pods and click Create.
Select the default namespace.
Warning
Avoid using the
default
namespace in production. Create a dedicated namespace for isolation and resource quotas.Paste the following Pod manifest to launch an NGINX container:
apiVersion: v1 kind: Pod metadata: name: nginx-pod labels: app: nginx spec: containers: - name: nginx image: nginx:stable ports: - containerPort: 80
Click Create and wait until the Pod status changes to Running.
Click the newly created Pod to view its details:
2. Exposing the Pod via a NodePort Service
To make the NGINX Pod reachable from outside the cluster:
Navigate to Kubernetes → Services and click Create.
Keep the default namespace selected.
Enter this Service manifest, which maps port 80 on the Pod to port 30080 on each node:
apiVersion: v1 kind: Service metadata: name: nginx-nodeport-svc spec: type: NodePort selector: app: nginx ports: - name: http protocol: TCP port: 80 targetPort: 80 nodePort: 30080
Click Create to provision the Service.
Open the Service details to confirm the assigned ports:
Retrieve the external IP of the node hosting the Pod:
kubectl get nodes -o wide
In your browser, navigate to
http://<external-ip>:30080
. You should see the default NGINX welcome page.
3. Cleaning Up Resources
Once testing is complete, remove the Pod and Service:
- In the UCP console, select the nginx-nodeport-svc Service.
- Click Action → Remove, then confirm.
- Repeat for the nginx-pod Pod.
This ensures a clean slate for future deployments.
Follow the official Docker documentation for a safe and complete uninstallation process.
Component | Documentation Link |
---|---|
Docker Trusted Registry (DTR) | https://docs.docker.com/ee/dtr/administration/install |
Universal Control Plane (UCP) | https://docs.docker.com/ee/ucp/administration/install |
Uninstalling Docker Trusted Registry
- Open the DTR docs and scroll to Uninstall.
- Copy the provided command and execute it, supplying your UCP URL and credentials when prompted.
Uninstalling Universal Control Plane
In the UCP docs, find the Uninstall section.
Run the interactive uninstall command on one manager node:
docker container run --rm -it \ -v /var/run/docker.sock:/var/run/docker.sock \ --name ucp \ docker/ucp:3.2.6 uninstall-ucp --interactive
To clean up leftovers, execute:
# Remove UCP services docker service rm $(docker service ls -f name=ucp -q) # Remove UCP containers docker container rm -f $(docker container ls -q -f name=ucp_) # Remove UCP volumes docker volume rm $(docker volume ls -f name=ucp -q)
Finally, delete any UCP-related secrets:
docker secret rm <secret-name>
That completes this demo. Happy deploying!
Watch Video
Watch video content