fix(deploy): add missing plugin files for mysql-client library in mysql-setup #7909
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
Bug Description 🐛
This PR fixes a bug found when running the
datahub-mysql-setup
job within a kubernetes cluster that connects to a MySQL 8 database instance. It appears the current mysql-setup script uses themysql-client
alpine package that does not include files necessary to support the MySQLcaching_sha2_password
plugin. An additional package is required to get the setup script to work.How to Reproduce
caching_sha2_password
plugin active (which occurs by default).I configured my Kube cluster to connect to my MySQL instance instead of using the default Bitnami chart.
When running
helm upgrade datahub datahub/datahub --values values.yaml
the datahub-mysql-setup job fails on each run with the following error: 🐛The Core Issue 💡
The MariaDB reference is notable as we are connecting to a MySQL instance. I believe this indicates that the mysql client used to execute the SQL DDL cannot find the proper plugin files in its local installation. Upon further investigation, it appears the
mysql-client
package used in the mysql-setup script is a mariadb client and likely the source of the problem.I confirmed this client is the source of the error by rebuilding the mysql-setup docker image using its Dockerfile and attempting to manually connect to the same database. And I received the same error.
A Potential Solution 😃
Based on this thread this error has been seen before and the simple solution is to add the
mariadb-connector-c
package. I added the package in my local container and I was able to connect to the database without error.Considerations 🤔