Différences entre versions de « Utiliser Panamax sur Cloudstack by Ikoula »
m |
|||
Ligne 1 : | Ligne 1 : | ||
− | Si vous ne connaissez pas encore Panamax (http://http://panamax.io/) il s'agit d'un produit Open Source développé par Century Link Labs qui est à la fois une market place et | + | Si vous ne connaissez pas encore Panamax (http://http://panamax.io/) il s'agit d'un produit Open Source développé par Century Link Labs qui est à la fois une market place et un gestionnaire pour applications conteneurisées Docker depuis une interface web intuitive. |
Ligne 9 : | Ligne 9 : | ||
Nous utiliserons dans notre exemple une instance CoreOS pour la partie client Panamax UI puis 3 autres instances pour la partie Panamax Remote Target (Panamax Remote Agent + Panamax Adapter) : | Nous utiliserons dans notre exemple une instance CoreOS pour la partie client Panamax UI puis 3 autres instances pour la partie Panamax Remote Target (Panamax Remote Agent + Panamax Adapter) : | ||
− | |||
Ligne 16 : | Ligne 15 : | ||
− | + | <syntaxhighlight lang="bash"> | |
− | < | ||
core@Coreosx64 ~ $ curl -O http://download.panamax.io/installer/pmx-installer- latest.zip | core@Coreosx64 ~ $ curl -O http://download.panamax.io/installer/pmx-installer- latest.zip | ||
% Total % Received % Xferd Average Speed Time Time Time Curren t | % Total % Received % Xferd Average Speed Time Time Time Curren t | ||
Ligne 36 : | Ligne 34 : | ||
inflating: coreos | inflating: coreos | ||
inflating: CONTRIBUTING.md | inflating: CONTRIBUTING.md | ||
− | </ | + | </syntaxhighlight> |
Ligne 42 : | Ligne 40 : | ||
− | < | + | <syntaxhighlight lang="bash"> |
core@Coreosx64 ~ $ sudo su | core@Coreosx64 ~ $ sudo su | ||
Coreosx64 core # ./coreos install --stable | Coreosx64 core # ./coreos install --stable | ||
Ligne 91 : | Ligne 89 : | ||
Panamax install complete | Panamax install complete | ||
Coreosx64 core # | Coreosx64 core # | ||
− | </ | + | </syntaxhighlight> |
Ligne 97 : | Ligne 95 : | ||
− | < | + | <syntaxhighlight lang="bash"> |
Coreosx64 core # docker ps | Coreosx64 core # docker ps | ||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | ||
Ligne 103 : | Ligne 101 : | ||
e787f827bc9a centurylink/panamax-api:latest "/bin/sh -c 'bundle About a minute ago Up About a minute 0.0.0.0:3001->3000/tcp PMX_API | e787f827bc9a centurylink/panamax-api:latest "/bin/sh -c 'bundle About a minute ago Up About a minute 0.0.0.0:3001->3000/tcp PMX_API | ||
99dd1912fa47 google/cadvisor:0.2.2 "/usr/bin/cadvisor - About a minute ago Up About a minute 0.0.0.0:49153->8080/tcp PMX_CADVISOR | 99dd1912fa47 google/cadvisor:0.2.2 "/usr/bin/cadvisor - About a minute ago Up About a minute 0.0.0.0:49153->8080/tcp PMX_CADVISOR | ||
− | </ | + | </syntaxhighlight> |
Ligne 123 : | Ligne 121 : | ||
− | < | + | <syntaxhighlight lang="bash"> |
core@CoreOSnode-1 ~ $ ETCD_URL=$(curl http://discovery.etcd.io/new) | core@CoreOSnode-1 ~ $ ETCD_URL=$(curl http://discovery.etcd.io/new) | ||
% Total % Received % Xferd Average Speed Time Time Time Current | % Total % Received % Xferd Average Speed Time Time Time Current | ||
Ligne 130 : | Ligne 128 : | ||
core@CoreOSnode-1 ~ $ echo $ETCD_URL | core@CoreOSnode-1 ~ $ echo $ETCD_URL | ||
https://discovery.etcd.io/b8069c9bd67eae5cf19689daf4ebdd66 | https://discovery.etcd.io/b8069c9bd67eae5cf19689daf4ebdd66 | ||
− | </ | + | </syntaxhighlight> |
Ligne 136 : | Ligne 134 : | ||
− | < | + | <syntaxhighlight lang="bash"> |
core@CoreOSnode-1 ~ $ sudo wget -NP /usr/share/oem/ http://mirror02.ikoula.com/priv/coreos/cloud-config.yml | core@CoreOSnode-1 ~ $ sudo wget -NP /usr/share/oem/ http://mirror02.ikoula.com/priv/coreos/cloud-config.yml | ||
--2015-06-16 15:37:53-- http://mirror02.ikoula.com/priv/coreos/cloud-config.yml | --2015-06-16 15:37:53-- http://mirror02.ikoula.com/priv/coreos/cloud-config.yml | ||
Ligne 154 : | Ligne 152 : | ||
2015-06-16 15:37:53 (264 MB/s) - '/usr/share/oem/cloud-config.yml' saved [1542/1542] | 2015-06-16 15:37:53 (264 MB/s) - '/usr/share/oem/cloud-config.yml' saved [1542/1542] | ||
− | </ | + | </syntaxhighlight> |
− | < | + | <syntaxhighlight lang="bash"> |
core@CoreOSnode-1 ~ $ export `cat /etc/environment` | core@CoreOSnode-1 ~ $ export `cat /etc/environment` | ||
− | </ | + | </syntaxhighlight> |
Exécutez les commandes suivantes : | Exécutez les commandes suivantes : | ||
− | < | + | <syntaxhighlight lang="bash"> |
core@CoreOSnode-1 ~ $ sudo sed -i 's#DISCOVERY_URL#'$ETCD_URL'#g' /usr/share/oem/cloud-config.yml | core@CoreOSnode-1 ~ $ sudo sed -i 's#DISCOVERY_URL#'$ETCD_URL'#g' /usr/share/oem/cloud-config.yml | ||
core@CoreOSnode-1 ~ $ sudo sed -i 's#PRIVATE_IP#'$COREOS_PRIVATE_IPV4'#g' /usr/share/oem/cloud-config.yml | core@CoreOSnode-1 ~ $ sudo sed -i 's#PRIVATE_IP#'$COREOS_PRIVATE_IPV4'#g' /usr/share/oem/cloud-config.yml | ||
− | </ | + | </syntaxhighlight> |
On vérife que nos paramètres Etcd et Fleet on bien été substitués : | On vérife que nos paramètres Etcd et Fleet on bien été substitués : | ||
− | < | + | <syntaxhighlight lang="bash"> |
core@CoreOSnode-1 ~ $ cat /usr/share/oem/cloud-config.yml | core@CoreOSnode-1 ~ $ cat /usr/share/oem/cloud-config.yml | ||
#cloud-config | #cloud-config | ||
Ligne 226 : | Ligne 224 : | ||
fleet: | fleet: | ||
public-ip: 178.170.XX.XXX | public-ip: 178.170.XX.XXX | ||
− | </ | + | </syntaxhighlight> |
Ligne 232 : | Ligne 230 : | ||
− | < | + | <syntaxhighlight lang="bash"> |
core@CoreOSnode-1 ~ $ sudo rm -f /etc/machine-id | core@CoreOSnode-1 ~ $ sudo rm -f /etc/machine-id | ||
core@CoreOSnode-1 ~ $ sudo reboot | core@CoreOSnode-1 ~ $ sudo reboot | ||
− | </ | + | </syntaxhighlight> |
Ligne 241 : | Ligne 239 : | ||
− | < | + | <syntaxhighlight lang="bash"> |
core@CoreOSnode-1 ~ $ fleetctl list-machines | core@CoreOSnode-1 ~ $ fleetctl list-machines | ||
MACHINE IP METADATA | MACHINE IP METADATA | ||
7e685988... 178.170.XX.XXX - | 7e685988... 178.170.XX.XXX - | ||
− | </ | + | </syntaxhighlight> |
Ici nous voyons bien notre première instance dans la liste des machines Fleet, ce sera donc notre instance qui initialisera notre cluster CoreOS/Etcd/Fleet. | Ici nous voyons bien notre première instance dans la liste des machines Fleet, ce sera donc notre instance qui initialisera notre cluster CoreOS/Etcd/Fleet. | ||
− | + | ||
Configurez maintenant vos deux autres instances CoreOS remote deployment target en suivant les instructions ci-dessous : | Configurez maintenant vos deux autres instances CoreOS remote deployment target en suivant les instructions ci-dessous : | ||
Ligne 260 : | Ligne 258 : | ||
− | < | + | <syntaxhighlight lang="bash"> |
core@CoreOSnode-2 ~ $ cat /usr/share/oem/cloud-config.yml | core@CoreOSnode-2 ~ $ cat /usr/share/oem/cloud-config.yml | ||
#cloud-config | #cloud-config | ||
Ligne 317 : | Ligne 315 : | ||
fleet: | fleet: | ||
public-ip: 178.170.XX.YYY | public-ip: 178.170.XX.YYY | ||
− | </ | + | </syntaxhighlight> |
Ligne 323 : | Ligne 321 : | ||
− | < | + | <syntaxhighlight lang="bash"> |
core@CoreOSnode-3 ~ $ cat /usr/share/oem/cloud-config.yml | core@CoreOSnode-3 ~ $ cat /usr/share/oem/cloud-config.yml | ||
#cloud-config | #cloud-config | ||
Ligne 380 : | Ligne 378 : | ||
fleet: | fleet: | ||
public-ip: 178.170.XX.ZZZ | public-ip: 178.170.XX.ZZZ | ||
− | </ | + | </syntaxhighlight> |
Ligne 386 : | Ligne 384 : | ||
− | < | + | <syntaxhighlight lang="bash"> |
core@CoreOSnode-2 ~ $ sudo rm -f /etc/machine-id | core@CoreOSnode-2 ~ $ sudo rm -f /etc/machine-id | ||
core@CoreOSnode-2 ~ $ sudo reboot | core@CoreOSnode-2 ~ $ sudo reboot | ||
− | </ | + | </syntaxhighlight> |
− | < | + | <syntaxhighlight lang="bash"> |
core@CoreOSnode-3 ~ $ sudo rm -f /etc/machine-id | core@CoreOSnode-3 ~ $ sudo rm -f /etc/machine-id | ||
core@CoreOSnode-3 ~ $ sudo reboot | core@CoreOSnode-3 ~ $ sudo reboot | ||
− | </ | + | </syntaxhighlight> |
Ligne 401 : | Ligne 399 : | ||
− | < | + | <syntaxhighlight lang="bash"> |
core@CoreOSnode-1 ~ $ fleetctl list-machines | core@CoreOSnode-1 ~ $ fleetctl list-machines | ||
MACHINE IP METADATA | MACHINE IP METADATA | ||
Ligne 407 : | Ligne 405 : | ||
7e685988... 178.170.XX.YYY - | 7e685988... 178.170.XX.YYY - | ||
87e15a4a... 178.170.XX.ZZZ - | 87e15a4a... 178.170.XX.ZZZ - | ||
− | </ | + | </syntaxhighlight> |
Ligne 416 : | Ligne 414 : | ||
− | < | + | <syntaxhighlight lang="bash"> |
core@CoreOSnode-1 ~ $ sudo bash -c "$(curl http://download.panamax.io/agent/pmx-agent-install)" | core@CoreOSnode-1 ~ $ sudo bash -c "$(curl http://download.panamax.io/agent/pmx-agent-install)" | ||
% Total % Received % Xferd Average Speed Time Time Time Current | % Total % Received % Xferd Average Speed Time Time Time Current | ||
Ligne 431 : | Ligne 429 : | ||
./.version | ./.version | ||
Execute cd /root/pmx-agent && ./pmx-agent to invoke agent setup script. | Execute cd /root/pmx-agent && ./pmx-agent to invoke agent setup script. | ||
− | </ | + | </syntaxhighlight> |
− | Puis | + | Puis |
− | < | + | <syntaxhighlight lang="bash"> |
core@CoreOSnode-1 ~ $ sudo bash -c "$(curl http://download.panamax.io/agent/pmx-agent-install)" | core@CoreOSnode-1 ~ $ sudo bash -c "$(curl http://download.panamax.io/agent/pmx-agent-install)" | ||
% Total % Received % Xferd Average Speed Time Time Time Current | % Total % Received % Xferd Average Speed Time Time Time Current | ||
Ligne 475 : | Ligne 473 : | ||
10) quit | 10) quit | ||
Please select one of the preceding options: | Please select one of the preceding options: | ||
− | </ | + | </syntaxhighlight> |
Ligne 481 : | Ligne 479 : | ||
− | < | + | <syntaxhighlight lang="bash"> |
Please select one of the preceding options: 1 | Please select one of the preceding options: 1 | ||
Ligne 494 : | Ligne 492 : | ||
3) Marathon | 3) Marathon | ||
Please select one of the preceding options: | Please select one of the preceding options: | ||
− | </ | + | </syntaxhighlight> |
Ligne 500 : | Ligne 498 : | ||
− | < | + | <syntaxhighlight lang="bash"> |
Please select one of the preceding options: 2 | Please select one of the preceding options: 2 | ||
Ligne 555 : | Ligne 553 : | ||
SUJ0dWdndXVCTEVUcHNIcERXZWJpSQpOT0I3V2ZEQkh0RmRydkpLMEU2dEJzNjdVVkg0ZHdLNVcx | SUJ0dWdndXVCTEVUcHNIcERXZWJpSQpOT0I3V2ZEQkh0RmRydkpLMEU2dEJzNjdVVkg0ZHdLNVcx | ||
c0dNdjRsQTY4TGczdmFlWVpobHk0NGFpeGlPWUIzClV6TlUzN3h3eXFFbnVnU2MvM2x3VzhVRVdU | c0dNdjRsQTY4TGczdmFlWVpobHk0NGFpeGlPWUIzClV6TlUzN3h3eXFFbnVnU2MvM2x3VzhVRVdU | ||
− | + | XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | |
+ | XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
+ | XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
+ | XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
+ | XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
+ | XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
+ | XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
+ | XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
+ | XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | ||
cDBvTHdpOXVtS0VWeFQ5VjYrL1JsL3VoRHBlV09Nc3FOaVkyanBRVkhpZ1lWVVpKYlJhZ2xIbk42 | cDBvTHdpOXVtS0VWeFQ5VjYrL1JsL3VoRHBlV09Nc3FOaVkyanBRVkhpZ1lWVVpKYlJhZ2xIbk42 | ||
NDBXZApRZUZBTnMvT29aQTFrdDN1cFR5MmtlVWljLzMzTzlidTArU0hFUEZpd2Fqa3dkUURudXl4 | NDBXZApRZUZBTnMvT29aQTFrdDN1cFR5MmtlVWljLzMzTzlidTArU0hFUEZpd2Fqa3dkUURudXl4 | ||
Ligne 579 : | Ligne 585 : | ||
CoreOSnode-1 pmx-agent # | CoreOSnode-1 pmx-agent # | ||
− | </ | + | </syntaxhighlight> |
− | Comme cela est indiqué vous devez copier-coller la clé privée de votre panamax remote agent dans l'UI Panamax lors de la création de votre Panamax Remote Deployment Target. | + | Comme cela est indiqué vous devez copier-coller la clé privée de votre panamax remote agent dans l'UI Panamax lors de la création de votre Panamax Remote Deployment Target. |
Ligne 596 : | Ligne 602 : | ||
− | [[ | + | [[File:Panamax-ui-search-tmplt.png]] |
Ligne 602 : | Ligne 608 : | ||
− | [[ | + | [[File:Panamax-ui-fleche.png]] |
Ligne 608 : | Ligne 614 : | ||
− | [[ | + | [[File:Panamax-ui-deploytotarget.png]] |
Ligne 614 : | Ligne 620 : | ||
− | [[ | + | [[File:Panamax-ui-remotedeploymenttarget.png]] |
Ligne 620 : | Ligne 626 : | ||
− | [[ | + | [[File:Panamax-ui-entertokens.png]] |
− | - Saisissez l'adresse ip de votre Panamax Remote Agent que vous avez paramétré lors de l'installation dans le champs "Name" puis copiez-collez votre clé privé de l'agent retourné à la fin de l'installation du Panamax Remote Agent | + | - Saisissez l'adresse ip de votre Panamax Remote Agent que vous avez paramétré lors de l'installation dans le champs "Name" puis copiez-collez votre clé privé de l'agent retourné à la fin de l'installation du Panamax Remote Agent |
− | [[ | + | [[File:Panamax-ui-tokens.png]] |
Ligne 635 : | Ligne 641 : | ||
− | [[ | + | [[File:Panamax-ui-remotedeploytarget-added.png]] |
Ligne 641 : | Ligne 647 : | ||
− | [[ | + | [[File:Panamax-ui-remotedeploymenttarget-update.png]] |
Ligne 647 : | Ligne 653 : | ||
− | [[ | + | [[File:Panamax-ui-remotedeploymenttarget-informations.png]] |
Ligne 657 : | Ligne 663 : | ||
− | - Recherchez le nom de l'application que vous souhaitez déployer. Nous choisissons le template Century Link "Wordpress with MySQL" | + | - Recherchez le nom de l'application que vous souhaitez déployer. Nous choisissons le template Century Link "Wordpress with MySQL" |
− | - Vous pouvez cliquez sur "More Details" pour avoir plus d'informations sur le template que vous avez choisis. Vous pouvez également voir de combien d'image Docker le template est constitué (dans notre cas 2 images) | + | - Vous pouvez cliquez sur "More Details" pour avoir plus d'informations sur le template que vous avez choisis. Vous pouvez également voir de combien d'image Docker le template est constitué (dans notre cas 2 images) |
− | [[ | + | [[File:Panamax-ui-template-details.png]] |
Ligne 669 : | Ligne 675 : | ||
− | [[ | + | [[File:Panamax-ui-deploytotarget-wordpress.png]] |
− | - Cliquez sur "Select this Target" pour sélectionner votre Remote Deployment Target | + | - Cliquez sur "Select this Target" pour sélectionner votre Remote Deployment Target |
− | [[ | + | [[File:Panamax-ui-select-target.png]] |
− | - Renseignez les éventuels champs de "Deployment Settings" de l'application que vous déployée (mot de passe, variables d'environnement,etc.) puis cliquez sur le bouton "Deploy to Target" en dessous pour valider | + | - Renseignez les éventuels champs de "Deployment Settings" de l'application que vous déployée (mot de passe, variables d'environnement,etc.) puis cliquez sur le bouton "Deploy to Target" en dessous pour valider |
− | [[ | + | [[File:Panamax-ui-deployment-settings.png]] |
Ligne 687 : | Ligne 693 : | ||
− | [[ | + | [[File:Panamax-ui-deployment-triggered.png]] |
Ligne 696 : | Ligne 702 : | ||
− | < | + | <syntaxhighlight lang="bash"> |
core@CoreOSnode-1 ~ $ docker ps | core@CoreOSnode-1 ~ $ docker ps | ||
CONTAINER ID IMAGE COMMAND CREATED STATUS PO RTS NAMES | CONTAINER ID IMAGE COMMAND CREATED STATUS PO RTS NAMES | ||
Ligne 702 : | Ligne 708 : | ||
84e3c5fe1886 centurylink/panamax-remote-agent:latest "/panamax-remote-age 37 minutes ago Up 37 minutes 0. 0.0.0:3001->3000/tcp pmx_agent | 84e3c5fe1886 centurylink/panamax-remote-agent:latest "/panamax-remote-age 37 minutes ago Up 37 minutes 0. 0.0.0:3001->3000/tcp pmx_agent | ||
71009f7785d3 centurylink/panamax-fleet-adapter:latest "rackup '-E producti 37 minutes ago Up 37 minutes 92 92/tcp pmx_adapter | 71009f7785d3 centurylink/panamax-fleet-adapter:latest "rackup '-E producti 37 minutes ago Up 37 minutes 92 92/tcp pmx_adapter | ||
− | </ | + | </syntaxhighlight> |
Ligne 708 : | Ligne 714 : | ||
− | + | <syntaxhighlight lang="bash"> | |
− | |||
− | |||
− | < | ||
core@CoreOSnode-3 ~ $ docker ps | core@CoreOSnode-3 ~ $ docker ps | ||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | ||
84deeadd66fa centurylink/mysql:5.5 "/usr/local/bin/run" 4 minutes ago Up 4 minutes 0.0.0.0:3306->3306/tcp db | 84deeadd66fa centurylink/mysql:5.5 "/usr/local/bin/run" 4 minutes ago Up 4 minutes 0.0.0.0:3306->3306/tcp db | ||
− | </ | + | </syntaxhighlight> |
+ | |||
+ | |||
+ | - Nous pouvons également avoir certaines informations par l'intermédiaire de notre gestionnaire de cluster Etcd : | ||
+ | |||
+ | |||
+ | On retrouve nos 2 applications (Wordpress "WP" et MySQL "DB") : | ||
+ | |||
+ | |||
+ | <syntaxhighlight lang="bash"> | ||
+ | core@CoreOSnode-1 ~ $ etcdctl ls --recursive /app | ||
+ | /app/DB | ||
+ | /app/DB/DB_SERVICE_HOST | ||
+ | /app/WP | ||
+ | /app/WP/WP_SERVICE_HOST | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | |||
+ | On peut également voir sur quel instance membre de notre cluster l'application a été déployée : | ||
+ | |||
+ | |||
+ | <syntaxhighlight lang="bash"> | ||
+ | core@CoreOSnode-1 ~ $ etcdctl get /app/DB/DB_SERVICE_HOST | ||
+ | 178.170.XX.XXX | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | |||
+ | <syntaxhighlight lang="bash"> | ||
+ | core@CoreOSnode-1 ~ $ etcdctl get /app/WP/WP_SERVICE_HOST | ||
+ | 178.170.XX.ZZZ | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | |||
+ | - Nous pouvons aussi avoir le statut des applications de notre cluster par Fleet qui le gestionnaire des applications dans notre cluster : | ||
+ | |||
+ | |||
+ | <syntaxhighlight lang="bash"> | ||
+ | core@CoreOSnode-1 ~ $ fleetctl list-unit-files | ||
+ | UNIT HASH DSTATE STATE TARGET | ||
+ | db.service 0caad43 launched launched 6eacee19.../178.170.XX.XXX | ||
+ | wp.service 417826f launched launched 7e685988.../178.170.XX.ZZZ | ||
+ | </syntaxhighlight> | ||
Ligne 721 : | Ligne 765 : | ||
− | [[ | + | [[File:Panamax-application-wordpress.png]] |
− | |||
− | |||
− | |||
− |
Version du 18 juin 2015 à 14:41
Si vous ne connaissez pas encore Panamax (http://http://panamax.io/) il s'agit d'un produit Open Source développé par Century Link Labs qui est à la fois une market place et un gestionnaire pour applications conteneurisées Docker depuis une interface web intuitive.
Il suffit en effet de chercher l'application de notre choix puis d'un clique pour la déployer sur nos instances cibles à l'aide de docker et d'un agent Panamax.
Panamax s'appuie sur les technologies Docker, CoreOS,Etcd, Fleet et Cloud-init
Nous utiliserons dans notre exemple une instance CoreOS pour la partie client Panamax UI puis 3 autres instances pour la partie Panamax Remote Target (Panamax Remote Agent + Panamax Adapter) :
Installation de Panamax UI :
core@Coreosx64 ~ $ curl -O http://download.panamax.io/installer/pmx-installer- latest.zip
% Total % Received % Xferd Average Speed Time Time Time Curren t
Dload Upload Total Spent Left Speed
100 16007 100 16007 0 0 26989 0 --:--:-- --:--:-- --:--:-- 37663
core@Coreosx64 ~ $ unzip pmx-installer-latest.zip
Archive: pmx-installer-latest.zip
inflating: create-docker-mount
inflating: LICENSE
inflating: desktop
extracting: panamax
inflating: .coreosenv
inflating: README.md
inflating: CHANGELOG.md
inflating: ubuntu.sh
inflating: Vagrantfile
extracting: .version
inflating: coreos
inflating: CONTRIBUTING.md
Nous devons passer root pour la suite de l'installation :
core@Coreosx64 ~ $ sudo su
Coreosx64 core # ./coreos install --stable
Installing Panamax...
docker pull centurylink/panamax-api:latest
..
docker pull centurylink/panamax-ui:latest
..
docker pull google/cadvisor:0.2.2
..
Created symlink from /etc/systemd/system/multi-user.target.wants/panamax-metrics.service to /etc/systemd/system/panamax-metrics.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/panamax-api.service to /etc/systemd/system/panamax-api.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/panamax-ui.service to /etc/systemd/system/panamax-ui.service.
Jun 16 15:03:25 Coreosx64 systemd[1]: Starting Panamax Metrics...
Jun 16 15:03:25 Coreosx64 dockerd[730]: time="2015-06-16T15:03:25+02:00" level="info" msg="DELETE /v1.17/containers/PMX_CADVISOR?force=1"
Jun 16 15:03:25 Coreosx64 dockerd[730]: time="2015-06-16T15:03:25+02:00" level="info" msg="+job rm(PMX_CADVISOR)"
Jun 16 15:03:25 Coreosx64 dockerd[730]: No such container: PMX_CADVISOR
Jun 16 15:03:25 Coreosx64 dockerd[730]: time="2015-06-16T15:03:25+02:00" level="info" msg="-job rm(PMX_CADVISOR) = ERR (1)"
Jun 16 15:03:25 Coreosx64 dockerd[730]: time="2015-06-16T15:03:25+02:00" level="error" msg="Handler for DELETE /containers/{name:.*} returned error: No such container: PMX_CADVISOR"
Jun 16 15:03:25 Coreosx64 dockerd[730]: time="2015-06-16T15:03:25+02:00" level="error" msg="HTTP Error: statusCode=404 No such container: PMX_CADVISOR"
Jun 16 15:03:25 Coreosx64 docker[1676]: Error response from daemon: No such container: PMX_CADVISOR
Jun 16 15:03:25 Coreosx64 systemd[1]: Started Panamax Metrics.
Jun 16 15:03:25 Coreosx64 systemd[1]: Starting Panamax API...
Jun 16 15:03:25 Coreosx64 dockerd[730]: time="2015-06-16T15:03:25+02:00" level="info" msg="DELETE /v1.17/containers/PMX_API?force=1"
Jun 16 15:03:25 Coreosx64 dockerd[730]: time="2015-06-16T15:03:25+02:00" level="info" msg="+job rm(PMX_API)"
Jun 16 15:03:25 Coreosx64 dockerd[730]: No such container: PMX_API
Jun 16 15:03:25 Coreosx64 dockerd[730]: time="2015-06-16T15:03:25+02:00" level="info" msg="-job rm(PMX_API) = ERR (1)"
Jun 16 15:03:25 Coreosx64 dockerd[730]: time="2015-06-16T15:03:25+02:00" level="error" msg="Handler for DELETE /containers/{name:.*} returned error: No such container: PMX_API"
Jun 16 15:03:25 Coreosx64 dockerd[730]: time="2015-06-16T15:03:25+02:00" level="error" msg="HTTP Error: statusCode=404 No such container: PMX_API"
Jun 16 15:03:25 Coreosx64 docker[1691]: Error response from daemon: No such container: PMX_API
Jun 16 15:03:25 Coreosx64 systemd[1]: Started Panamax API.
Jun 16 15:03:25 Coreosx64 systemd[1]: Starting Panamax UI...
Jun 16 15:03:25 Coreosx64 dockerd[730]: time="2015-06-16T15:03:25+02:00" level="info" msg="POST /v1.17/containers/create?name=PMX_CADVISOR"
Jun 16 15:03:25 Coreosx64 dockerd[730]: time="2015-06-16T15:03:25+02:00" level="info" msg="+job create(PMX_CADVISOR)"
Jun 16 15:03:25 Coreosx64 dockerd[730]: time="2015-06-16T15:03:25+02:00" level="info" msg="-job create(PMX_CADVISOR) = OK (0)"
Jun 16 15:03:25 Coreosx64 dockerd[730]: time="2015-06-16T15:03:25+02:00" level="info" msg="DELETE /v1.17/containers/PMX_UI?force=1"
Jun 16 15:03:25 Coreosx64 dockerd[730]: time="2015-06-16T15:03:25+02:00" level="info" msg="+job rm(PMX_UI)"
Jun 16 15:03:25 Coreosx64 dockerd[730]: No such container: PMX_UI
Jun 16 15:03:25 Coreosx64 dockerd[730]: time="2015-06-16T15:03:25+02:00" level="info" msg="-job rm(PMX_UI) = ERR (1)"
Jun 16 15:03:25 Coreosx64 dockerd[730]: time="2015-06-16T15:03:25+02:00" level="error" msg="Handler for DELETE /containers/{name:.*} returned error: No such container: PMX_UI"
Jun 16 15:03:25 Coreosx64 dockerd[730]: time="2015-06-16T15:03:25+02:00" level="error" msg="HTTP Error: statusCode=404 No such container: PMX_UI"
Jun 16 15:03:25 Coreosx64 docker[1715]: Error response from daemon: No such container: PMX_UI
Jun 16 15:03:25 Coreosx64 dockerd[730]: time="2015-06-16T15:03:25+02:00" level="info" msg="POST /v1.17/containers/create?name=PMX_API"
Jun 16 15:03:25 Coreosx64 dockerd[730]: time="2015-06-16T15:03:25+02:00" level="info" msg="+job create(PMX_API)"
Jun 16 15:03:25 Coreosx64 systemd[1]: Started Panamax UI.
Panamax install complete
Coreosx64 core #
Nous vérifions que nos 3 containers sont bien en cours d'exécution :
Coreosx64 core # docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
dc1d036c4987 centurylink/panamax-ui:latest "/bin/sh -c 'bundle About a minute ago Up About a minute 0.0.0.0:3000->3000/tcp PMX_UI
e787f827bc9a centurylink/panamax-api:latest "/bin/sh -c 'bundle About a minute ago Up About a minute 0.0.0.0:3001->3000/tcp PMX_API
99dd1912fa47 google/cadvisor:0.2.2 "/usr/bin/cadvisor - About a minute ago Up About a minute 0.0.0.0:49153->8080/tcp PMX_CADVISOR
Nous pouvons nous connecter à notre UI Panamax à l'aide de notre navigateur en tappant l'ip de notre instance suivit de ":3000" pour préciser le port d'écoute (n'oubliez pas de créer des règles d'autorisations parefeu et de redirection de port) de celle-ci :
Installation de Panamax Remote Deployment Target :
Connectez-vous à l'une de vos 3 instances CoreOS déployées à cet effet :
Générer une nouvelle URL de discovery Etcd dans une variable (ici: ETCD_URL) :
core@CoreOSnode-1 ~ $ ETCD_URL=$(curl http://discovery.etcd.io/new)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 58 100 58 0 0 79 0 --:--:-- --:--:-- --:--:-- 101
core@CoreOSnode-1 ~ $ echo $ETCD_URL
https://discovery.etcd.io/b8069c9bd67eae5cf19689daf4ebdd66
Puis téléchargez le fichier cloud-config.yml template suivant :
core@CoreOSnode-1 ~ $ sudo wget -NP /usr/share/oem/ http://mirror02.ikoula.com/priv/coreos/cloud-config.yml
--2015-06-16 15:37:53-- http://mirror02.ikoula.com/priv/coreos/cloud-config.yml
Resolving mirror02.ikoula.com... 80.93.XX.XXX, 2a00:c70:1:80:93:XX:XXX:1
Connecting to mirror02.ikoula.com|80.93.XX.XXX|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1542 (1.5K) [text/plain]
Remote file is newer, retrieving.
--2015-06-16 15:37:53-- http://mirror02.ikoula.com/priv/coreos/cloud-config.yml
Reusing existing connection to mirror02.ikoula.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 1542 (1.5K) [text/plain]
Saving to: '/usr/share/oem/cloud-config.yml'
/usr/share/oem/cloud-config.yml 100%[===================================================================================================>] 1.51K --.-KB/s in 0s
2015-06-16 15:37:53 (264 MB/s) - '/usr/share/oem/cloud-config.yml' saved [1542/1542]
core@CoreOSnode-1 ~ $ export `cat /etc/environment`
Exécutez les commandes suivantes :
core@CoreOSnode-1 ~ $ sudo sed -i 's#DISCOVERY_URL#'$ETCD_URL'#g' /usr/share/oem/cloud-config.yml
core@CoreOSnode-1 ~ $ sudo sed -i 's#PRIVATE_IP#'$COREOS_PRIVATE_IPV4'#g' /usr/share/oem/cloud-config.yml
On vérife que nos paramètres Etcd et Fleet on bien été substitués :
core@CoreOSnode-1 ~ $ cat /usr/share/oem/cloud-config.yml
#cloud-config
coreos:
units:
- name: cloudstack-ssh-key.service
command: restart
runtime: yes
content: |
[Unit]
Description=Sets SSH key from metadata
[Service]
Type=oneshot
StandardOutput=journal+console
ExecStart=/usr/share/oem/bin/cloudstack-ssh-key
- name: cloudstack-hostname.service
command: restart
runtime: yes
content: |
[Unit]
Description=Sets hostname from metadata
[Service]
Type=oneshot
StandardOutput=journal+console
ExecStart=/usr/share/oem/bin/cloudstack-hostname
- name: cloudstack-cloudinit.service
command: restart
runtime: yes
content: |
[Unit]
Description=Cloudinit from CloudStack-style metadata
Requires=coreos-setup-environment.service
After=coreos-setup-environment.service
[Service]
Type=oneshot
EnvironmentFile=/etc/environment
ExecStart=/usr/share/oem/bin/cloudstack-coreos-cloudinit
- name: etcd.service
command: start
- name: fleet.service
command: start
oem:
id: cloudstack
name: CloudStack
version-id: 0.0.1-r3
home-url: http://cloudstack.apache.org/
bug-report-url: https://github.com/coreos/coreos-overlay
etcd:
discovery: https://discovery.etcd.io/b8069c9bd67eae5cf19689daf4ebdd66
addr: 178.170.XX.XXX:4001
peer-addr: 178.170.XX.XXX:7001
fleet:
public-ip: 178.170.XX.XXX
Supprimez le fichier /etc/machine-id puis rebootez l'instance afin de regénérer un nouveau id de machine (vos 3 instances devront avoir un id différent) :
core@CoreOSnode-1 ~ $ sudo rm -f /etc/machine-id
core@CoreOSnode-1 ~ $ sudo reboot
Votre première instance devrait apparaitre dans la liste des machines gérées dans Fleet :
core@CoreOSnode-1 ~ $ fleetctl list-machines
MACHINE IP METADATA
7e685988... 178.170.XX.XXX -
Ici nous voyons bien notre première instance dans la liste des machines Fleet, ce sera donc notre instance qui initialisera notre cluster CoreOS/Etcd/Fleet.
Configurez maintenant vos deux autres instances CoreOS remote deployment target en suivant les instructions ci-dessous :
Connectez-vous à vos deux autres instances puis recopiez le contenu du fichier /usr/share/oem/cloud-config.yml de votre première instance en remplaçant uniquement l'ip de celle-ci par l'ip de votre seconde instance sur votre seconde instance et par l'ip de votre troisième instance sur votre troisième instance (vous devrez passez root via un "sudo su") :
Sur notre seconde instance (adresse ip 178.170.XX.YYY) le fichier /usr/share/oem/cloud-config.yml aura donc le contenu suivant :
core@CoreOSnode-2 ~ $ cat /usr/share/oem/cloud-config.yml
#cloud-config
coreos:
units:
- name: cloudstack-ssh-key.service
command: restart
runtime: yes
content: |
[Unit]
Description=Sets SSH key from metadata
[Service]
Type=oneshot
StandardOutput=journal+console
ExecStart=/usr/share/oem/bin/cloudstack-ssh-key
- name: cloudstack-hostname.service
command: restart
runtime: yes
content: |
[Unit]
Description=Sets hostname from metadata
[Service]
Type=oneshot
StandardOutput=journal+console
ExecStart=/usr/share/oem/bin/cloudstack-hostname
- name: cloudstack-cloudinit.service
command: restart
runtime: yes
content: |
[Unit]
Description=Cloudinit from CloudStack-style metadata
Requires=coreos-setup-environment.service
After=coreos-setup-environment.service
[Service]
Type=oneshot
EnvironmentFile=/etc/environment
ExecStart=/usr/share/oem/bin/cloudstack-coreos-cloudinit
- name: etcd.service
command: start
- name: fleet.service
command: start
oem:
id: cloudstack
name: CloudStack
version-id: 0.0.1-r3
home-url: http://cloudstack.apache.org/
bug-report-url: https://github.com/coreos/coreos-overlay
etcd:
discovery: https://discovery.etcd.io/b8069c9bd67eae5cf19689daf4ebdd66
addr: 178.170.XX.YYY:4001
peer-addr: 178.170.XX.YYY:7001
fleet:
public-ip: 178.170.XX.YYY
Sur notre troisième instance (adresse ip 178.170.XX.ZZZ) le fichier /usr/share/oem/cloud-config.yml aura donc le contenu suivant :
core@CoreOSnode-3 ~ $ cat /usr/share/oem/cloud-config.yml
#cloud-config
coreos:
units:
- name: cloudstack-ssh-key.service
command: restart
runtime: yes
content: |
[Unit]
Description=Sets SSH key from metadata
[Service]
Type=oneshot
StandardOutput=journal+console
ExecStart=/usr/share/oem/bin/cloudstack-ssh-key
- name: cloudstack-hostname.service
command: restart
runtime: yes
content: |
[Unit]
Description=Sets hostname from metadata
[Service]
Type=oneshot
StandardOutput=journal+console
ExecStart=/usr/share/oem/bin/cloudstack-hostname
- name: cloudstack-cloudinit.service
command: restart
runtime: yes
content: |
[Unit]
Description=Cloudinit from CloudStack-style metadata
Requires=coreos-setup-environment.service
After=coreos-setup-environment.service
[Service]
Type=oneshot
EnvironmentFile=/etc/environment
ExecStart=/usr/share/oem/bin/cloudstack-coreos-cloudinit
- name: etcd.service
command: start
- name: fleet.service
command: start
oem:
id: cloudstack
name: CloudStack
version-id: 0.0.1-r3
home-url: http://cloudstack.apache.org/
bug-report-url: https://github.com/coreos/coreos-overlay
etcd:
discovery: https://discovery.etcd.io/b8069c9bd67eae5cf19689daf4ebdd66
addr: 178.170.XX.ZZZ:4001
peer-addr: 178.170.XX.ZZZ:7001
fleet:
public-ip: 178.170.XX.ZZZ
Comme pour votre première instance, supprimer le fichier /etc/machine-id et rebootez :
core@CoreOSnode-2 ~ $ sudo rm -f /etc/machine-id
core@CoreOSnode-2 ~ $ sudo reboot
core@CoreOSnode-3 ~ $ sudo rm -f /etc/machine-id
core@CoreOSnode-3 ~ $ sudo reboot
Une fois rebootées, vos 2 autres instances ont normalement rejoint votre cluster CoreOS/Etcd/Fleet :
core@CoreOSnode-1 ~ $ fleetctl list-machines
MACHINE IP METADATA
6eacee19... 178.170.XX.XXX -
7e685988... 178.170.XX.YYY -
87e15a4a... 178.170.XX.ZZZ -
Si vos instances n'ont pas rejoint le cluster, pensez à vérifier que vos instances peuvent bien communiquer entre elles (connexions réseaux, règles parefeu/security group)
Maintenant que nous avons un cluster CoreOS/etcd/fleet de 3 instances, nous allons installer le panamax-remote-agent ainsi que le panamax-adapter :
core@CoreOSnode-1 ~ $ sudo bash -c "$(curl http://download.panamax.io/agent/pmx-agent-install)"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 685 100 685 0 0 1756 0 --:--:-- --:--:-- --:--:-- 3156
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 8613 100 8613 0 0 27496 0 --:--:-- --:--:-- --:--:-- 27694
./
./pmx-agent
./README.md
./CHANGELOG.md
./openssl.cnf
./.version
Execute cd /root/pmx-agent && ./pmx-agent to invoke agent setup script.
Puis
core@CoreOSnode-1 ~ $ sudo bash -c "$(curl http://download.panamax.io/agent/pmx-agent-install)"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 685 100 685 0 0 1756 0 --:--:-- --:--:-- --:--:-- 3156
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 8613 100 8613 0 0 27496 0 --:--:-- --:--:-- --:--:-- 27694
./
./pmx-agent
./README.md
./CHANGELOG.md
./openssl.cnf
./.version
Execute cd /root/pmx-agent && ./pmx-agent to invoke agent setup script.
core@CoreOSnode-1 ~ $ sudo su
CoreOSnode-1 core # cd /root/pmx-agent
███████╗ ██████╗ █████████╗ ██████╗ ██████████╗ ██████╗ ██╗ ██╗
██╔══██║ ╚═══██╗ ███╗ ███║ ╚═══██╗ ██║ ██╔ ██║ ╚═══██╗ ╚██╗██╔╝
██ ██║ ███████║ ███║ ███║ ███████║ ██║╚██║ ██║ ███████║ ╚███╔╝
███████╝ ███████║ ███║ ███║ ███████║ ██║╚██║ ██║ ███████║ ██╔██╗
██║ ███████║ ███║ ███║ ███████║ ██║╚██║ ██║ ███████║ ██╔╝ ██╗
╚═╝ ╚══════╝ ╚══╝ ╚══╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚═╝ ╚═╝
CenturyLink Labs - http://www.centurylinklabs.com/
1) init: First time installing Panamax Remote Agent! - Downloads and installs Panamax Remote Agent.
2) restart: Stops and Starts Panamax Remote Agent and Adapter.
3) reinstall: Deletes your current Panamax Remote Agent and Adapter and reinstalls latest version.
4) check: Checks for available updates for Panamax Remote Agent and Adapter.
5) update: Updates to latest Panamax Remote Agent and Adapter.
6) delete: Uninstalls Panamax Remote Agent and Adapter.
7) debug: Display your current Panamax settings.
8) token: Display your current Panamax Remote Agent token.
9) help: Show this help
10) quit
Please select one of the preceding options:
Tapez 1 pour installer le Panamax Remote Agent :
Please select one of the preceding options: 1
Installing panamax remote agent/adapter...
Installing Panamax adapter:
Select the ochestrator you want to use:
1) Kubernetes
2) CoreOS Fleet
3) Marathon
Please select one of the preceding options:
Choisissez l'orchestrateur "2) CoreOS Fleet" et indiquez votre ip :
Please select one of the preceding options: 2
Enter the API endpoint to access the Fleet cluster (e.g: http://10.187.241.100:4001): http://178.170.XX.XXX:4001
Starting Panamax Fleet adapter:
docker pull centurylink/panamax-fleet-adapter:latest
56b22791d9b3dac06e2348a6a867527ffae01a37ab374159be48bbafaf77334f
Installing Panamax remote agent:
Enter the public hostname (dev.example.com, without 'http') or IP Address (ex: 206.x.x.x) of the agent: Enter the public hostname (dev.example.com, without 'http') or IP Address (ex: 206.x.x.x) of the agent: 178.170.XX.XXX
Enter the port to run the agent on (3001):
Generating SSL Key
docker pull centurylink/openssl:latest
Generating RSA private key, 1024 bit long modulus
......++++++
..............................................................................++++++
e is 65537 (0x10001)
Generating a 4096 bit RSA private key
........................................................................................++
................................................................++
writing new private key to '/certs/pmx_remote_agent.key'
-----
No value provided for Subject Attribute C, skipped
No value provided for Subject Attribute ST, skipped
No value provided for Subject Attribute L, skipped
No value provided for Subject Attribute O, skipped
Signature ok
subject=/CN=178.170.XX.XXX
Getting Private key
Starting Panamax remote agent:
docker pull centurylink/panamax-remote-agent:latest
524bc3b7db813d2f20f8dc028037ce8f42ecfc05ebe8c4f67a172e3f6125dc44
============================== START ==============================
aHR0cHM6Ly8xNzguMTcwLjY4LjE1NzozMDAxfDdiYzExYjNiLTMxZDEtNGM1NS1hZWNlLWFmNTRk
NGQ1NzkzNHxOVGs1TUdNMk5tVXRNV0UzWlMwME1EUmhMVGc1T0RNdFpqZGhZVEJqWTJVM1ptSm1D
Zz09fC0tLS0tQkVHSU4gQ0VSVElGSUNBVEUtLS0tLQpNSUlGRmpDQ0F2NmdBd0lCQWdJSkFKb003
cDJiRTd6aU1BMEdDU3FHU0liM0RRRUJCUVVBTUJreEZ6QVZCZ05WCkJBTU1EakUzT0M0eE56QXVO
amd1TVRVM01CNFhEVEUxTURZeE5qRTBOVGt6TjFvWERURTJNRFl4TlRFME5Ua3oKTjFvd0dURVhN
QlVHQTFVRUF3d09NVGM0TGpFM01DNDJPQzR4TlRjd2dnSWlNQTBHQ1NxR1NJYjNEUUVCQVFVQQpB
NElDRHdBd2dnSUtBb0lDQVFDZHFmOFVZM21RWnJpUTdLSTVJV0RuNkJuS3lIclkxTitZeE1OaVlj
WnRKSm5yCmt3UlhDQzRVelNDNEdrMmszcFIzeHppd0piN1VUYmRwMXUrQlhnYjgvVHV3dDhENUxp
MVovUzRudmVoUlA4N0YKa0trcENpeU8zUllyQXc0QkFqZVkvb2Jsem5nN2Y0T2dXYWhaamhnV201
SUJ0dWdndXVCTEVUcHNIcERXZWJpSQpOT0I3V2ZEQkh0RmRydkpLMEU2dEJzNjdVVkg0ZHdLNVcx
c0dNdjRsQTY4TGczdmFlWVpobHk0NGFpeGlPWUIzClV6TlUzN3h3eXFFbnVnU2MvM2x3VzhVRVdU
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
cDBvTHdpOXVtS0VWeFQ5VjYrL1JsL3VoRHBlV09Nc3FOaVkyanBRVkhpZ1lWVVpKYlJhZ2xIbk42
NDBXZApRZUZBTnMvT29aQTFrdDN1cFR5MmtlVWljLzMzTzlidTArU0hFUEZpd2Fqa3dkUURudXl4
dGVRNnBJVEhhVDdSCmVoWEdDdDRmVXBSUjZsT2xGWjRTS2JjQmtBa3dZa2V5Y0N5VTltTkV3Yk1R
M0xJZmY5K0pSa3hqTXQ1YnRzTHgKWDk2d08zWURBYkc2NmxmQkh1TTJLNWZVck1yWDlUbmpmN0x5
Z0hjcnJWWmFiK2JjUkM2SzZVQnI1RTl4R2xKNgpGZHZMdkUySW5uQjkrRzIrM2V1OXh6UXVFWGpB
K2ZzUDJReDRJU2w3NGpYaTRWa3Ziem41TnhUVHJsRzNaYk9WCkp3NTRmV21lOHRwQ2N4Vit2V2JW
M0tCZ2JpMXRlKzRKTFZuV1VKTlpVUng5K2VUTG82UTd2Tm1iSG1RTS8wOHIKVWZIR1JSOGlPZGwr
NjlDZjNlUWwvenhCSVE2cXN4bGxzWTJMd3IvMGFFaURuUDRtNk5WUEtuSmN4VDNNbTRuZwp4TjdR
OXh6V08rWUdhdUVhaHNMUkF2QXhleFVPZkkrUHlmT0lYVFova1hJWjA1VWxVU3RoYUJ3bzFXRlVI
VnFWCjhxU1pjdEU0UGRneExSejNXclltZTdVWTJEbWJuUkJOVHlFOW0yeFJPVEh6RUlQWTdDVXZ3
MDh0ZFpHczNkbG8KbVdPSVcwMGk1MEROa1ArT1RyWm5OcHU3VVRjL3ZPQ3hSaGJyM1o4OTNyWXA3
SUlKT0VQWUFjT1pzMHRkQWNvQwowSldRRTZzUnFRT1dCQT09Ci0tLS0tRU5EIENFUlRJRklDQVRF
LS0tLS0K
============================== END ==============================
Copy and paste the above (Not including start/end tags) to your local panamax client to connect to this remote agent.
Remote Agent/Adapter installation complete!
CoreOSnode-1 pmx-agent #
Comme cela est indiqué vous devez copier-coller la clé privée de votre panamax remote agent dans l'UI Panamax lors de la création de votre Panamax Remote Deployment Target.
Pour ajouter votre Panamax Remote Deployment Target dans votre Panamax UI, connectez-vous à celle-ci via votre navigateur :
- allez dans "MANAGE"
- recherchez un template (ex: Wordpress with MySQL)
- cliquez sur la flèche à droite de "Run Template"
- cliquez sur "Deploy to Target" :
- Cliquez sur "Add a New Remote Deployment Target"
- Cliquez sur "Enter your token here." (en bas à droite de la page)
- Saisissez l'adresse ip de votre Panamax Remote Agent que vous avez paramétré lors de l'installation dans le champs "Name" puis copiez-collez votre clé privé de l'agent retourné à la fin de l'installation du Panamax Remote Agent
- Cliquez sur "Save Remote Deployment Target"
Vous devriez avoir le résultat suivant :
- Cliquez sur la flèche verte à gauche du nom de votre Remote Deployment Target puis forcer une première mise à jour :
Après mise à jour, les informations sur votre Remote Deployment Targets telles que la version de votre Panamax Remote Agent, le type de votre Panamax Adapter et sa version :
Déploiement d'une application via Panamax UI :
Il vous est maintenant possible de déployer une application disponible dans la market place "Panamax Templates & Docker Repositories" depuis votre Panamax UI sur votre Panamax Remote Deployment Target :
- Recherchez le nom de l'application que vous souhaitez déployer. Nous choisissons le template Century Link "Wordpress with MySQL"
- Vous pouvez cliquez sur "More Details" pour avoir plus d'informations sur le template que vous avez choisis. Vous pouvez également voir de combien d'image Docker le template est constitué (dans notre cas 2 images)
- Cliquez sur la flèche "Run Template" pour déployer le menu et cliquez sur "Deploy to Target" :
- Cliquez sur "Select this Target" pour sélectionner votre Remote Deployment Target
- Renseignez les éventuels champs de "Deployment Settings" de l'application que vous déployée (mot de passe, variables d'environnement,etc.) puis cliquez sur le bouton "Deploy to Target" en dessous pour valider
- Cela devrait vous retourner le résultat suivant :
Si vous vous connectez à vos instances de votre cluster CoreOS, vous pourrez voir que Panamax a réparti les containers Docker sur différents nodes :
- On peut voir que l'image centurylink/wordpress a été déployée sur notre première instance CoreOS :
core@CoreOSnode-1 ~ $ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PO RTS NAMES
3206bda4e534 centurylink/wordpress:3.9.1 "/run.sh" 3 minutes ago Up 3 minutes 0. 0.0.0:8080->80/tcp wp
84e3c5fe1886 centurylink/panamax-remote-agent:latest "/panamax-remote-age 37 minutes ago Up 37 minutes 0. 0.0.0:3001->3000/tcp pmx_agent
71009f7785d3 centurylink/panamax-fleet-adapter:latest "rackup '-E producti 37 minutes ago Up 37 minutes 92 92/tcp pmx_adapter
- Et l'image centurylink/mysql sur notre troisième instance de notre cluster :
core@CoreOSnode-3 ~ $ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
84deeadd66fa centurylink/mysql:5.5 "/usr/local/bin/run" 4 minutes ago Up 4 minutes 0.0.0.0:3306->3306/tcp db
- Nous pouvons également avoir certaines informations par l'intermédiaire de notre gestionnaire de cluster Etcd :
On retrouve nos 2 applications (Wordpress "WP" et MySQL "DB") :
core@CoreOSnode-1 ~ $ etcdctl ls --recursive /app
/app/DB
/app/DB/DB_SERVICE_HOST
/app/WP
/app/WP/WP_SERVICE_HOST
On peut également voir sur quel instance membre de notre cluster l'application a été déployée :
core@CoreOSnode-1 ~ $ etcdctl get /app/DB/DB_SERVICE_HOST
178.170.XX.XXX
core@CoreOSnode-1 ~ $ etcdctl get /app/WP/WP_SERVICE_HOST
178.170.XX.ZZZ
- Nous pouvons aussi avoir le statut des applications de notre cluster par Fleet qui le gestionnaire des applications dans notre cluster :
core@CoreOSnode-1 ~ $ fleetctl list-unit-files
UNIT HASH DSTATE STATE TARGET
db.service 0caad43 launched launched 6eacee19.../178.170.XX.XXX
wp.service 417826f launched launched 7e685988.../178.170.XX.ZZZ
- Nous pouvons vérifier le bon fonctionnement de notre Wordpress en y accédant avec les informations fournis dans les détails du template (dans notre cas sur le port 8080) :