From e0229e0adb3ead7f89cb160dd0ae429769c5099c Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 21 Feb 2018 20:20:24 +0100 Subject: fix automatic preparation of data-dirs --- templates/default/kubernetes/sfive-deploy.yml.j2 | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'templates/default/kubernetes/sfive-deploy.yml.j2') diff --git a/templates/default/kubernetes/sfive-deploy.yml.j2 b/templates/default/kubernetes/sfive-deploy.yml.j2 index aafb468..4de270a 100644 --- a/templates/default/kubernetes/sfive-deploy.yml.j2 +++ b/templates/default/kubernetes/sfive-deploy.yml.j2 @@ -31,6 +31,25 @@ spec: fsGroup: 998 hostNetwork: true dnsPolicy: ClusterFirstWithHostNet + initContainers: + - name: prepare-hub-data + image: busybox + command: ['sh', '-c', 'chown 998:998 /srv/data && chmod 0750 /srv/data'] + securityContext: + runAsUser: 0 + volumeMounts: + - name: hub-data + mountPath: /srv/data +{% if worker.flags.sfive == 'proxy' and 'stream-onion' in worker.flags %} + - name: prepare-onion-lib + image: busybox + command: ['sh', '-c', 'chown 998:998 /var/lib/tor && chmod 0750 /var/lib/tor'] + securityContext: + runAsUser: 0 + volumeMounts: + - name: onion-lib + mountPath: /var/lib/tor +{% endif %} containers: {% if worker.flags.sfive == 'proxy' %} - name: proxy @@ -104,9 +123,8 @@ spec: medium: Memory {% if worker.flags.sfive == 'proxy' and 'stream-onion' in worker.flags %} - name: onion-lib - hostPath: - type: DirectoryOrCreate - path: /var/lib/tor/{{ desc.globals.name }}/{{ worker.flags.stream }} + emptyDir: + medium: Memory {% endif %} - name: proxy-config configMap: -- cgit v1.2.3