CausticLab / rgon-proxy

the base image of the rancher nginx-letsencrypt proxy
5 stars 1 forks source link

[Usage question] How to use dev branch from Rancher Catalog ui? #43

Closed Ramblurr closed 7 years ago

Ramblurr commented 7 years ago

How do we use the latest dev branch, when the ui just looks like the following?

How do I ensure my rgon containers are up to date?

rancher

Ramblurr commented 7 years ago

I'm posting this because it seems something has broken over the past weeks.

Check out these strange errors

# all was working fine like this for weeks
DEBU[1901700] Checking for metadata change
DEBU[1901700] No changes in Metadata
DEBU[1901730] Checking for metadata change
DEBU[1901730] No changes in Metadata
DEBU[1901760] Checking for metadata change
# then suddenly......
DEBU[1901760] Old version: "16879-4f3c5c96fb170da7fa8781d4ac55192c", New Version: "16884-4f3c5c96fb170da7fa8781d4ac55192c"
DEBU[1901760] Fetching Metadata
DEBU[1901760] No template - processing commands
DEBU[1901760] Notifying label 'rgon.ssl'
DEBU[1901760] Fetching Metadata
DEBU[1901760] NOTIFY: app3-ourdomain.com-app3-1 :: [rgon.ssl:true]
DEBU[1901760] NOTIFY: app-app3-1 :: [rgon.ssl:true]
DEBU[1901760] NOTIFY: app2-app2-1 :: [rgon.ssl:true]
DEBU[1901760] NOTIFY: app1-test-app1-frontend-1 :: [rgon.ssl:true]
DEBU[1901760] NOTIFY: app1-app1-frontend-1 :: [rgon.ssl:true]
DEBU[1901760] Parsing: app3-ourdomain.com-app3-1
DEBU[1901760] Running check command '[ -d /etc/nginx/certs/$(echo "app3.ourdomain.com" | cut -d"," -f 1) ] && exit 1 || exit 0'
INFO[1901760] Check failed, skipping notify-cmd
DEBU[1901760] Parsing: app-app3-1
DEBU[1901760] Running check command '[ -d /etc/nginx/certs/$(echo "app.ourdomain.com" | cut -d"," -f 1) ] && exit 1 || exit 0'
INFO[1901760] Check failed, skipping notify-cmd
DEBU[1901760] Parsing: app2-app2-1
DEBU[1901760] Running check command '[ -d /etc/nginx/certs/$(echo "app2.ourdomain.com" | cut -d"," -f 1) ] && exit 1 || exit 0'
INFO[1901760] Check failed, skipping notify-cmd
DEBU[1901760] Parsing: app1-test-app1-frontend-1
DEBU[1901760] Running check command '[ -d /etc/nginx/certs/$(echo "app1-test.ourdomain.com" | cut -d"," -f 1) ] && exit 1 || exit 0'
INFO[1901760] Check failed, skipping notify-cmd
DEBU[1901760] Parsing: app1-app1-frontend-1
DEBU[1901760] Running check command '[ -d /etc/nginx/certs/$(echo "app1.ourdomain.com" | cut -d"," -f 1) ] && exit 1 || exit 0'
INFO[1901760] Check failed, skipping notify-cmd
DEBU[1901760] Processing template /etc/rancher-gen/default/nginx.tmpl for destination /etc/nginx/conf.d/nginx.conf
DEBU[1901760] Checking whether content has changed
DEBU[1901760] Checksum content: 5eaf04af65f19bc257f08a7bcf30990b, checksum file: 5eaf04af65f19bc257f08a7bcf30990b
DEBU[1901760] Destination /etc/nginx/conf.d/nginx.conf is up to date
INFO[1901760] All templates processed. Waiting for changes in Metadata...
INFO[1901765] Exit requested by signal: terminated
/etc/nginx/certs/default/default.pass.key: No such file or directory
140065870601100:error:02001002:system library:fopen:No such file or directory:bss_file.c:402:fopen('/etc/nginx/certs/default/default.pass.key','w')
140065870601100:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:404:
Error opening Private Key /etc/nginx/certs/default/default.pass.key
139791273925516:error:02001002:system library:fopen:No such file or directory:bss_file.c:402:fopen('/etc/nginx/certs/default/default.pass.key','r')
139791273925516:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:404:
unable to load Private Key
rm: can't remove '/etc/nginx/certs/default/default.pass.key': No such file or directory
Error opening Private Key /etc/nginx/certs/default/default.key
139759425289100:error:02001002:system library:fopen:No such file or directory:bss_file.c:402:fopen('/etc/nginx/certs/default/default.key','r')
139759425289100:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:404:
unable to load Private Key
/etc/nginx/certs/default/default.csr: No such file or directory
 100.00% 1s  .00%
