"Simple" rkt Deployment - GluuFederation/gluu-docker GitHub Wiki
Experimenting with launching our Docker containers on ChromeOS/Crouton with rkt. Docker doesn't work with ChromeOS but rkt works as an orchestrator, so I've been figuring out the process to properly launch our containers.
One thing I've noticed with my limited disk size and many experiments of getting the commands right, is that rkt requires you handle garbage collection, otherwise it'll eat up all your disk space. I did this manually like this rkt rm $(rkt list | awk '{print $2}'
as a hack-y solution. I've been reading about rkt garbage collection and it seems to be the way to go about it. rkt gc
is the command and you have to run it manually, or set a cron job. Adjust the grace period with the grace-period=05m0s
option, where 05m0s
is 5 minutes.
Anyways, here's the process I have so far. I'm only testing on the host network for ease of use:
Export the IP address for convenience. I had to do this for every terminal as I'm not currently using some daemon to run this:
export IPADDR=$(ip route get 1 | awk '{print $NF;exit}')
Deploy Consul:
rkt run \
--net=host \
--insecure-options=image docker://consul \
--name=consul \
--environment=bind=$IPADDR \
--environment=retry-join=$IPADDR \
--environment=client=$IPADDR
Load Gluu Server configuration to Consul:
rkt run \
--insecure-options=image \
docker://gluufederation/config-init:3.1.2_dev \
--net=host \
--"exec=python" \
-- entrypoint.py generate \
--admin-pw secret \
--email [email protected] \
--kv-host=$IPADDR \
--ldap-type=opendj \
--domain cont.dev.com \
--org-name 'Gluu Inc.' \
--country-code US \
--state TX \
--city Austin
Deploy OpenDJ and load configuration:
rkt run \
--net=host \
--insecure-options=image \
docker://gluufederation/opendj:3.1.2_dev \
--name opendj \
--environment GLUU_KV_HOST=$IPADDR \
--environment GLUU_LDAP_INIT=true \
--environment GLUU_LDAP_INIT_HOST=$IPADDR \
--environment GLUU_LDAP_INIT_PORT=1636 \
--environment GLUU_LDAP_ADDR_INTERFACE=wlan0
Deploy oxAuth:
rkt run \
--net=host \
--insecure-options=image \
docker://gluufederation/oxauth:3.1.2_dev-8081 \
--name oxauth \
--environment GLUU_KV_HOST=$IPADDR \
--environment GLUU_LDAP_URL=$IPADDR:1636
Deploy NGINX:
rkt run \
--net=host \
--insecure-options=image \
docker://gluufederation/nginx:3.1.2_dev \
--name nginx \
--environment GLUU_KV_HOST=$IPADDR \
--environment GLUU_OXAUTH_BACKEND=$IPADDR:8081 \
--environment GLUU_OXTRUST_BACKEND=$IPADDR:8082
Deploy oxTrust:
Obviously replace cont.dev.com
with whatever host name you have in /etc/hosts
.
rkt run \
--net=host \
--insecure-options=image \
docker://gluufederation/oxtrust:3.1.2_dev-8082 \
--name oxtrust \
--environment GLUU_KV_HOST=$IPADDR \
--environment GLUU_LDAP_URL=$IPADDR:1636 \
--hosts-entry=$IPADDR=cont.dev.com