67 views
--- type: slide slideOptions: transition: slide --- # Discourse Forum Automation ### Rajula Vineet Reddy #### Supervisors: #### Ismael Posada Trobo, Andreas Wagner #### IT-CDA-WF --- ## 'Discourse Service' #### Started about an year ago #### 24 instances currently as of today #### Numbers are expected to increase soon --- ## Current Deployment ---- ## Openshift Templates <!-- ![Minion](https://octodex.github.com/images/minion.png =200x200) <!-- --> ![](https://codimd.web.cern.ch/uploads/upload_134572ab83bcd483bc91ebe7c2868923.png =400x200) --- ## Problems with the current approach ---- ### Templates are not flexible enough ---- ### Instance failures/ problems require individual attention ---- ### Templates will be deprecated in future OKD version --- ## Solution :::success :zap: Operators! :zap: ::: --- ## Operators! #### Operators are code representation of operational logic with expertise #### Operators are custom controllers #### Flexible & customizable #### Easy to build ![](https://codimd.web.cern.ch/uploads/upload_a1e1a3f7a2c3dc2d7fdf43e59a11985e.png) --- ## Operator Framework #### Open source toolkit to create & manage operators ---- ### Operator SDK #### Framework built on Kubernetes *controller-runtime* library #### Makes writing operators easier ---- ### Ansible ![](https://codimd.web.cern.ch/uploads/upload_dbe40409f8bec64400e8171f7854c137.png) --- ## Discourse Operator #### Built using Ansible #### Can create & manage Discourse instances #### Takes care of business logic ![](https://codimd.web.cern.ch/uploads/upload_b0aeedcc1728f269a419fca0a2ddc3a3.png =350x150) --- ## Database? #### Currently, we manually instatiate & configure the database for our applications #### Procedure is manual & there is no automation ---- ## Why not have a DB operator! #### Create & delete DB instances automatically #### DB deletion can be triggered on Discourse deletion using finalizers --- ## Postgresql Operator ### Crunchydata Postgresql Operator #### Open source #### Extensive features #### *pgo* client to communicate with the operator ![](https://codimd.web.cern.ch/uploads/upload_eda98a63ae62f5e26a8d9eaf8c81b1a4.png) ---- ## Final outcome ![](https://codimd.web.cern.ch/uploads/upload_576cbcdd9d7769f64595a0f2dd4262e3.png =800x400) ---- ### Problems faced ##### Openshift clusters - PV ##### *operator-sdk* better compatible with OKD 4.x ##### Kaniko build failure - *quay.io* ---- ## Future work #### Integrate with OLM (Operator Lifecycle Manager) #### Add backup/ rollback functionalities #### Auto upgrade with Discourse upstream test branches #### Publish the operator ---- ## References #### Project Repo - https://gitlab.cern.ch/rvineetr/discourse-operator #### operator-sdk - https://github.com/operator-framework/operator-sdk/ #### Lighting Talk - https://indico.cern.ch/event/830002/contributions/3523481/ ---- # Thank you!