20170718085437 [WARN] acmetool: Don't know how to install a cron job on this system, please install the following job:
SHELL=/bin/sh
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
MAILTO=root
32 13 * * * root /usr/local/bin/acmetool --batch reconcile

------------------------- Quickstart Complete ----------------------
The quickstart process is complete.

Ensure your chosen challenge conveyance method is configured properly
before attempting to request certificates. You can find more
information about how to configure your system for each method in the
acmetool documentation:
https://github.com/hlandau/acme/blob/master/_doc/WSCONFIG.md

To request a certificate, run:

$ sudo acmetool want example.com www.example.com

If the certificate is successfully obtained, it will be placed in
/var/lib/acme/live/example.com/{cert,chain,fullchain,privkey}.

[ENTRYPOINT]: Running Rancher-Gen first-run
INFO[0000] Starting rancher-gen v0.6.0 (ee2ce5c)
INFO[0000] Initializing Rancher Metadata client (version 2015-12-19)
INFO[0000] Processing all templates once.
DEBU[0000] Checking for metadata change
DEBU[0000] Old version: init, New Version: "16902-4f3c5c96fb170da7fa8781d4ac55192c"
DEBU[0000] Fetching Metadata
DEBU[0000] Processing template /etc/rancher-gen/default/nginx.tmpl for destination /etc/nginx/conf.d/nginx.conf
DEBU[0000] Checking whether content has changed
DEBU[0000] Checksum content: 5eaf04af65f19bc257f08a7bcf30990b, checksum file:
DEBU[0000] Creating staging file
DEBU[0000] Created staging file /etc/nginx/conf.d/.nginx.conf-375402345
DEBU[0000] Copying file permissions and owner from destination
DEBU[0000] Writing destination
INFO[0000] Destination file has been updated: /etc/nginx/conf.d/nginx.conf
DEBU[0000] Notifying label 'rgon-proxy' with value 'nginx'
DEBU[0000] Fetching Metadata
DEBU[0000] NOTIFY: rgon-proxy-nginx-1 :: [rgon-proxy:nginx]
DEBU[0000] Parsing: rgon-proxy-nginx-1
INFO[0000] Executing notify command 'rgon-exec -name=rgon-proxy-nginx-1 -cmd="service nginx reload"'
INFO[0000] [rgon-exec -name=rgon-proxy-nginx-1 -cmd="service nginx reload"]: "Executing [service nginx reload] on container [rgon-proxy-nginx-1]"
INFO[0000] [rgon-exec -name=rgon-proxy-nginx-1 -cmd="service nginx reload"]: "[....] Reloading nginx: nginx\x1b[?25l\x1b7\x1b[1G[\x1b[32m ok \x1b[39;49m\x1b8\x1b[?12l\x1b[?25h.\r"
INFO[0000] [rgon-exec -name=rgon-proxy-nginx-1 -cmd="service nginx reload"]: "websocket: close 1000 (normal)"
DEBU[0000] Notify cmd output: "Executing [service nginx reload] on container [rgon-proxy-nginx-1]\n[....] Reloading nginx: nginx\x1b[?25l\x1b7\x1b[1G[\x1b[32m ok \x1b[39;49m\x1b8\x1b[?12l\x1b[?25h.\r\nwebsocket: close 1000 (normal)\n"
INFO[0000] All templates processed. Exiting.
[ENTRYPOINT]: Rancher-Gen first-run complete
INFO[0000] Starting rancher-gen v0.6.0 (ee2ce5c)
INFO[0000] Initializing Rancher Metadata client (version 2015-12-19)
INFO[0000] Polling Metadata with %d second interval30
DEBU[0000] Checking for metadata change
DEBU[0000] Old version: init, New Version: "16902-4f3c5c96fb170da7fa8781d4ac55192c"
DEBU[0000] Fetching Metadata
DEBU[0000] No template - processing commands
DEBU[0000] Notifying label 'rgon.ssl'
DEBU[0000] Fetching Metadata
DEBU[0000] NOTIFY: app1-app1-frontend-1 :: [rgon.ssl:true]
DEBU[0000] NOTIFY: app3-ourdomain.com-app3-1 :: [rgon.ssl:true]
DEBU[0000] NOTIFY: app2-app2-1 :: [rgon.ssl:true]
DEBU[0000] NOTIFY: app1-test-app1-frontend-1 :: [rgon.ssl:true]
DEBU[0000] NOTIFY: app-app3-1 :: [rgon.ssl:true]
DEBU[0000] Parsing: app1-app1-frontend-1
DEBU[0000] Running check command '[ -d /etc/nginx/certs/$(echo "app1.ourdomain.com" | cut -d"," -f 1) ] && exit 1 || exit 0'
INFO[0000] Check failed, skipping notify-cmd
DEBU[0000] Parsing: app3-ourdomain.com-app3-1
DEBU[0000] Running check command '[ -d /etc/nginx/certs/$(echo "app3.ourdomain.com" | cut -d"," -f 1) ] && exit 1 || exit 0'
INFO[0000] Check failed, skipping notify-cmd
DEBU[0000] Parsing: app2-app2-1
DEBU[0000] Running check command '[ -d /etc/nginx/certs/$(echo "app2.ourdomain.com" | cut -d"," -f 1) ] && exit 1 || exit 0'
INFO[0000] Check failed, skipping notify-cmd
DEBU[0000] Parsing: app1-test-app1-frontend-1
DEBU[0000] Running check command '[ -d /etc/nginx/certs/$(echo "app1-test.ourdomain.com" | cut -d"," -f 1) ] && exit 1 || exit 0'
INFO[0000] Check failed, skipping notify-cmd
DEBU[0000] Parsing: app-app3-1
DEBU[0000] Running check command '[ -d /etc/nginx/certs/$(echo "app.ourdomain.com" | cut -d"," -f 1) ] && exit 1 || exit 0'
INFO[0000] Check failed, skipping notify-cmd
DEBU[0000] Processing template /etc/rancher-gen/default/nginx.tmpl for destination /etc/nginx/conf.d/nginx.conf
DEBU[0000] Checking whether content has changed
DEBU[0000] Checksum content: 5eaf04af65f19bc257f08a7bcf30990b, checksum file: 5eaf04af65f19bc257f08a7bcf30990b
DEBU[0000] Destination /etc/nginx/conf.d/nginx.conf is up to date
INFO[0000] All templates processed. Waiting for changes in Metadata...
DEBU[0030] Checking for metadata change
DEBU[0030] No changes in Metadata
DEBU[0060] Checking for metadata change
DEBU[0060] No changes in Metadata
Munsio commented 7 years ago

Hi @Ramblurr you can use the dev branch as follow:

Got to the Catalog and "add" an rgon-proxy service - but before you submit uncheck the checkbox with "start services after creating"

Now the service should exist but it is stopped. Now klick on the [nginx] link to view all containers and klick on the upgrade button on the top right. Be sure to tick on the "rgon-proxy" checkbox for the sidekick and there you can change the image tag to :dev

I know it is a little bit complicated but i lack currently on time to bring this project further.

NOTICE: if you have already created the service be sure to remove the config folder on the filesystem cause the files currently don't get updated properly

Best regards Martin

Ramblurr commented 7 years ago

Great. I was using the causticlab/rgon-proxy:feature-ssl tag before.