Skip to content
This repository has been archived by the owner on Apr 30, 2020. It is now read-only.
/ rds-operator Public archive

☁️ ⎈ A kubernetes operator to manage RDS DB in AWS ( Supports ALL Engines )

Notifications You must be signed in to change notification settings

agill17/rds-operator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install and Deploy

Option 1: kubectl way

  1. kubectl apply -f examples/operator.yaml ( provide aws credentials in here )
  2. kubectl apply -f examples/auroraMySQLCluster.yaml

Option 2: Helm chart


Example/Samples

  • Can be found under examples/ dir

DBCluster vs DBInstance

  • 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.

Features

  • Create ( All RDS Databases, Subnet groups )
    • DBCluster: spec.createClusterSpec
      • credentialsFromSecret: spec.credentialsFrom
      • externalNameService: spec.serviceName
      • initDBJob spec.initDBJob
    • DBInstance: spec.createInstanceSpec
      • credentialsFromSecret: spec.credentialsFrom
      • externalNameService: spec.serviceName ✅ ( primary db instance )
      • initDBJob spec.initDBJob ❌ ( if attached to DBCluster, this wont run at all. )
  • Delete ( All RDS Databases, Subnet groups ) ✅
    • DBCluster: spec.deleteClusterSpec
    • DBInstance: spec.deleteInstanceSpec
  • Restore from rds snapshot ( All RDS Databases )
    • DBCluster: spec.createClusterFromSnapshot
    • DBInstance: spec.createInstanceFromSnapshot

TODO

  • 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 ) ❌

About

☁️ ⎈ A kubernetes operator to manage RDS DB in AWS ( Supports ALL Engines )

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages