Exposing a Service

DC/OS agent nodes can be designated as public or private during installation. Public agent nodes provide access from outside of the cluster via infrastructure networking to your DC/OS services. By default, services are launched on private agent nodes and are not accessible from outside the cluster.

To launch a service on a public node, you must create a Marathon app definition with the "acceptedResourceRoles":["slave_public"] parameter specified and configure an edge load balancer and service discovery mechanism.

Tip: You can also view deployed apps by using the Services tab of DC/OS GUI.

Configure an edge load balancer and service discovery mechanism.

AWS users: If you installed DC/OS by using the AWS CloudFormation templates, an ELB is included. However, you must reconfigure the health check on the public ELB to expose the app to the port specified in your app definition (e.g. port 80).

All other users: You can use Marathon-LB, a rapid proxy and load balancer that is based on HAProxy.

Go to your public agent to see the site running. For information about how to find your public agent IP, see the documentation.

You should see the following message in your browser:

Next steps

Learn how to load balance your app on a public node using Marathon-LB.