Skip to content
This repository was archived by the owner on Jul 24, 2019. It is now read-only.

Commit c0141e1

Browse files
committed
Update Heat DB Jobs
1 parent 90c4496 commit c0141e1

File tree

8 files changed

+88
-67
lines changed

8 files changed

+88
-67
lines changed

heat/templates/bin/_db-init.sh.tpl

Lines changed: 0 additions & 36 deletions
This file was deleted.

heat/templates/bin/_db-sync.sh.tpl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# Copyright 2017 The Openstack-Helm Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -ex
18+
19+
heat-manage db_sync

heat/templates/configmap-bin.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ kind: ConfigMap
1717
metadata:
1818
name: heat-bin
1919
data:
20-
db-init.sh: |+
21-
{{ tuple "bin/_db-init.sh.tpl" . | include "helm-toolkit.template" | indent 4 }}
20+
db-init.py: |
21+
{{- include "helm-toolkit.db_init" . | indent 4 }}
22+
db-sync.sh: |
23+
{{ tuple "bin/_db-sync.sh.tpl" . | include "helm-toolkit.template" | indent 4 }}
2224
ks-service.sh: |+
2325
{{- include "helm-toolkit.keystone_service" . | indent 4 }}
2426
ks-endpoints.sh: |+

heat/templates/etc/_heat.conf.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ backend = oslo_cache.memcache_pool
4040
memcache_servers = "{{ .Values.memcached.host }}:{{ .Values.memcached.port }}"
4141

4242
[database]
43-
connection = mysql+pymysql://{{ .Values.database.heat_user }}:{{ .Values.database.heat_password }}@{{ .Values.database.address }}:{{ .Values.database.port }}/{{ .Values.database.heat_database_name }}
43+
connection = {{ tuple "oslo_db" "internal" "user" "mysql" . | include "helm-toolkit.authenticated_endpoint_uri_lookup" }}
4444
max_retries = -1
4545

4646
[keystone_authtoken]

heat/templates/job-db-init.yaml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,37 @@ spec:
4343
cpu: {{ .Values.resources.heat_db_init.limits.cpu | quote }}
4444
{{- end }}
4545
env:
46-
- name: ANSIBLE_LIBRARY
47-
value: /usr/share/ansible/
46+
- name: ROOT_DB_CONNECTION
47+
valueFrom:
48+
secretKeyRef:
49+
name: heat-db-root
50+
key: DB_CONNECTION
51+
- name: OPENSTACK_CONFIG_FILE
52+
value: /etc/heat/heat.conf
53+
- name: OPENSTACK_CONFIG_DB_SECTION
54+
value: database
55+
- name: OPENSTACK_CONFIG_DB_KEY
56+
value: connection
4857
command:
49-
- bash
50-
- /tmp/db-init.sh
58+
- python
59+
- /tmp/db-init.py
5160
volumeMounts:
52-
- name: dbinitsh
53-
mountPath: /tmp/db-init.sh
54-
subPath: db-init.sh
61+
- name: heat-bin
62+
mountPath: /tmp/db-init.py
63+
subPath: db-init.py
64+
readOnly: true
65+
- name: etcheat
66+
mountPath: /etc/heat
67+
- name: heatapiconf
68+
mountPath: /etc/heat/heat.conf
69+
subPath: heat.conf
5570
readOnly: true
5671
volumes:
57-
- name: dbinitsh
72+
- name: etcheat
73+
emptyDir: {}
74+
- name: heatapiconf
75+
configMap:
76+
name: heat-etc
77+
- name: heat-bin
5878
configMap:
5979
name: heat-bin

heat/templates/job-db-sync.yaml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,25 @@ spec:
4343
cpu: {{ .Values.resources.heat_db_sync.limits.cpu | quote }}
4444
{{- end }}
4545
command:
46-
- heat-manage
47-
args:
48-
- --config-dir
49-
- /etc/heat/conf
50-
- db_sync
46+
- bash
47+
- /tmp/db-sync.sh
5148
volumeMounts:
52-
- name: pod-etc-heat
49+
- name: heat-bin
50+
mountPath: /tmp/db-sync.sh
51+
subPath: db-sync.sh
52+
readOnly: true
53+
- name: etcheat
5354
mountPath: /etc/heat
54-
- name: heatconf
55-
mountPath: /etc/heat/conf/heat.conf
55+
- name: heatapiconf
56+
mountPath: /etc/heat/heat.conf
5657
subPath: heat.conf
5758
readOnly: true
5859
volumes:
59-
- name: pod-etc-heat
60+
- name: etcheat
6061
emptyDir: {}
61-
- name: heatconf
62+
- name: heatapiconf
6263
configMap:
6364
name: heat-etc
65+
- name: heat-bin
66+
configMap:
67+
name: heat-bin
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: heat-db-root
5+
type: Opaque
6+
data:
7+
DB_CONNECTION: {{ tuple "oslo_db" "internal" "admin" "mysql" . | include "helm-toolkit.authenticated_endpoint_uri_lookup" | b64enc }}

heat/values.yaml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ labels:
3030

3131
images:
3232
dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.1.1
33-
db_init: quay.io/stackanetes/stackanetes-kolla-toolbox:newton
33+
db_init: docker.io/kolla/ubuntu-source-heat-api:3.0.1
3434
db_sync: docker.io/kolla/ubuntu-source-heat-api:3.0.1
3535
ks_user: quay.io/stackanetes/stackanetes-kolla-toolbox:newton
3636
ks_service: quay.io/stackanetes/stackanetes-kolla-toolbox:newton
@@ -100,15 +100,6 @@ network:
100100
enabled: false
101101
port: 30003
102102

103-
database:
104-
address: mariadb
105-
port: 3306
106-
root_user: root
107-
root_password: password
108-
heat_database_name: heat
109-
heat_password: password
110-
heat_user: heat
111-
112103
messaging:
113104
hosts: rabbitmq
114105
user: rabbitmq
@@ -218,6 +209,20 @@ endpoints:
218209
scheme: 'http'
219210
port:
220211
api: 8003
212+
oslo_db:
213+
auth:
214+
admin:
215+
username: root
216+
password: password
217+
user:
218+
username: heat
219+
password: password
220+
hosts:
221+
default: mariadb
222+
path: /heat
223+
scheme: mysql+pymysql
224+
port:
225+
mysql: 3306
221226

222227
resources:
223228
enabled: false

0 commit comments

Comments
 (0)