Update Glance DB Jobs
This commit is contained in:
parent
549bfea927
commit
64bbf6700c
19
glance/templates/bin/_db-sync.sh.tpl
Normal file
19
glance/templates/bin/_db-sync.sh.tpl
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright 2017 The Openstack-Helm Authors.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
glance-manage db_sync
|
@ -1,32 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Copyright 2017 The Openstack-Helm Authors.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
set -ex
|
|
||||||
export HOME=/tmp
|
|
||||||
|
|
||||||
ansible localhost -vvv -m mysql_db -a "login_host='{{ .Values.database.address }}' \
|
|
||||||
login_port='{{ .Values.database.port }}' \
|
|
||||||
login_user='{{ .Values.database.root_user }}' \
|
|
||||||
login_password='{{ .Values.database.root_password }}' \
|
|
||||||
name='{{ .Values.database.glance_database_name }}'"
|
|
||||||
|
|
||||||
ansible localhost -vvv -m mysql_user -a "login_host='{{ .Values.database.address }}' \
|
|
||||||
login_port='{{ .Values.database.port }}' \
|
|
||||||
login_user='{{ .Values.database.root_user }}' \
|
|
||||||
login_password='{{ .Values.database.root_password }}' \
|
|
||||||
name='{{ .Values.database.glance_user }}' \
|
|
||||||
password='{{ .Values.database.glance_password }}' \
|
|
||||||
host='%' priv='{{ .Values.database.glance_database_name }}.*:ALL' append_privs='yes'"
|
|
@ -17,8 +17,10 @@ kind: ConfigMap
|
|||||||
metadata:
|
metadata:
|
||||||
name: glance-bin
|
name: glance-bin
|
||||||
data:
|
data:
|
||||||
init.sh: |+
|
db-init.py: |
|
||||||
{{ tuple "bin/_init.sh.tpl" . | include "helm-toolkit.template" | indent 4 }}
|
{{- include "helm-toolkit.db_init" . | indent 4 }}
|
||||||
|
db-sync.sh: |
|
||||||
|
{{ tuple "bin/_db-sync.sh.tpl" . | include "helm-toolkit.template" | indent 4 }}
|
||||||
ks-service.sh: |+
|
ks-service.sh: |+
|
||||||
{{- include "helm-toolkit.keystone_service" . | indent 4 }}
|
{{- include "helm-toolkit.keystone_service" . | indent 4 }}
|
||||||
ks-endpoints.sh: |+
|
ks-endpoints.sh: |+
|
||||||
|
@ -24,7 +24,7 @@ registry_host = glance-registry
|
|||||||
show_image_direct_url = True
|
show_image_direct_url = True
|
||||||
|
|
||||||
[database]
|
[database]
|
||||||
connection = mysql+pymysql://{{ .Values.database.glance_user }}:{{ .Values.database.glance_password }}@{{ .Values.database.address }}/{{ .Values.database.glance_database_name }}
|
connection = {{ tuple "oslo_db" "internal" "user" "mysql" . | include "helm-toolkit.authenticated_endpoint_uri_lookup" }}
|
||||||
max_retries = -1
|
max_retries = -1
|
||||||
|
|
||||||
[keystone_authtoken]
|
[keystone_authtoken]
|
||||||
|
@ -21,7 +21,7 @@ bind_port = {{ .Values.network.port.registry }}
|
|||||||
workers = {{ .Values.misc.workers }}
|
workers = {{ .Values.misc.workers }}
|
||||||
|
|
||||||
[database]
|
[database]
|
||||||
connection = mysql+pymysql://{{ .Values.database.glance_user }}:{{ .Values.database.glance_password }}@{{ .Values.database.address }}/{{ .Values.database.glance_database_name }}
|
connection = {{ tuple "oslo_db" "internal" "user" "mysql" . | include "helm-toolkit.authenticated_endpoint_uri_lookup" }}
|
||||||
max_retries = -1
|
max_retries = -1
|
||||||
|
|
||||||
[keystone_authtoken]
|
[keystone_authtoken]
|
||||||
|
@ -43,16 +43,37 @@ spec:
|
|||||||
memory: {{ .Values.resources.jobs.init.requests.memory | quote }}
|
memory: {{ .Values.resources.jobs.init.requests.memory | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
env:
|
env:
|
||||||
- name: ANSIBLE_LIBRARY
|
- name: ROOT_DB_CONNECTION
|
||||||
value: /usr/share/ansible/
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: glance-db-root
|
||||||
|
key: DB_CONNECTION
|
||||||
|
- name: OPENSTACK_CONFIG_FILE
|
||||||
|
value: /etc/glance/glance-api.conf
|
||||||
|
- name: OPENSTACK_CONFIG_DB_SECTION
|
||||||
|
value: database
|
||||||
|
- name: OPENSTACK_CONFIG_DB_KEY
|
||||||
|
value: connection
|
||||||
command:
|
command:
|
||||||
- bash
|
- python
|
||||||
- /tmp/init.sh
|
- /tmp/db-init.py
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: initsh
|
- name: glance-bin
|
||||||
mountPath: /tmp/init.sh
|
mountPath: /tmp/db-init.py
|
||||||
subPath: init.sh
|
subPath: db-init.py
|
||||||
|
readOnly: true
|
||||||
|
- name: etcglance
|
||||||
|
mountPath: /etc/glance
|
||||||
|
- name: glanceapiconf
|
||||||
|
mountPath: /etc/glance/glance-api.conf
|
||||||
|
subPath: glance-api.conf
|
||||||
|
readOnly: true
|
||||||
volumes:
|
volumes:
|
||||||
- name: initsh
|
- name: etcglance
|
||||||
|
emptyDir: {}
|
||||||
|
- name: glanceapiconf
|
||||||
|
configMap:
|
||||||
|
name: glance-etc
|
||||||
|
- name: glance-bin
|
||||||
configMap:
|
configMap:
|
||||||
name: glance-bin
|
name: glance-bin
|
||||||
|
@ -43,13 +43,25 @@ spec:
|
|||||||
memory: {{ .Values.resources.jobs.db.requests.memory | quote }}
|
memory: {{ .Values.resources.jobs.db.requests.memory | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
command:
|
command:
|
||||||
- glance-manage
|
- bash
|
||||||
- db_sync
|
- /tmp/db-sync.sh
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
- name: glance-bin
|
||||||
|
mountPath: /tmp/db-sync.sh
|
||||||
|
subPath: db-sync.sh
|
||||||
|
readOnly: true
|
||||||
|
- name: etcglance
|
||||||
|
mountPath: /etc/glance
|
||||||
- name: glanceapiconf
|
- name: glanceapiconf
|
||||||
mountPath: /etc/glance/glance-api.conf
|
mountPath: /etc/glance/glance-api.conf
|
||||||
subPath: glance-api.conf
|
subPath: glance-api.conf
|
||||||
|
readOnly: true
|
||||||
volumes:
|
volumes:
|
||||||
|
- name: etcglance
|
||||||
|
emptyDir: {}
|
||||||
- name: glanceapiconf
|
- name: glanceapiconf
|
||||||
configMap:
|
configMap:
|
||||||
name: glance-etc
|
name: glance-etc
|
||||||
|
- name: glance-bin
|
||||||
|
configMap:
|
||||||
|
name: glance-bin
|
||||||
|
7
glance/templates/secret-db-root.env.yaml
Normal file
7
glance/templates/secret-db-root.env.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: glance-db-root
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
DB_CONNECTION: {{ tuple "oslo_db" "internal" "admin" "mysql" . | include "helm-toolkit.authenticated_endpoint_uri_lookup" | b64enc }}
|
@ -30,7 +30,7 @@ labels:
|
|||||||
node_selector_value: enabled
|
node_selector_value: enabled
|
||||||
|
|
||||||
images:
|
images:
|
||||||
db_init: quay.io/stackanetes/stackanetes-kolla-toolbox:newton
|
db_init: quay.io/stackanetes/stackanetes-glance-api:newton
|
||||||
db_sync: quay.io/stackanetes/stackanetes-glance-api:newton
|
db_sync: quay.io/stackanetes/stackanetes-glance-api:newton
|
||||||
ks_user: quay.io/stackanetes/stackanetes-kolla-toolbox:newton
|
ks_user: quay.io/stackanetes/stackanetes-kolla-toolbox:newton
|
||||||
ks_service: quay.io/stackanetes/stackanetes-kolla-toolbox:newton
|
ks_service: quay.io/stackanetes/stackanetes-kolla-toolbox:newton
|
||||||
@ -68,15 +68,6 @@ network:
|
|||||||
api: 9292
|
api: 9292
|
||||||
registry: 9191
|
registry: 9191
|
||||||
|
|
||||||
database:
|
|
||||||
address: mariadb
|
|
||||||
port: 3306
|
|
||||||
root_user: root
|
|
||||||
root_password: password
|
|
||||||
glance_database_name: glance
|
|
||||||
glance_password: password
|
|
||||||
glance_user: glance
|
|
||||||
|
|
||||||
ceph:
|
ceph:
|
||||||
enabled: true
|
enabled: true
|
||||||
monitors: []
|
monitors: []
|
||||||
@ -192,3 +183,17 @@ endpoints:
|
|||||||
port:
|
port:
|
||||||
api: 9292
|
api: 9292
|
||||||
registry: 9191
|
registry: 9191
|
||||||
|
oslo_db:
|
||||||
|
auth:
|
||||||
|
admin:
|
||||||
|
username: root
|
||||||
|
password: password
|
||||||
|
user:
|
||||||
|
username: glance
|
||||||
|
password: password
|
||||||
|
hosts:
|
||||||
|
default: mariadb
|
||||||
|
path: /glance
|
||||||
|
scheme: mysql+pymysql
|
||||||
|
port:
|
||||||
|
mysql: 3306
|
||||||
|
Loading…
x
Reference in New Issue
Block a user