108 Commits

Author SHA1 Message Date
Huang, Sophie (sh879n)
4f30b1361e Mariadb: Add ingress network policy overrides
This patch set adds in default mariadb ingress network policy
overrides for openstack namespace.

Change-Id: I037de30f868dfeb0dedb1c32209b8be6d4690962
2020-03-17 20:00:42 +00:00
Zuul
6228f5e958 Merge "MariaDB: avoid synchronization in state configmap updates" 2020-03-13 21:14:11 +00:00
Chris Wedgwood
3b42996949 [mariadb] Update to 10.2.31
Move to updated MariaDB version 10.2.31.  Tweak start.py for python3
as /usr/bin/python doesn't exist and isn't robust.

Change-Id: Ib64ed5de34e3ff87c634d09f98aaddeb374d2bd6
2020-03-03 23:04:10 +00:00
Phil Sphicas
2a4b369f25 MariaDB: avoid synchronization in state configmap updates
Each MariaDB instance updates the grastate configmap on a periodic
basis, every 10s by default. Collisions can occur when multiple
instances try to write their state at the same time (within a few
milliseconds). One instance will write successfully, and the other will
get a 409 error. There is nothing to break the synchronization, so the
failures tend to be persistent.

This change adds a small sleep after a collision is encountered,
creating an offset between the cycles.

Change-Id: Ib8a64f8f7ee15a6579e901d80ae759c38e0e901e
2020-03-03 14:12:46 -08:00
KHIYANI, RAHUL (rk0850)
d50371be9b Adding default apparmor profile to mariadb complete pods
Change-Id: I9a62b36c8cda0a6eaf8ac6b40f138b2706c63d15
2020-02-24 15:43:06 +00:00
Zuul
6a0a7f3cc4 Merge "Add Docker default AppArmor profile to mariadb exporter chart" 2020-02-18 19:29:24 +00:00
Zuul
75474c01b8 Merge "Address bandit gate failures" 2020-02-18 17:35:45 +00:00
KHIYANI, RAHUL (rk0850)
2712f54117 Add Docker default AppArmor profile to mariadb exporter chart
Change-Id: I6d5fcbb511f4f9cdb31727421fe320beeff1a882
2020-02-18 04:49:44 +00:00
Phil Sphicas
b482b57e6e mariadb: avoid state management thread death
The mariadb container launches two threads in addition to the mysql
daemon, one to mantain a configmap containing the Galera Cluster state,
and the other to handle leader elections. These threads die if they
suffer any exceptions talking to the kubernetes apiserver. This can
happen sometimes, e.g. when a k8s control node reboots.

This change logs and ignores the kubernetes.client.rest.ApiException,
allowing the threads to retry and hopefully succeed once the k8s api
becomes available.

Change-Id: I5745a763bb07f719d83a41c1f27be2b76ce998e9
2020-02-17 01:13:37 -08:00
Zuul
f17b6de1a2 Merge "Add Docker default AppArmor profile to mariadb" 2020-02-12 20:15:18 +00:00
KHIYANI, RAHUL (rk0850)
483d6f0047 Add Docker default AppArmor profile to mariadb
Change-Id: I256f169d6ff2de71b7218ab522bac9975d971c41
2020-02-12 10:32:22 -06:00
Parsons, Cliff (cp769u)
ef9d8392f2 Fix MariaDB Single Database Restore
This patchset fixes a serious database restoration problem where the
user is trying to restore a single database, but in the process of
restoring the database, the script inadvertently also removes all
tables from the other databases.

The root cause was that the mysql "--one-database" restore option
achieves the single database restoration, but somehow corrupts the
other databases. The new approach taken in this patchset is to
create a temporary database user which only has permission to
restore the chosen database, and that will leave the other databases
unharmed. This approach, which can be applied for restoring
individual databases and even database tables, was recommended in (1).
After the database is restored, the temporary user is deleted.

(1) https://mariadb.com/kb/en/restoring-data-from-dump-files/

Also improved some of the error handling as well.

Change-Id: I805c605ed2b424640ad6a0a379b1c0b9c0004e94
2020-02-06 16:17:28 +00:00
Gage Hugo
86e56b2aee Address bandit gate failures
This change addresses the results that were found when running
bandit against the templated python files in the various charts.

This also makes the bandit gate only run when python template
files are changed as well as makes the job voting.

Change-Id: Ia158f5f9d6d791872568dafe8bce69575fece5aa
2020-02-04 15:33:17 -06:00
Zuul
210a5187af Merge "Prevent splitbrain during full Galera restart" 2020-01-31 03:29:00 +00:00
Huang, Sophie (sh879n)
d135e2c964 Update audit user access for Mariadb
The audit user is granted SELECT permission
for all Mariadb databases and tables.

Change-Id: I621325e4a9d27d3ab0d0bc30b4926ea0fa3fd17e
2020-01-29 18:11:45 +00:00
Oleksii Grudev
b0bb8dfa7a Prevent splitbrain during full Galera restart
This patch introduces new cluster status "reboot"
which is set by leader node hence other nodes will
start mysql without "--wsrep-new-cluster" option.
Before this following situation took place:

All pods go down one by one with some offset;
First and second nodes have max seqno;
The script on the first node detects there are no active
backends and starts timeout loop;
The script on the second node detects there are no active
backends and starts timeout loop (with approx. 20 sec offset
from first node) ;
Timeout loop finishes on first node, it checks highest seqno
and lowest hostname  and wins the ability to start cluster.
Mysql is started with “--wsrep-new-cluster” parameter.
Seqno is set to “-1” for this node after mysql startup;
Periodic job syncs values from grastate file to configmap;
Timeout loop finishes on second node. It checks node with
highest seqno and lowest hostname and since seqno is already
“-1” for first node, the second node decides that it should
lead the cluster startup and executes mysql with “--wsrep-new-cluster”
option as well which leads to split brain

Change-Id: Ic63fd916289cb05411544cb33d5fdeed1352b380
2020-01-23 18:45:18 +02:00
Sophie Huang
a4568f31e2 Add audit user to Mariadb
An audit user is added to Mariadb with only the SELECT permission
to mysql database user table for database user audit purposes.

Change-Id: I5d046dd263e0994fea66e69359931b7dba4a766c
2020-01-21 19:20:51 +00:00
Zuul
c2ece6a45a Merge "Support for local storage" 2020-01-09 23:18:16 +00:00
Smruti Soumitra Khuntia
2ac08b59b4 Support for local storage
This change adds a means of introducing new storage classes
and local persistent volumes.

Change-Id: I340c75f3d0a1678f3149f3cf62e4ab104823cc49
Co-Authored-By: Steven Fitzpatrick <steven.fitzpatrick@att.com>
2020-01-09 10:24:31 -06:00
Tin Lam
c199addf3c Update apiVersion
This patch set updates and tests the apiVersion for rbac.authorization.k8s.io
from v1beta1 to v1 in preparation for its removal in k8s 1.20.

Change-Id: I4e68db1f75ff72eee55ecec93bd59c68c179c627
Signed-off-by: Tin Lam <tin@irrational.io>
2020-01-09 08:59:48 +00:00
Tin Lam
ac18e6acf9 Fix feature gate envvar overriding
Currently using envsubst to perform substitution of value overrides in
the feature gate caused conflicts as gotpl gets templated into those
overrides. This adds in '%%%REPLACE_${var}%%%' and uses sed to perform
the substitution instead to address the issue.

Change-Id: I9d3d630b53a2f3d828866229a5072bb04440ae15
Signed-off-by: Tin Lam <tin@irrational.io>
2019-12-07 12:22:16 -06:00
Zuul
2a33842a9f Merge "Move ingress config to separate configmap" 2019-11-25 15:28:21 +00:00
Zuul
108f89b208 Merge "Update egress HTK method" 2019-11-22 00:08:50 +00:00
Tin Lam
3121fc24c5 Update egress HTK method
This patch set places logic to generate kubernetes egress network policy
rule based on the dependencies specified in values.yaml. This also sets
up the necessary default network policy for the OSH gate.

Change-Id: I1ac649cc9debb5d1f4ea0a32f506dcda4d8b8536
Signed-off-by: Tin Lam <tin@irrational.io>
2019-11-21 20:05:34 +00:00
Steve Wilkerson
cbeb7f149b Move charts off using the :latest built tags
This updates charts that consume images built from osh-images to
use tags other than the :latest tags. This will be followed up
with the definition of jobs to allow for vetting out of updated
images, as reliance on :latest tags assumes any change merged into
osh-images will result in functionally correct behavior (which has
shown to not be the case traditionally)

Change-Id: I181aa56ed187604dc7583d8081e53cc69eb27310
Signed-off-by: Steve Wilkerson <sw5822@att.com>
2019-11-21 19:57:07 +00:00
Mykyta Karpin
2cffc4e3ae Move ingress config to separate configmap
Currently when updating configuration for mariadb, ingress pods also
are being restarted, however there were no reasons for this.

Change-Id: I398e20541a0e2337e9a5d100f3ef6ce4ad7d0284
2019-11-20 14:14:09 +00:00
Evgeny L
f173d6103f Add default Network Policies for Mariadb Prometheus Exporter
Due to missing default policies for MySQL Prometheus
Exporter the Pod fails to start.

Change-Id: Ib9f013f97a83da0c2e36f2d38e54ae0a906700e5
2019-11-11 07:46:26 +00:00
Zuul
02af18d5dc Merge "Fix search of max sequence number" 2019-11-11 01:08:01 +00:00
KHIYANI, RAHUL (rk0850)
9d808c96fa Adding missing readOnlyRootFilesystem flag for container security context
Change-Id: Ibc8e259dabad9a162f43df0b7eb4d94e3f3e5c9b
2019-11-04 16:55:39 +00:00
Zuul
24c1cd4514 Merge "Database backup fix" 2019-10-23 19:16:28 +00:00
Oleksii Grudev
4d808243f0 Fix search of max sequence number
It was observed that sometimes during
galera ckuster restart the node with highest
seqno is determined incorrecly. After investigation
it was found that max function is invoked on the
list of string values which can lead to incorrect results.
This patch performs casting the value to integer before building
list of seqnos hence max function will return correct result

Change-Id: I604ec837f3f2d157c829ab43a44e561879775c77
2019-10-23 15:39:47 +03:00
Steve Wilkerson
b50fae62a4 Update kubernetes-entrypoint image reference
This updates the kubernetes-entrypoint image reference to consume
the publicly available kubernetes-entrypoint image that is built
and maintained under the airshipit namespace, as the stackanetes
image is no longer actively maintained

Change-Id: I5bfdc156ae228ab16da57569ac6b05a9a125cb6a
Signed-off-by: Steve Wilkerson <sw5822@att.com>
2019-10-18 18:20:11 +00:00
Huang, Sophie (sh879n)
f7168620ae Database backup fix
This patch set fixes the calculation of how long a database backup
has be taken. In the existing code, the time difference is rounded
to days, even a second less than 4 days will be rounded to 3 days.
This effectively allows archives to be kept for one additional day.

The new calculation and comparison is based on seconds.

Change-Id: I5547e923538ddb83f409b1e7df936baf664e717a
2019-10-17 17:21:02 -05:00
Steve Wilkerson
c9acad238c Update Kubernetes version to 1.16.2
This updates the kubeadm and minikube Kubernetes deployments to
deploy version 1.16.2

Change-Id: I324f9665a24c9383c59376fb77cdb853facd0f18
Signed-off-by: Steve Wilkerson <sw5822@att.com>
2019-10-16 21:54:53 +00:00
Tin Lam
1b0190765d Ensure python scripts are py3 compatible
This patch set is one of many to migrate existing code/script to be
python-3 compatible as python-2 is sunsetting in January 2020.

Change-Id: I4a8fa4c07fd36583716b5ccfdcb0bcdc008db3e7
Signed-off-by: Tin Lam <tin@irrational.io>
2019-10-14 21:26:02 +00:00
Tin Lam
4a9f9a1c77 Fix python script to be py3 compatible
In Python 3, sys.maxint is removed per [0]. This patch set replaces
sys.maxint with sys.maxsize.

[0] https://docs.python.org/3.1/whatsnew/3.0.html#integers

Change-Id: I267fa6700558b69d3e646838b933e3289067a621
Signed-off-by: Tin Lam <tin@irrational.io>
2019-10-14 19:04:18 +00:00
Pete Birley
6cc4369e1e Mariadb: allow probe params to be adjusted
This PS exposes the ability to adjust the readiness check
probe params.

Change-Id: Ic4730ef1d07f5cdf4b6fae5bb1331d788ea84e2e
Signed-off-by: Pete Birley <pete@port.direct>
2019-10-04 15:24:09 +00:00
Oleksii Grudev
80a3dcc9e9 [mysql-exporter] Use flags depending on version
This patch adds functionality to check
current version of mysql_exporter binary and to modify
configuration flags depending on version

