Skip to content
Snippets Groups Projects
Verified Commit b70ed585 authored by Rafael László's avatar Rafael László :speech_balloon:
Browse files

Add maintenance screen for upgrades on nginx

parent cc33f5d9
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,16 @@
src: home/user/harbor/harbor.yml.j2
dest: /home/{{ user }}/harbor/harbor.yml
- name: Set maintenance Nginx config
tags: ["nginx"]
import_tasks: tasks/nginx.yaml
vars:
sites:
- name: harbor.sch.bme.hu
proxy_to: http://localhost:8080
maintenance: yes
maintenance_text: "Harbor is being upgraded to the latest release!"
- name: Setup harbor
shell: "/home/{{ user }}/harbor/install.sh --with-trivy --with-chartmuseum"
register: install_command
......@@ -36,6 +46,10 @@
shell: "/home/{{ user }}/harbor/install.sh --with-trivy --with-chartmuseum"
when: install_command.rc != 0
- name: Reset nginx config
tags: ["nginx"]
import_tasks: tasks/nginx.yaml
- name: Add service to start harbor on startup
template:
src: etc/systemd/system/harbor-docker-compose.service
......
......@@ -39,6 +39,12 @@ server {
# To disable buffering
proxy_buffering off;
{% if site.maintenance %}
location / {
return 503 '{{ site.maintenance_text }}';
add_header Content-Type text/plain always;
}
{% else %}
location / {
proxy_set_header X-Real-IP $remote_addr;
......@@ -54,5 +60,6 @@ server {
proxy_pass {{ site.proxy_to }};
}
{% endif %}
}
{% endfor %}
\ No newline at end of file
......@@ -46,6 +46,8 @@ acme_email: k8sadmin@sch.bme.hu
sites:
- name: harbor.sch.bme.hu
proxy_to: http://localhost:8080
maintenance: no
maintenance_text: "Under Maintenance!"
harbor_installer_url: https://github.com/goharbor/harbor/releases/download/v2.4.2/harbor-online-installer-v2.4.2.tgz
harbor_dest_file_name: harbor-online-installer-v2.4.2.tgz
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment