Home - ocd-scm/ocd-meta GitHub Wiki
OCD Overview
OCD is an flexible automation toolkit for continuous deployment of applications and configuration onto Origin Community Distribution of Kubernetes "OKD" and it's commercial derivatives. It can do full automation of some, or all, of:
- Building a tagged container image into the Origin registry automatically when a git tag is applied to the application git repo.
- Deploying tagged container images and their configuration automatically when a git tag is applied to the environment git repo.
- Deploying secrets and configmaps that are encrypt in git that are automatically decrypted and installed when a when a git tag is applied to the environment git repo.
- Using a chatbot to drive release builds, deployments and configuration changes.
OCD provides webhooks that pattern match on git release events (tag push events or manual releases). It doesn't have any opinions about how you develop code with git, which git server you use, nor which continuous build tool or service you use to automate testing of your code.
Under the bonnet, OCD uses Helmfile with some generic charts that are optimised for running 12factor.net style webapps and microservices. Helm and Helmfile are also very good at running databases and other fussy deployments.
The core component of OCD is a small go app that pulls your Helmfile configuration and updates all your Helmfile configuration. Anyone who is using Helm charts on Origin Kubernetes can benefit from installing and configuring this simple application.
The following sections describes everything that OCD can do as user stories.
Building
OCD implements this story for building:
Given a developer wants to create a release of an application
When they create a git release $TAG of the code that matches a regular expression
Then an OCD webhook will catch the git webhook event and run an s2i build
And will apply $TAG to the built container image within the registry
See the ocd-builder repo.
The s2i documentation has details of how to use official, community, or homemade s2i images to compile your application code. See the infrequently asked questions as to why s2i is preferred over a Dockerfile.
Deploying
OCD implements this story for deploying:
Given an application image with tag $TAG in the registry
And a pull request to have $TAG in the $ENV git repo
When they merge the pull request in the $ENV git repo
Then the OCD webhook will checkout the $ENV git repo
And run helm to upgrade the app
Managing Configuration
OCD implements this story for managing configuration such as 3rd party API credentials:
Given a developer wants to update the credentials within $ENV
And has created a pull request with a GPG encrypted credentials in the $ENV git repo
When they merge the pull request in the $ENV git repo
Then an OCD webhook will checkout the $ENV git repo
And unencrypt the credentials
And run helm to upgrade the secret in $ENV