Cretedb task
This commit is contained in:
parent
2dd46335a5
commit
055b934cef
|
@ -0,0 +1,26 @@
|
||||||
|
- name: Create database for {{service_name}} job
|
||||||
|
k8s_v1_job:
|
||||||
|
host: "{{coe_host}}"
|
||||||
|
context: "{{kube_context}}"
|
||||||
|
kubeconfig: "{{config_file}}"
|
||||||
|
name: '{{service_name}}-createdb'
|
||||||
|
namespace: "{{namespace}}"
|
||||||
|
state: present
|
||||||
|
restart_policy: OnFailure
|
||||||
|
containers:
|
||||||
|
- image: "tripleoupstream/centos-binary-mariadb"
|
||||||
|
name: '{{service_name}}-createdb'
|
||||||
|
command:
|
||||||
|
- mysql
|
||||||
|
- -e
|
||||||
|
- "create database if not exists {{database_name}}"
|
||||||
|
volume_mounts: &volume_mounts
|
||||||
|
- name: mariadb-root
|
||||||
|
subPath: my.cnf
|
||||||
|
mountPath: /etc/my.cnf
|
||||||
|
read_only: true
|
||||||
|
volumes:
|
||||||
|
- name: mariadb-root
|
||||||
|
secret:
|
||||||
|
secret_name: mariadb-root
|
||||||
|
state: present
|
Loading…
Reference in New Issue