Change-Id: Ic1f42fbf5c99203d6e2fca4fc345632b64e5dc0a
2019-09-30 11:11:38 +00:00
Pete Birley
c3a1ae43fd Mariadb: Run ingress error page server as nobody user
This PS updates the mariadb ingress error page server to run as the
nobody user.

Change-Id: I13756ba79e8c7b857e0807447192e06b11762abf
Signed-off-by: Pete Birley <pete@port.direct>
2019-09-25 23:02:03 +00:00
Gage Hugo
f0779e2825 Add network policy value overrides
This change adds network policy overrides for multiple infra
services for the openstack-helm network policy gate.

Change-Id: If051ec1749cb9ed1e289f0cf82a8876371e36531
2019-09-24 13:48:10 +00:00
Pete Birley
a5682e7db3 MairaDB: Move all config to be values driven
This PS moves to drive all mariadb config via the values fed
to the chart.

Change-Id: I4ed3624737af4d5c90b1b5de451a0a0b75a5eda1
Signed-off-by: Pete Birley <pete@port.direct>
2019-08-21 14:08:25 -05:00
Pete Birley
aba044cb0e Mariadb: define timeouts for wsrep
This PS updates the wsrep_provider_options to define the timeouts
explitlcitly for evs.suspect_timeout, gmcast.peer_timeout. Their
defaults are PT5S, and PT3S respectively, which are increased by
a factor of approx 5, to accomdate network instability that may
occur during node outage events.

Change-Id: Ie5cdd06d91299e5e2632b70cb9b50a7ad14f62b1
Signed-off-by: Pete Birley <pete@port.direct>
2019-08-21 14:48:05 +00:00
Pete Birley
e96bdd9fb6 Ingress: Clean up tmp dir entirely on container start
This PS cleans up the container dir entirely on container restart,
as sometimes remnets of previous runs can cause issues.

Change-Id: I873667a8a57bca6096cbe777ee83ef8648a368d4
Signed-off-by: Pete Birley <pete@port.direct>
2019-07-16 01:21:02 +00:00
Sphicas, Phil (ps3910)
09bf431fe7 MariaDB: Disable SSL chain completion on ingress controller
This PS sets `--enable-ssl-chain-completion=false` for the MariaDB
ingress controller. This is the default for current versions of
the nginx-ingress-controller, but for 0.9.0 needs to be set.

If enableSSLChainCompletion is left on, nginx will attempt to
autocomplete SSL certificate chains with missing intermediate CA
certificates, causing unnecessary network and errors in pod logs.

Change-Id: I088b33fe994281dca6997baa87a6b599c3f10c14
Closes-Bug: #1835364
2019-07-03 23:20:15 -07:00
Yi Wang
c53b1fa86d Add a configmap for mariadb ingress controller
The configmap is for mariab ingress controller configuration. It is
to enable the capability of overriding default nginx configurations
in the controller.

Change-Id: I25eb8a237a6f8ad63bde725b1d4f31a928fa7c49
Signed-off-by: Yi Wang <yi.c.wang@intel.com>
2019-07-03 21:07:51 +00:00
Pete Birley
fc58be6a93 Ingress: Clean prometheus-nginx.socket on startup
This PS cleans the prometheus-nginx.socket on startup of the container,
which is required to allow the container, as opposed to the pod, restart.

Change-Id: I7906e85a200f6fb92467371218b4e5957add39f4
Signed-off-by: Pete Birley <pete@port.direct>
2019-06-19 14:02:56 +00:00
caoyuan
040edeb79a Replace git.openstack.org URLs with opendev.org URLs
Change-Id: I0e3af4a3385f5b2a7705bc19b775863b16c2e08e
2019-05-31 01:52:10 +00:00
Itxaka
ce086f7e41
mariadb: fix hostpath values
Use the correct declaration of the hostpath

Change-Id: I7661083ad24abfb8469700ab2039b4b7be5dd681
2019-05-29 14:06:21 +02:00
Zuul
8731166dbf Merge "Mariadb: Correct parameter name" 2019-05-23 14:19:14 +00:00
Zuul
c3acf282a3 Merge "Point to OSH-images images" 2019-05-23 14:19:12 +00:00