From db5874224893ea999af8558c1d5ead7f0d7223b0 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 30 Jun 2020 16:23:20 +0200 Subject: apps/collabora/code: migrate to new standalone pod role --- roles/apps/collabora/code/tasks/main.yml | 23 ++++++++++++----- .../apps/collabora/code/templates/pod-spec.yml.j2 | 25 ++++++++++++++++++ roles/apps/collabora/code/templates/pod.yml.j2 | 30 ---------------------- 3 files changed, 41 insertions(+), 37 deletions(-) create mode 100644 roles/apps/collabora/code/templates/pod-spec.yml.j2 delete mode 100644 roles/apps/collabora/code/templates/pod.yml.j2 (limited to 'roles/apps/collabora/code') diff --git a/roles/apps/collabora/code/tasks/main.yml b/roles/apps/collabora/code/tasks/main.yml index 57bdfa34..6b41bf5a 100644 --- a/roles/apps/collabora/code/tasks/main.yml +++ b/roles/apps/collabora/code/tasks/main.yml @@ -21,19 +21,26 @@ when: "'custom_image' in item.value" include_tasks: custom-image.yml -- name: generate pod manifests +- name: install pod manifest loop: "{{ collabora_code_instances | dict2items }}" loop_control: label: "{{ item.key }}" - template: - src: "pod.yml.j2" - dest: "/etc/kubernetes/manifests/collabora-code-{{ item.key }}.yml" - mode: 0600 + vars: + kubernetes_standalone_pod: + name: "collabora-code-{{ item.key }}" + spec: "{{ lookup('template', 'pod-spec.yml.j2') }}" + mode: 0600 + config_hash_items: + - path: "{{ collabora_code_base_path }}/{{ item.key }}/config/loolwsd.xml" + properties: + - checksum + include_role: + name: kubernetes/standalone/pod - name: configure nginx vhost loop: "{{ collabora_code_instances | dict2items }}" - include_role: - name: nginx/vhost + loop_control: + label: "{{ item.key }}" vars: nginx_vhost: name: "collabora-code-{{ item.key }}" @@ -41,3 +48,5 @@ acme: true hostnames: - "{{ item.value.hostname }}" + include_role: + name: nginx/vhost diff --git a/roles/apps/collabora/code/templates/pod-spec.yml.j2 b/roles/apps/collabora/code/templates/pod-spec.yml.j2 new file mode 100644 index 00000000..04d2d25a --- /dev/null +++ b/roles/apps/collabora/code/templates/pod-spec.yml.j2 @@ -0,0 +1,25 @@ +containers: +- name: collabora-code + image: "collabora/code{% if 'custom_image' in item.value %}/{{ item.key }}{% endif %}:{{ item.value.version }}" + resources: + limits: + memory: "4Gi" + env: + - name: "DONT_GEN_SSL_CERT" + value: "1" + - name: "extra_params" + value: "--o:ssl.enable=false --o:ssl.termination=true" + volumeMounts: + - name: config + mountPath: /etc/loolwsd/loolwsd.xml + subPath: loolwsd.xml + readOnly: true + ports: + - containerPort: 9980 + hostPort: {{ item.value.port }} + hostIP: 127.0.0.1 +volumes: +- name: config + hostPath: + path: "{{ collabora_code_base_path }}/{{ item.key }}/config/" + type: Directory diff --git a/roles/apps/collabora/code/templates/pod.yml.j2 b/roles/apps/collabora/code/templates/pod.yml.j2 deleted file mode 100644 index 53fb4c0d..00000000 --- a/roles/apps/collabora/code/templates/pod.yml.j2 +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "collabora-code-{{ item.key }}" -spec: - containers: - - name: collabora-code - image: "collabora/code{% if 'custom_image' in item.value %}/{{ item.key }}{% endif %}:{{ item.value.version }}" - resources: - limits: - memory: "4Gi" - env: - - name: "DONT_GEN_SSL_CERT" - value: "1" - - name: "extra_params" - value: "--o:ssl.enable=false --o:ssl.termination=true" - volumeMounts: - - name: config - mountPath: /etc/loolwsd/loolwsd.xml - subPath: loolwsd.xml - readOnly: true - ports: - - containerPort: 9980 - hostPort: {{ item.value.port }} - hostIP: 127.0.0.1 - volumes: - - name: config - hostPath: - path: "{{ collabora_code_base_path }}/{{ item.key }}/config/" - type: Directory -- cgit v1.2.3 From 6025dcf6f3dd7df02284dd6b3a37dd186879196c Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 30 Jun 2020 21:46:04 +0200 Subject: fix pod manifest permissions --- roles/apps/collabora/code/tasks/main.yml | 2 +- roles/apps/coturn/tasks/main.yml | 2 +- roles/apps/etherpad-lite/tasks/main.yml | 2 +- roles/apps/jitsi/meet/tasks/main.yml | 2 +- roles/apps/nextcloud/tasks/main.yml | 2 +- roles/kubernetes/standalone/pod/defaults/main.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'roles/apps/collabora/code') diff --git a/roles/apps/collabora/code/tasks/main.yml b/roles/apps/collabora/code/tasks/main.yml index 6b41bf5a..74f3240a 100644 --- a/roles/apps/collabora/code/tasks/main.yml +++ b/roles/apps/collabora/code/tasks/main.yml @@ -29,7 +29,7 @@ kubernetes_standalone_pod: name: "collabora-code-{{ item.key }}" spec: "{{ lookup('template', 'pod-spec.yml.j2') }}" - mode: 0600 + mode: "0600" config_hash_items: - path: "{{ collabora_code_base_path }}/{{ item.key }}/config/loolwsd.xml" properties: diff --git a/roles/apps/coturn/tasks/main.yml b/roles/apps/coturn/tasks/main.yml index 9971b428..176be664 100644 --- a/roles/apps/coturn/tasks/main.yml +++ b/roles/apps/coturn/tasks/main.yml @@ -73,7 +73,7 @@ kubernetes_standalone_pod: name: "coturn-{{ coturn_realm }}" spec: "{{ lookup('template', 'pod-spec.yml.j2') }}" - mode: 0600 + mode: "0600" config_hash_items: - path: "{{ coturn_base_path }}/{{ coturn_realm }}/config/turnserver.conf" properties: diff --git a/roles/apps/etherpad-lite/tasks/main.yml b/roles/apps/etherpad-lite/tasks/main.yml index 416ab7ff..105b89d9 100644 --- a/roles/apps/etherpad-lite/tasks/main.yml +++ b/roles/apps/etherpad-lite/tasks/main.yml @@ -100,7 +100,7 @@ kubernetes_standalone_pod: name: "etherpad-lite-{{ item.key }}" spec: "{{ lookup('template', 'pod-spec-with-{{ item.value.database.type }}.yml.j2') }}" - mode: 0600 + mode: "0600" config_hash_items: - path: "{{ etherpad_lite_base_path }}/{{ item.key }}/config/settings.json" properties: diff --git a/roles/apps/jitsi/meet/tasks/main.yml b/roles/apps/jitsi/meet/tasks/main.yml index f5bcbd21..16e05ced 100644 --- a/roles/apps/jitsi/meet/tasks/main.yml +++ b/roles/apps/jitsi/meet/tasks/main.yml @@ -22,7 +22,7 @@ kubernetes_standalone_pod: name: "jitsi-meet-{{ jitsi_meet_inst_name }}" spec: "{{ lookup('template', 'pod-spec.yml.j2') }}" - mode: 0600 + mode: "0600" config_hash_items: - path: "{{ jitsi_meet_base_path }}/{{ jitsi_meet_inst_name }}/scripts/prosody/cont-init.sh" properties: diff --git a/roles/apps/nextcloud/tasks/main.yml b/roles/apps/nextcloud/tasks/main.yml index d2ed558a..325fa15d 100644 --- a/roles/apps/nextcloud/tasks/main.yml +++ b/roles/apps/nextcloud/tasks/main.yml @@ -110,7 +110,7 @@ kubernetes_standalone_pod: name: "nextcloud-{{ item.key }}" spec: "{{ lookup('template', 'pod-spec-with-{{ item.value.database.type }}.yml.j2') }}" - mode: 0600 + mode: "0600" config_hash_items: - path: "{{ nextcloud_base_path }}/{{ item.key }}/config/apache-site.conf" properties: diff --git a/roles/kubernetes/standalone/pod/defaults/main.yml b/roles/kubernetes/standalone/pod/defaults/main.yml index c20d37cf..2eae33a3 100644 --- a/roles/kubernetes/standalone/pod/defaults/main.yml +++ b/roles/kubernetes/standalone/pod/defaults/main.yml @@ -13,7 +13,7 @@ # - /bin/bash # - -c # - "sleep inf" -# mode: 0600 +# mode: "0600" # config_hash_items: # - path: /path/to/configfile # properties: -- cgit v1.2.3