This is an example kubernetes operator written in python with the help of kopf.
This code is licensed under the MIT License. See LICENSE.txt file.
This operator is an example operator and definitively NOT production ready.
See example files for usage examples.
This resource creates a mysql pod and a secret with an autogenerated password.
This resource creates a database in the mysql pod.
This resource creates a user in the mysql pod.
If you want to debug with VSCode you can create the following launch.json file:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Run Operator",
"type": "python",
"request": "launch",
"program": "/Users/jan/ENV/k8s-operator/bin/kopf",
"args": [
"run",
"${file}",
],
"justMyCode": true
}
]
}