MySQL Router K8s
- Canonical
- Databases
Channel | Revision | Published | Runs on |
---|---|---|---|
8.0/stable | 155 | 02 Sep 2024 | |
8.0/stable | 154 | 02 Sep 2024 | |
8.0/candidate | 155 | 27 Aug 2024 | |
8.0/candidate | 154 | 27 Aug 2024 | |
8.0/beta | 155 | 20 Aug 2024 | |
8.0/beta | 154 | 20 Aug 2024 | |
8.0/edge | 167 | 07 Oct 2024 | |
8.0/edge | 166 | 07 Oct 2024 |
juju deploy mysql-router-k8s --channel 8.0/stable
Deploy Kubernetes operators easily with Juju, the Universal Operator Lifecycle Manager. Need a Kubernetes cluster? Install MicroK8s to create a full CNCF-certified Kubernetes system in under 60 seconds.
Platform:
Charm Testing reference
There are a lot of test types available and most of them are well applicable for MySQL Router K8s. Here is a list prepared by Canonical:
- Smoke test
- Unit tests
- Integration tests
- System test
- Performance test
Note: below examples are written for Juju 3.x, but Juju 2.9 is supported as well.
Please adopt the juju run ...
commands as juju run-action ... --wait
for Juju 2.9.
Smoke test
Complexity: trivial
Speed: fast
Goal: ensure basic functionality works over short amount of time.
Setup an Juju 3.x environment, deploy DB with test application and start “continuous write” test:
juju add-model smoke-test
juju deploy mysql-k8s --trust --channel 8.0/edge --config profile=testing
juju deploy mysql-router-k8s --trust --channel 8.0/edge
juju relate mysql-k8s mysql-router-k8s
juju scale-application mysql-k8s 3 # (optional)
juju scale-application mysql-router-k8s 3 # (optional)
juju deploy mysql-test-app --channel latest/edge
juju relate mysql-test-app mysql-router-k8s:database
# Make sure random data inserted into DB by test application:
juju run mysql-test-app/leader get-inserted-data
# Start "continuous write" test:
juju run mysql-test-app/leader start-continuous-writes
export password=$(juju run mysql-k8s/leader get-password username=root | yq '.. | select(. | has("password")).password')
watch -n1 -x juju ssh --container mysql mysql-k8s/leader "mysql -h 127.0.0.1 -uroot -p${password} -e \"select count(*) from continuous_writes_database.data\""
# Watch the counter is growing!
Expected results:
- mysql-test-app continuously inserts records in database
continuous_writes_database
tabledata
. - the counters (amount of records in table) are growing on all cluster members
Hints:
# Stop "continuous write" test
juju run mysql-test-app/leader stop-continuous-writes
# Truncate "continuous write" table (delete all records from DB)
juju run mysql-test-app/leader clear-continuous-writes
Unit tests
Please check the “Contributing” guide and follow tox run -e unit
examples there.
Integration tests
Please check the “Contributing” guide and follow tox run -e integration
examples there.
System test
Please check/deploy the charm mysql-k8s-bundle (Git). It deploy and test all the necessary parts at once.
Performance test
Please use the separate Charmed MySQL K8s performance testing document but deploy Charmed MySQL K8s behind MySQL Router K8s.