Update Cinder DB Jobs
This commit is contained in:
parent
64bbf6700c
commit
105349a95b
@ -1,36 +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.cinder_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.cinder_user }}' \
|
|
||||||
password='{{ .Values.database.cinder_password }}' \
|
|
||||||
host='%' \
|
|
||||||
priv='{{ .Values.database.cinder_database_name }}.*:ALL' \
|
|
||||||
append_privs='yes'"
|
|
19
cinder/templates/bin/_db-sync.sh.tpl
Normal file
19
cinder/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
|
@ -17,8 +17,10 @@ kind: ConfigMap
|
|||||||
metadata:
|
metadata:
|
||||||
name: cinder-bin
|
name: cinder-bin
|
||||||
data:
|
data:
|
||||||
db-init.sh: |+
|
db-init.py: |
|
||||||
{{ tuple "bin/_db-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: |+
|
||||||
|
@ -40,7 +40,7 @@ os_region_name = {{ .Values.keystone.cinder_region_name }}
|
|||||||
host=cinder-volume-worker
|
host=cinder-volume-worker
|
||||||
|
|
||||||
[database]
|
[database]
|
||||||
connection = mysql+pymysql://{{ .Values.database.cinder_user }}:{{ .Values.database.cinder_password }}@{{ .Values.database.address }}:{{ .Values.database.port }}/{{ .Values.database.cinder_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,17 +43,37 @@ spec:
|
|||||||
cpu: {{ .Values.resources.cinder_db_init.limits.cpu | quote }}
|
cpu: {{ .Values.resources.cinder_db_init.limits.cpu | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
env:
|
env:
|
||||||
- name: ANSIBLE_LIBRARY
|
- name: ROOT_DB_CONNECTION
|
||||||
value: /usr/share/ansible/
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: cinder-db-root
|
||||||
|
key: DB_CONNECTION
|
||||||
|
- name: OPENSTACK_CONFIG_FILE
|
||||||
|
value: /etc/cinder/cinder.conf
|
||||||
|
- name: OPENSTACK_CONFIG_DB_SECTION
|
||||||
|
value: database
|
||||||
|
- name: OPENSTACK_CONFIG_DB_KEY
|
||||||
|
value: connection
|
||||||
command:
|
command:
|
||||||
- bash
|
- python
|
||||||
- /tmp/db-init.sh
|
- /tmp/db-init.py
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: dbinitsh
|
- name: cinder-bin
|
||||||
mountPath: /tmp/db-init.sh
|
mountPath: /tmp/db-init.py
|
||||||
subPath: db-init.sh
|
subPath: db-init.py
|
||||||
|
readOnly: true
|
||||||
|
- name: etccinder
|
||||||
|
mountPath: /etc/cinder
|
||||||
|
- name: cinderconf
|
||||||
|
mountPath: /etc/cinder/cinder.conf
|
||||||
|
subPath: cinder.conf
|
||||||
readOnly: true
|
readOnly: true
|
||||||
volumes:
|
volumes:
|
||||||
- name: dbinitsh
|
- name: etccinder
|
||||||
|
emptyDir: {}
|
||||||
|
- name: cinderconf
|
||||||
|
configMap:
|
||||||
|
name: cinder-etc
|
||||||
|
- name: cinder-bin
|
||||||
configMap:
|
configMap:
|
||||||
name: cinder-bin
|
name: cinder-bin
|
||||||
|
@ -43,22 +43,25 @@ spec:
|
|||||||
cpu: {{ .Values.resources.cinder_db_sync.limits.cpu | quote }}
|
cpu: {{ .Values.resources.cinder_db_sync.limits.cpu | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
command:
|
command:
|
||||||
- cinder-manage
|
- bash
|
||||||
args:
|
- /tmp/db-sync.sh
|
||||||
- --config-dir
|
|
||||||
- /etc/cinder/conf
|
|
||||||
- db
|
|
||||||
- sync
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: pod-etc-cinder
|
- name: cinder-bin
|
||||||
|
mountPath: /tmp/db-sync.sh
|
||||||
|
subPath: db-sync.sh
|
||||||
|
readOnly: true
|
||||||
|
- name: etccinder
|
||||||
mountPath: /etc/cinder
|
mountPath: /etc/cinder
|
||||||
- name: cinderconf
|
- name: cinderapiconf
|
||||||
mountPath: /etc/cinder/conf/cinder.conf
|
mountPath: /etc/cinder/cinder-api.conf
|
||||||
subPath: cinder.conf
|
subPath: cinder-api.conf
|
||||||
readOnly: true
|
readOnly: true
|
||||||
volumes:
|
volumes:
|
||||||
- name: pod-etc-cinder
|
- name: etccinder
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
- name: cinderconf
|
- name: cinderapiconf
|
||||||
configMap:
|
configMap:
|
||||||
name: cinder-etc
|
name: cinder-etc
|
||||||
|
- name: cinder-bin
|
||||||
|
configMap:
|
||||||
|
name: cinder-bin
|
||||||
|
7
cinder/templates/secret-db-root.env.yaml
Normal file
7
cinder/templates/secret-db-root.env.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: cinder-db-root
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
DB_CONNECTION: {{ tuple "oslo_db" "internal" "admin" "mysql" . | include "helm-toolkit.authenticated_endpoint_uri_lookup" | b64enc }}
|
@ -27,15 +27,15 @@ labels:
|
|||||||
node_selector_value: enabled
|
node_selector_value: enabled
|
||||||
|
|
||||||
images:
|
images:
|
||||||
dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.1.1
|
db_init: quay.io/stackanetes/stackanetes-cinder-api:newton
|
||||||
|
db_sync: quay.io/stackanetes/stackanetes-cinder-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
|
||||||
ks_endpoints: quay.io/stackanetes/stackanetes-kolla-toolbox:newton
|
ks_endpoints: quay.io/stackanetes/stackanetes-kolla-toolbox:newton
|
||||||
db_init: quay.io/stackanetes/stackanetes-kolla-toolbox:newton
|
|
||||||
db_sync: quay.io/stackanetes/stackanetes-cinder-api:newton
|
|
||||||
api: quay.io/stackanetes/stackanetes-cinder-api:newton
|
api: quay.io/stackanetes/stackanetes-cinder-api:newton
|
||||||
scheduler: quay.io/stackanetes/stackanetes-cinder-scheduler:newton
|
scheduler: quay.io/stackanetes/stackanetes-cinder-scheduler:newton
|
||||||
volume: quay.io/stackanetes/stackanetes-cinder-volume:newton
|
volume: quay.io/stackanetes/stackanetes-cinder-volume:newton
|
||||||
|
dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.1.1
|
||||||
pull_policy: "IfNotPresent"
|
pull_policy: "IfNotPresent"
|
||||||
|
|
||||||
upgrades:
|
upgrades:
|
||||||
@ -65,15 +65,6 @@ network:
|
|||||||
port:
|
port:
|
||||||
api: 8776
|
api: 8776
|
||||||
|
|
||||||
database:
|
|
||||||
address: mariadb
|
|
||||||
port: 3306
|
|
||||||
root_user: root
|
|
||||||
root_password: password
|
|
||||||
cinder_database_name: cinder
|
|
||||||
cinder_password: password
|
|
||||||
cinder_user: cinder
|
|
||||||
|
|
||||||
ceph:
|
ceph:
|
||||||
enabled: true
|
enabled: true
|
||||||
monitors: []
|
monitors: []
|
||||||
@ -199,6 +190,20 @@ endpoints:
|
|||||||
scheme: 'http'
|
scheme: 'http'
|
||||||
port:
|
port:
|
||||||
api: 8776
|
api: 8776
|
||||||
|
oslo_db:
|
||||||
|
auth:
|
||||||
|
admin:
|
||||||
|
username: root
|
||||||
|
password: password
|
||||||
|
user:
|
||||||
|
username: cinder
|
||||||
|
password: password
|
||||||
|
hosts:
|
||||||
|
default: mariadb
|
||||||
|
path: /cinder
|
||||||
|
scheme: mysql+pymysql
|
||||||
|
port:
|
||||||
|
mysql: 3306
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
Loading…
Reference in New Issue
Block a user