Deploy a single-service application¶
This topic describes how to use both the MKE web UI and the CLI to deploy an
NGINX web server and make it accessible on port 8000
.
To deploy a single-service application using the MKE web UI:
Log in to the MKE web UI.
Navigate to Swarm > Services and click Create a service.
In the Service Name field, enter
nginx
.In the Image Name field, enter
nginx:latest
.Navigate to Network > Ports and click Publish Port.
In the Target port field, enter
80
.In the Protocol field, enter
tcp
.In the Publish mode field, enter
Ingress
.In the Published port field, enter
8000
.Click Confirm to map the ports for the NGINX service.
Specify the service image and ports.
Click Create to deploy the service into the MKE cluster.
To view the default NGINX page through the MKE web UI:
Navigate to Swarm > Services.
Click nginx.
Click Published Endpoints.
Click the link to open a new tab with the default NGINX home page.
To deploy a single service using the CLI:
Verify that you have downloaded and configured the client bundle.
Deploy the single-service application:
docker service create --name nginx \ --publish mode=ingress,target=80,published=8000 \ --label com.docker.ucp.access.owner=<your-username> \ nginx
View the default NGINX page by visiting
http://<node-ip>:8000
.
See also