kubectl apply -f examples/operator.yaml
( provide aws credentials in here )kubectl apply -f examples/auroraMySQLCluster.yaml
- Can be found under
examples/
dir
- Use DBCluster and DBInstance (Both) WHEN creating anything with aurora ( so aurora-mysql or aurora-postgresql )
- Why use DBCluster? Because of how AWS SDK works.
- Their docs for DBCluster state the following
// // Valid Values: aurora (for MySQL 5.6-compatible Aurora), aurora-mysql (for // MySQL 5.7-compatible Aurora), and aurora-postgresql // // Engine is a required field Engine *string `type:"string" required:"true"`
- So the only valid values for DBClusters are aurora-mysql and aurora-postgresql
- Once DBCluster is created, you must attach instances to that cluster, thats where DBInstance comes into the picture.
- How to attach a DBInstance to a DBCluster? You have to provide DBClusterIdentifier within DBInstance.
- WHEN to use standalone DBInstance? -- WHENever you want to create anything thats not aurora.
- Create ( All RDS Databases, Subnet groups )
- DBCluster:
spec.createClusterSpec
✅- credentialsFromSecret:
spec.credentialsFrom
✅ - externalNameService:
spec.serviceName
✅ - initDBJob
spec.initDBJob
❌
- credentialsFromSecret:
- DBInstance:
spec.createInstanceSpec
✅- credentialsFromSecret:
spec.credentialsFrom
❌ - externalNameService:
spec.serviceName
✅ ( primary db instance ) - initDBJob
spec.initDBJob
❌ ( if attached to DBCluster, this wont run at all. )
- credentialsFromSecret:
- DBCluster:
- Delete ( All RDS Databases, Subnet groups ) ✅
- DBCluster:
spec.deleteClusterSpec
✅ - DBInstance:
spec.deleteInstanceSpec
✅
- DBCluster:
- Restore from rds snapshot ( All RDS Databases )
- DBCluster:
spec.createClusterFromSnapshot
✅ - DBInstance:
spec.createInstanceFromSnapshot
✅
- DBCluster:
- Reconcile AWS resources periodically ❌ ( Recreate DB incase they get deleted )
- Need some sort of trigger that the cloud resource got deleted.
- For the time being, use k8s objects as events to trigger reconcile instead of periodic sync?
Centralize (create/delete/restore) into rdsLib and make use of existing interface funcs!✅- Add docs
- Make Secret resource conditional for both DBCluster(:white_check_mark:) and DBInstance ( some folks might want to pass credentials like username and password from a k8s secret so there is no need to deploy another secret with the same information )
- Add support for initDB Job in dbCluster so that a user can have their db imported from an existing image ( DBCluster & DBInstance )
- Make delete optional and get rid of deleteSpec to enforce snapshotting before deleting rds.
- Update ( COMING SOON ) ❌
- CreateReadReplica WHEN deployed from scratch and or from snapshot ( COMING SOON ) ❌