I thought I would contribute some instructions that help make this an easier build. Feel free to change and edit this at will.
Photon Admiral How-to with docker-cloud-media-scripts Bonus (Extreme Rough Draft)
First of all I would like to thank the author of these sites for a good portion of my information:
https://blogs.vmware.com/cloudnative/2016/10/03/getting-started-vmware-admiral-container-service-photon-os/
http://cormachogan.com/2016/04/07/getting-started-photon-os-vsphere-integrated-containers/
http://www.vmtocloud.com/how-to-configure-photon-os-to-auto-start-containers-at-boot-time/
http://www.vmtocloud.com/how-to-enable-docker-remote-api-on-photon-os/
https://docs.docker.com/docker-cloud/apps/stack-yaml-reference/#cap_add-cap_drop
Note about the infrastructure
I built this using Vmware
We will use 1 VM for Admiral and 2 VM’s configured with more resources
I used the stock OVA hardware configuration for admiral
I beefed the cpu, mem and storage for the 2 hosts
Setup of the Photon OS VM’s
Download Photon OS
Download Link - https://vmware.github.io/photon/
I downloaded the OVA and installed to Vmware
I used the console to login and change password then ifconfig to get the IP then SSH in.
Configure a Static IP
cd /etc/systemd/network
mv 10-dhcp-en.network 10-static-en.network
vi 10-static-en.network
This is an example of my 10-static-en.network file
[Match]
Name=e*
[Network]
DHCP=no
Address=192.168.1.5/24
Gateway=192.168.1.1
DNS=8.8.8.8 8.8.8.8
Domains=contoso.com
NTP=time-a.nist.gov
Configure a hostname
cd /etc
vi hostname
Admiral VM Configuration
Start and Enable Docker on Boot
systemctl start docker
systemctl enable docker
Build and run Admiral
docker run -d -p 8282:8282 --name admiral vmware/admiral
Make admiral docker start on boot
vi /etc/systemd/system/docker-admiral.service
My docker-admiral.service file
[Unit]
Description=Admiral container
Requires=docker.service
After=docker.service
[Service]
Restart=always
ExecStart=/usr/bin/docker start -a admiral
ExecStop=/usr/bin/docker stop -t 2 admiral
[Install]
WantedBy=default.target
Enable service at boot time
systemctl enable docker-admiral.service
Build Host
Follow the static ip and hostname section again for each host
Enable remote api
vi /etc/default/docker
my docker file
DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"
–-----------------------------------------
Make API port persistent
vi /etc/systemd/scripts/iptables
Go to the end of the file before # End and put these two lines
#Enable Docker API
iptables -A INPUT -p tcp --dport 2375 -j ACCEPT
systemctl start docker
systemctl enable docker
Browse to Admiral Host IP:8282
follow the guide for adding hosts from this site :
https://blogs.vmware.com/cloudnative/2016/10/03/getting-started-vmware-admiral-container-service-photon-os/
Install madslundt/docker-cloud-media-scripts
it goes without saying that you should read this page :
https://github.com/madslundt/docker-cloud-media-scripts
It is super easy with Admiral
This information was gathered with big help from
davidjameshowell from the docker-cloud-media-scripts project
Everyone in https://gitter.im/project-admiral/Lobby
Specially Stanislav Hadjiiski
Only certain options were exposed to the UI for various reasons
You can build everything with a Blueprint YAML
Build your Blueprint YAML
My YAML file (If the formatting is not there it will not work, I am attaching the YAML file to this as well.)
(Make sure to include the 3 dashes at the top of the YAML script)
NOTE: it has the following options included [--privileged --cap-add=MKNOD --cap-add=SYS_ADMIN --device=/dev/fuse]
docker-cloud-media-scripts.yaml.TXT (Don't forget to change the extension to YAML)
name: "cloud-media-scripts"
components:
cloud-media-scripts:
type: "App.Container"
data:
name: "cloud-media-scripts"
image: "registry.hub.docker.com/madslundt/cloud-media-scripts"
_cluster: 1
privileged: true
cap_add:
- MKNOD
- SYS_ADMIN
device:
- "/dev/fuse:/dev/fuse"
env:
- var: "CLEAR_CHUNK_MAX_SIZE"
value: ""100""
- var: "REMOVE_LOCAL_FILES_WHEN_SPACE_EXCEEDS_GB"
value: ""350""
- var: "FREEUP_ATLEAST_GB"
value: ""100""
volumes:
- "/media:/local-media:shared"
- "/mnt/external/media:/local-decrypt:shared"
- "/configurations:/config"
- "/mnt/external/plexdrive:/chunks"
- "/logs:/log"
publish_all: true
restart_policy: "no"
Browse to Admiral IP:8282
goto Templates then click on templates
Click Import template or Docker Compose
Load your YAML file then follow the rest of the setup for Rclone and Plexdrive and everything else on this page:
https://github.com/madslundt/docker-cloud-media-scripts
You now have madslundt/docker-cloud-media-scripts running in Vmware Admiral!
Again Big Shout out to -
davidjameshowell from the docker-cloud-media-scripts project
Everyone in https://gitter.im/project-admiral/Lobby
Specially Stanislav Hadjiiski (Seriously I couldn't have done this without you)