This topic describes how to deploy a non-native instance of Marathon with isolated roles, reservations, and quotas. This procedure does not support secrets or fine-grained ACLs. If you require these features, you must use the custom non-native Marathon procedure.
Prerequisites:
- DC/OS and DC/OS CLI installed.
- DC/OS Enterprise CLI 0.4.14 or later.
- You must be logged in as a superuser.
- SSH access to the cluster.
Step 1 - Reserve Resources
In this step, Mesos resources are reserved. Choose the procedure for either static or dynamic reservations.
Static Reservations
- SSH to your private agent node.
-
Navigate to
/var/lib/dcos
and create a file namedmesos-slave-common
with these contents, where<myrole>
is the name of your role. -
Stop the private agent node:
-
Add the node back to your cluster.
-
Reload the
systemd
configuration. -
Remove the
latest
metadata pointer on the agent node: -
Start your agents with the newly configured attributes and resource specification.
You can check the status with this command:
-
-
Repeat these steps for each additional node.
Dynamic Reservations
Reserve resources for your non-native Marathon instance with the Mesos ID (<mesos-id>
), user ID (<userid>
), role (<myrole>
), and ports (<begin-port>
and <end-port>
) specified.
Step 2 - Install a Non-Native Marathon Instance with Assigned Role
In this step, a non-native Marathon instance is installed on DC/OS with the Mesos role assigned.
- Create a custom JSON config file and save as
marathon-config.json
. This file is used to install the custom non-native Marathon instance. - Install the Marathon package from Universe with the custom JSON configuration specified (
marathon-config.json
).
Step 3 - Create a Marathon Service Account
In this step, a Marathon Service Account is created. Depending on your security mode, a Marathon Service Account is either optional or required.
Security Mode | Marathon Service Account |
---|---|
Permissive | Optional |
Strict | Required |
-
Create a 2048-bit RSA public-private key pair (
<private-key>.pem
and<public-key>.pem
) and save each value into a separate file within the current directory. -
Create a new service account called
<service-account-id>
, with the public key specified (<public-key>.pem
).
Step 4 - Assign Permissions (Strict mode only)
In this step, permissions are assigned to the Marathon-on-Marathon instance. Permissions are required in strict mode and are ignored in permissive security mode.
All CLI commands can also be executed via the IAM API.
Security Mode | Permissions |
---|---|
Permissive | Not available |
Strict | Required |
Grant the permission for user <uid>
to launch Mesos tasks that will execute as Linux user nobody
.
To allow executing tasks as a different Linux user, replace nobody
with that user’s Linux user ID. For example, to launch tasks as Linux user bob
, replace nobody
with bob
below.
Note that the nobody
and root
users exist on all agents by default, but if a custom bob
user is specified it must have been manually created (using the adduser
or similar utility) on every agent that tasks can be executed on.
Step 5 - Grant User Access to Non-Native Marathon
In this step, a user is granted access to the non-native Marathon instance.
-
Log in to the DC/OS web interface as a user with the
superuser
permission.Figure 1. DC/OS web interface login screen.
-
Select Organization and choose Users or Groups.
-
Select the name of the user or group to grant the permission to.
Figure 2. Select user or group permission
-
From the Permissions tab click ADD PERMISSION.
-
Click INSERT PERMISSION STRING to toggle the dialog.
Figure 3. Add permissions.
-
Copy and paste the permission in the Permissions Strings field. Choose the permission strings based on your security mode.
Permissive
-
Full access
-
Access to an individual service or group
Specify the service or group (
<service-or-group>
) and action (<action>
). Actions can be eithercreate
,read
,update
,delete
, orfull
. To permit more than one operation, use a comma to separate them, for example:dcos:service:marathon:<service-name>:services:/<service-or-group> read,update
.
Strict
-
Full access
-
Access to an individual service or group
Specify the service or group (
<service-or-group>
), service name (<service-name>
), role (<myrole>
), and action (<action>
). Actions can be eithercreate
,read
,update
,delete
, orfull
. To permit more than one operation, use a comma to separate them, for example:dcos:service:marathon:<service-name>:services:/<service-or-group> read,update
.
-
-
Click ADD PERMISSIONS and then Close.
Step 6 - Access the Non-Native Marathon Instance
In this step, you log in as a authorized user to the non-native Marathon DC/OS service.
-
Launch the non-native Marathon interface at:
http://<master-public-ip>/service/<service-name>/
. -
Enter your username and password and click LOG IN.
Figure 4. DC/OS log in screen
You are done!
Figure 5. Success screen.