Skip to content

BrianBland/vili

 
 

Repository files navigation

Vili

CircleCI Status Slack Status

Vili is an open source dashboard for managing deployments to a Kubernetes cluster. It is built to:

  • Manage both manual and continuous deployments
  • Gate production deployments through our QA process
  • Provide transparency into the current state of our infrastructure

Is Vili right for you?

Vili is opinionated, to be able to set it up you need to:

  • use GitHub for version control
  • build Docker images to ship code and tag them with the Git SHA and branch they were built from
  • push these Docker images to a Docker registry
  • use Kubernetes namespaces to manage environments
  • use Kubernetes deployments to deploy applications
  • use Slack for team messaging

What does Vili mean anyway?

Vili is a brother of Odin in Norse mythology, and he gives intelligence to the first humans.


Setup

To setup Vili on your Kubernetes cluster, follow these steps:

  1. Select a domain name to host Vili under, such as vili.mydomain.com. Create an Okta app with a redirect URL that points to vili.mydomain.com/login/callback. Write down the Okta entrypoint and the certificate.
  2. Create Docker repositories for your applications. You may use any standard Docker registry, including Docker Hub, quay.io, or a self-hosted registry. Amazon ECR registries are also supported.
  3. Create a new Firebase app. Set the "Firebase rules" to match this. Write down the Firebase app's URL and secret.
  4. Create a GitHub repo with a directory that holds your replication controller templates, pod templates, and environment variables following this example. Also create a GitHub access token following instructions here. Write down your GitHub organization or user name, the path to the directory created above and the authentication token.
  5. Create a Slack bot integration. Write down the API token from the integration settings page.
  6. Create a secret in your Kubernetes cluster that stores your GitHub, Docker, Firebase, and Slack credentials, and your Okta certificate following this example. Populate the values in the secret using the Okta, Docker, GitHub, Firebase, and Slack information you wrote down in the previous steps. Don't forget to base64 encode them as required by Kubernetes!
  7. Create a deployment in your Kubernetes cluster following this example. Populate the environment variables using the Okta, Docker, GitHub, Firebase, and Slack information you wrote down in the previous steps.
  8. Create a service for this replication controller, and allow external access to this service under the domain name you chose in step 1.

You are all set! Vili will use the GitHub and Docker Registry APIs to discover your apps and help you deploy them.

Local Vili Development

  1. Follow the example sample_devenv.sh to create your own environment file with relevant configration.

  2. Install redis and xmlsec1

    > brew install redis xmlsec1
    
  3. Start redis

    > brew services start redis
    
  4. Install Vili frontend node modules

    > cd /path/to/<vili-root>
    > npm install
    
  5. Build Vili frontend Webpack

    > npm run build
    
  6. Run Vili

    > go run main.go
    
  7. Direct your browser to https://localhost:4001. Viola!

Concepts

Environment: A namespace in Kubernetes that runs an isolated set of apps and jobs.

App: A stateless application controlled by a deployment in Kubernetes, run continuously, and deployed with no downtime.

Job: A pod in Kubernetes that runs to completion.

Template: YAML configuration files for controllers and pods, using go templates syntax for variable population.

Approval: An indication by the QA team that a certain build is deployable to prod.

Packages

No packages published

Languages

  • JavaScript 50.8%
  • Go 47.6%
  • Other 1.6%