openstack-helm/mariadb/templates/job-seed.yaml
Larry Rensing fea453ba72 Consolidate volumes across charts
This PS standardizes configmap mounts across all charts to be named
<project>-etc or <project>-bin.  This reduces the amount of volumes
listed in each file.

Change-Id: Idbaf495fa243bb9ea0f6ad755ca4f899d5fc0d6f
2017-05-16 15:49:51 +00:00

109 lines
3.6 KiB
YAML

# 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.
---
apiVersion: batch/v1
kind: Job
metadata:
name: mariadb-seed
spec:
template:
metadata:
labels:
app: mariadb
spec:
restartPolicy: Never
nodeSelector:
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
containers:
- name: mariadb-init
image: {{ .Values.images.mariadb }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{- if .Values.resources.enabled }}
resources:
limits:
cpu: {{ .Values.resources.job.seed.limits.cpu | quote }}
memory: {{ .Values.resources.job.seed.limits.memory | quote }}
requests:
cpu: {{ .Values.resources.job.seed.requests.cpu | quote }}
memory: {{ .Values.resources.job.seed.requests.memory | quote }}
{{- end }}
command:
- bash
- /tmp/seed.sh
env:
- name: INTERFACE_NAME
value: "eth0"
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
ports:
- containerPort: {{ .Values.network.port.mariadb }}
- containerPort: {{ .Values.network.port.wsrep }}
- containerPort: {{ .Values.network.port.ist }}
volumeMounts:
- name: mycnfd
mountPath: /etc/my.cnf.d
- name: mariadb-bin
mountPath: /tmp/seed.sh
subPath: seed.sh
- name: mariadb-bin
mountPath: /tmp/bootstrap-db.sh
subPath: bootstrap-db.sh
- name: mariadb-bin
mountPath: /tmp/peer-finder.py
subPath: peer-finder.py
- name: mariadb-etc
mountPath: /etc/my.cnf.d/charsets.cnf
subPath: charsets.cnf
- name: mariadb-etc
mountPath: /etc/my.cnf.d/engine.cnf
subPath: engine.cnf
- name: mariadb-etc
mountPath: /etc/my.cnf.d/log.cnf
subPath: log.cnf
- name: mariadb-etc
mountPath: /etc/my.cnf
subPath: my.cnf
- name: mariadb-etc
mountPath: /etc/my.cnf.d/networking.cnf
subPath: networking.cnf
- name: mariadb-etc
mountPath: /etc/my.cnf.d/pid.cnf
subPath: pid.cnf
- name: mariadb-etc
mountPath: /etc/my.cnf.d/tuning.cnf
subPath: tuning.cnf
- name: mariadb-etc
mountPath: /etc/my.cnf.d/wsrep.cnf
subPath: wsrep.cnf
volumes:
- name: mycnfd
emptyDir: {}
- name: mariadb-bin
configMap:
name: mariadb-bin
- name: mariadb-etc
configMap:
name: mariadb-etc