From ee381618a37a4fa8d024dc917287c9d0eccdfd6a Mon Sep 17 00:00:00 2001 From: okozachenko Date: Mon, 27 Jul 2020 19:25:14 +0300 Subject: [PATCH] Use secret for glance config Change-Id: I73ff4d946b24ee14550f4bd49c875b5a8955ff79 --- devstack/plugin.sh | 13 ++++++++++++- .../templates/glance/daemonset.yml.j2 | 10 ++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 23fb7025..bd5c3a66 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -36,7 +36,18 @@ elif [[ "$1" == "stack" && "$2" == "install" ]]; then : elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then - : + # After ceph devstack plugin + kubectl create secret generic glance-config -n openstack \ + --from-file=/etc/glance/glance-api.conf \ + --from-file=/etc/glance/glance-api-paste.ini \ + --from-file=/etc/glance/glance-cache.conf \ + --from-file=/etc/glance/glance-swift-store.conf + + # NOTE(Alex): Permissions here are bad but it's temporary so we don't care as much. + sudo chmod -Rv 777 /etc/ceph + kubectl create secret generic ceph-config -n openstack \ + --from-file=/etc/ceph/ceph.conf \ + --from-file=/etc/ceph/ceph.client.glance.keyring elif [[ "$1" == "stack" && "$2" == "extra" ]]; then : diff --git a/openstack_operator/templates/glance/daemonset.yml.j2 b/openstack_operator/templates/glance/daemonset.yml.j2 index d8b23035..4b17e4c1 100644 --- a/openstack_operator/templates/glance/daemonset.yml.j2 +++ b/openstack_operator/templates/glance/daemonset.yml.j2 @@ -87,13 +87,11 @@ spec: mountPath: /etc/uwsgi volumes: - name: ceph - hostPath: - path: /etc/ceph - type: Directory + secret: + secretName: ceph-config - name: config - hostPath: - path: {{ spec['configDir'] }} - type: Directory + secret: + secretName: glance-config - name: data hostPath: path: {{ spec['dataDir'] }}