diff --git a/mariadb/Chart.yaml b/mariadb/Chart.yaml index 4cb81e13b7..4711e51292 100644 --- a/mariadb/Chart.yaml +++ b/mariadb/Chart.yaml @@ -1,3 +1,17 @@ +# 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: v1 description: A helm chart for mariadb name: mariadb diff --git a/mariadb/requirements.yaml b/mariadb/requirements.yaml index 2350b1facb..65cf88221f 100644 --- a/mariadb/requirements.yaml +++ b/mariadb/requirements.yaml @@ -1,3 +1,17 @@ +# 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. + dependencies: - name: common repository: http://localhost:8879/charts diff --git a/mariadb/templates/bin/_bootstrap-db.sh.tpl b/mariadb/templates/bin/_bootstrap-db.sh.tpl index 6e491d6423..bc1b7d5880 100644 --- a/mariadb/templates/bin/_bootstrap-db.sh.tpl +++ b/mariadb/templates/bin/_bootstrap-db.sh.tpl @@ -1,4 +1,17 @@ #!/bin/sh +# 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 diff --git a/mariadb/templates/bin/_peer-finder.py.tpl b/mariadb/templates/bin/_peer-finder.py.tpl index ceff6751ef..bceab182a5 100644 --- a/mariadb/templates/bin/_peer-finder.py.tpl +++ b/mariadb/templates/bin/_peer-finder.py.tpl @@ -1,4 +1,18 @@ #!/usr/bin/env python +# 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. + import json import os import urllib2 @@ -88,4 +102,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/mariadb/templates/bin/_readiness.py.tpl b/mariadb/templates/bin/_readiness.py.tpl index d0ecd881ce..5261b87490 100644 --- a/mariadb/templates/bin/_readiness.py.tpl +++ b/mariadb/templates/bin/_readiness.py.tpl @@ -1,4 +1,18 @@ #!/usr/bin/env python +# 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. + import os import sys import time diff --git a/mariadb/templates/bin/_seed.sh.tpl b/mariadb/templates/bin/_seed.sh.tpl index 95f2b80fb7..51a1e1c69d 100644 --- a/mariadb/templates/bin/_seed.sh.tpl +++ b/mariadb/templates/bin/_seed.sh.tpl @@ -1,4 +1,17 @@ #!/bin/sh +# 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 diff --git a/mariadb/templates/bin/_start.sh.tpl b/mariadb/templates/bin/_start.sh.tpl index f46d6cfc9e..1a747cf00e 100644 --- a/mariadb/templates/bin/_start.sh.tpl +++ b/mariadb/templates/bin/_start.sh.tpl @@ -1,4 +1,18 @@ #!/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 trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT @@ -24,7 +38,7 @@ fi if [ "$REPLICAS" -eq 1 ] ; then if [[ ! -f ${INIT_MARKER} ]]; then - cd /var/lib/mysql + cd /var/lib/mysql echo "Creating one-instance MariaDB." bash /tmp/bootstrap-db.sh touch ${INIT_MARKER} diff --git a/mariadb/templates/configmap-bin.yaml b/mariadb/templates/configmap-bin.yaml index e9c7131207..7c459790e0 100644 --- a/mariadb/templates/configmap-bin.yaml +++ b/mariadb/templates/configmap-bin.yaml @@ -1,15 +1,29 @@ +# 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: v1 kind: ConfigMap metadata: name: mariadb-bin data: start.sh: | -{{ tuple "bin/_start.sh.tpl" . | include "template" | indent 4 }} +{{ tuple "bin/_start.sh.tpl" . | include "template" | indent 4 }} peer-finder.py: | {{ tuple "bin/_peer-finder.py.tpl" . | include "template" | indent 4 }} readiness.py: | -{{ tuple "bin/_readiness.py.tpl" . | include "template" | indent 4 }} +{{ tuple "bin/_readiness.py.tpl" . | include "template" | indent 4 }} bootstrap-db.sh: | {{ tuple "bin/_bootstrap-db.sh.tpl" . | include "template" | indent 4 }} seed.sh: | -{{ tuple "bin/_seed.sh.tpl" . | include "template" | indent 4 }} +{{ tuple "bin/_seed.sh.tpl" . | include "template" | indent 4 }} diff --git a/mariadb/templates/configmap-etc.yaml b/mariadb/templates/configmap-etc.yaml index 5bd2595771..006357b6d7 100644 --- a/mariadb/templates/configmap-etc.yaml +++ b/mariadb/templates/configmap-etc.yaml @@ -1,21 +1,35 @@ +# 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: v1 kind: ConfigMap metadata: name: mariadb-etc data: charsets.cnf: | -{{ tuple "etc/_charsets.cnf.tpl" . | include "template" | indent 4 }} +{{ tuple "etc/_charsets.cnf.tpl" . | include "template" | indent 4 }} engine.cnf: | {{ tuple "etc/_engine.cnf.tpl" . | include "template" | indent 4 }} my.cnf: | -{{ tuple "etc/_galera-my.cnf.tpl" . | include "template" | indent 4 }} +{{ tuple "etc/_galera-my.cnf.tpl" . | include "template" | indent 4 }} log.cnf: | {{ tuple "etc/_log.cnf.tpl" . | include "template" | indent 4 }} pid.cnf: | -{{ tuple "etc/_pid.cnf.tpl" . | include "template" | indent 4 }} +{{ tuple "etc/_pid.cnf.tpl" . | include "template" | indent 4 }} tuning.cnf: | -{{ tuple "etc/_tuning.cnf.tpl" . | include "template" | indent 4 }} +{{ tuple "etc/_tuning.cnf.tpl" . | include "template" | indent 4 }} networking.cnf: | -{{ tuple "etc/_networking.cnf.tpl" . | include "template" | indent 4 }} +{{ tuple "etc/_networking.cnf.tpl" . | include "template" | indent 4 }} wsrep.cnf: | -{{ tuple "etc/_wsrep.cnf.tpl" . | include "template" | indent 4 }} \ No newline at end of file +{{ tuple "etc/_wsrep.cnf.tpl" . | include "template" | indent 4 }} diff --git a/mariadb/templates/deployment.yaml b/mariadb/templates/deployment.yaml index 341e3f238e..2a7669c123 100644 --- a/mariadb/templates/deployment.yaml +++ b/mariadb/templates/deployment.yaml @@ -1,3 +1,17 @@ +# 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: apps/v1beta1 kind: StatefulSet @@ -99,19 +113,19 @@ spec: mountPath: /mariadb-readiness.py subPath: readiness.py - name: charsets - mountPath: /etc/my.cnf.d/charsets.cnf + mountPath: /etc/my.cnf.d/charsets.cnf subPath: charsets.cnf - name: engine mountPath: /etc/my.cnf.d/engine.cnf subPath: engine.cnf - name: log - mountPath: /etc/my.cnf.d/log.cnf + mountPath: /etc/my.cnf.d/log.cnf subPath: log.cnf - name: mycnf - mountPath: /etc/my.cnf + mountPath: /etc/my.cnf subPath: my.cnf - name: networking - mountPath: /etc/my.cnf.d/networking.cnf + mountPath: /etc/my.cnf.d/networking.cnf subPath: networking.cnf - name: pid mountPath: /etc/my.cnf.d/pid.cnf @@ -123,7 +137,7 @@ spec: mountPath: /etc/my.cnf.d/wsrep.cnf subPath: wsrep.cnf - name: mysql-data - mountPath: /var/lib/mysql + mountPath: /var/lib/mysql volumes: - name: mycnfd emptyDir: {} diff --git a/mariadb/templates/etc/_charsets.cnf.tpl b/mariadb/templates/etc/_charsets.cnf.tpl index ae30a83278..9f9f61cba4 100644 --- a/mariadb/templates/etc/_charsets.cnf.tpl +++ b/mariadb/templates/etc/_charsets.cnf.tpl @@ -1,3 +1,17 @@ +# 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. + [mysqld] character_set_server=utf8 collation_server=utf8_unicode_ci diff --git a/mariadb/templates/etc/_engine.cnf.tpl b/mariadb/templates/etc/_engine.cnf.tpl index 78f7815bc3..7ec3f21a7d 100644 --- a/mariadb/templates/etc/_engine.cnf.tpl +++ b/mariadb/templates/etc/_engine.cnf.tpl @@ -1,3 +1,17 @@ +# 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. + [mysqld] default-storage-engine=InnoDB innodb=FORCE diff --git a/mariadb/templates/etc/_galera-my.cnf.tpl b/mariadb/templates/etc/_galera-my.cnf.tpl index 9a515fd9d6..818f575863 100644 --- a/mariadb/templates/etc/_galera-my.cnf.tpl +++ b/mariadb/templates/etc/_galera-my.cnf.tpl @@ -1,3 +1,17 @@ +# 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. + [mysqld] datadir=/var/lib/mysql basedir=/usr diff --git a/mariadb/templates/etc/_log.cnf.tpl b/mariadb/templates/etc/_log.cnf.tpl index 0aeeaad8ec..2fb854050e 100644 --- a/mariadb/templates/etc/_log.cnf.tpl +++ b/mariadb/templates/etc/_log.cnf.tpl @@ -1,3 +1,17 @@ +# 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. + [mysqld] slow_query_log=off slow_query_log_file=/var/log/mysql/mariadb-slow.log diff --git a/mariadb/templates/etc/_networking.cnf.tpl b/mariadb/templates/etc/_networking.cnf.tpl index f1f768124f..41bdda9ca7 100644 --- a/mariadb/templates/etc/_networking.cnf.tpl +++ b/mariadb/templates/etc/_networking.cnf.tpl @@ -1,3 +1,17 @@ +# 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. + [mysqld] bind_address=0.0.0.0 port={{ .Values.network.port.mariadb }} diff --git a/mariadb/templates/etc/_pid.cnf.tpl b/mariadb/templates/etc/_pid.cnf.tpl index ed2a80ed5a..aeb9cc6d6e 100644 --- a/mariadb/templates/etc/_pid.cnf.tpl +++ b/mariadb/templates/etc/_pid.cnf.tpl @@ -1,2 +1,16 @@ +# 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. + [mysqld] pid_file=/var/lib/mysql/mariadb.pid diff --git a/mariadb/templates/etc/_tuning.cnf.tpl b/mariadb/templates/etc/_tuning.cnf.tpl index 8f308dbafb..52022373c7 100644 --- a/mariadb/templates/etc/_tuning.cnf.tpl +++ b/mariadb/templates/etc/_tuning.cnf.tpl @@ -1,3 +1,17 @@ +# 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. + [mysqld] user=mysql max_allowed_packet=256M diff --git a/mariadb/templates/etc/_wsrep.cnf.tpl b/mariadb/templates/etc/_wsrep.cnf.tpl index ca999790eb..f5eb0f76f3 100644 --- a/mariadb/templates/etc/_wsrep.cnf.tpl +++ b/mariadb/templates/etc/_wsrep.cnf.tpl @@ -1,3 +1,17 @@ +# 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. + [mysqld] wsrep_cluster_name="{{ .Values.database.cluster_name }}" wsrep_provider=/usr/lib/galera/libgalera_smm.so diff --git a/mariadb/templates/job-seed.yaml b/mariadb/templates/job-seed.yaml index 762801e19d..77a0eca18c 100644 --- a/mariadb/templates/job-seed.yaml +++ b/mariadb/templates/job-seed.yaml @@ -1,3 +1,17 @@ +# 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 @@ -35,7 +49,7 @@ spec: - name: POD_IP valueFrom: fieldRef: - fieldPath: status.podIP + fieldPath: status.podIP - name: NAMESPACE valueFrom: fieldRef: @@ -91,7 +105,7 @@ spec: - name: bootstrapdb configMap: name: mariadb-bin - - name: peerfinder + - name: peerfinder configMap: name: mariadb-bin - name: charsets diff --git a/mariadb/templates/service.yaml b/mariadb/templates/service.yaml index 7cadcaadc7..38cf6fcecf 100644 --- a/mariadb/templates/service.yaml +++ b/mariadb/templates/service.yaml @@ -1,3 +1,17 @@ +# 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: v1 kind: Service metadata: diff --git a/mariadb/values.yaml b/mariadb/values.yaml index df015f6569..b5943c6d0c 100644 --- a/mariadb/values.yaml +++ b/mariadb/values.yaml @@ -1,7 +1,16 @@ -# Default values for mariadb. -# This is a YAML-formatted file. -# Declare name/value pairs to be passed into your templates. -# name: value +# 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. # note that you need to update the gcomm member list # below when changing this value @@ -57,12 +66,12 @@ labels: network: port: - wsrep: 4567 - mariadb: 3306 + wsrep: 4567 + mariadb: 3306 ist: 4444 dns: kubernetes_domain: cluster.local - + database: root_password: password cluster_name: mariadb