diff --git a/common/playbooks/notebooks-redirect.yaml b/common/playbooks/notebooks-redirect.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e300772ec0dfe8c91982689ec05ced989f4093dc --- /dev/null +++ b/common/playbooks/notebooks-redirect.yaml @@ -0,0 +1,54 @@ +--- +- name: Notebooks Redirect Deployment + hosts: master[0] + become: true + tasks: + - name: Deploy Redirects + vars: + namespace: "{{ notebooks_redirect.namespace }}" + old_hostname: "{{ notebooks_redirect.hostname }}" + shell: |- + kubectl apply -f - << EOF + --- + apiVersion: v1 + kind: Service + metadata: + namespace: {{ namespace }} + name: redirect-old + labels: + app: redirect-old + spec: + ports: + - name: http + port: 80 + protocol: TCP + selector: + app: redirect-old + --- + apiVersion: networking.k8s.io/v1 + kind: Ingress + metadata: + annotations: + kubernetes.io/ingress.class: nginx + kubernetes.io/tls-acme: "true" + nginx.ingress.kubernetes.io/rewrite-target: https://{{ notebooks_hostname }}$1 + name: redirect-old + namespace: {{ namespace }} + spec: + tls: + - hosts: + - {{ old_hostname }} + secretName: acme-tls-notebooks-old + rules: + - host: {{ old_hostname }} + http: + paths: + - backend: + service: + name: redirect-root + port: + name: http + path: /(.*) + pathType: Prefix + EOF + when: notebooks_redirect is defined diff --git a/envri-hub/inventory/99-all.yaml b/envri-hub/inventory/99-all.yaml index 23588a1b9ee2199a0eb99fc9a6e62f268d9026e6..8d32ea68c9fac4cfe31f2dda8cd50a88441f0b2c 100644 --- a/envri-hub/inventory/99-all.yaml +++ b/envri-hub/inventory/99-all.yaml @@ -16,5 +16,8 @@ all: site_name: envri-hub vault_mount_point: secrets/users/e1662e20-e34b-468c-b0ce-d899bc878364@egi.eu/envri-hub - notebooks_hostname: envri-vre.cloud.cesnet.cz + notebooks_hostname: vre.staging.envri.eu + notebooks_redirect: + hostname: envri-vre.cloud.cesnet.cz + namespace: envri-hub grafana_hostname: grafana.envri-vre.cloud.cesnet.cz