Skip to content

Support for Kubernetes #1118

@krisnova

Description

@krisnova

Right now Go buffalo creates a Dockerfile in a user's application. I think we could take that a step further and add support for deploying a Buffalo application to Kubernetes.

I presented a keynote at VelocityConf this year, and did a live demo of deploying a buffalo app to Kubernetes. The application can be found here and the manifests I used to deploy in Kubernetes can be found here.

The way Kubernetes works is that you need to define various resources to create in your cluster (usually in YAML). When those resources are all deployed correctly you should have a working (publicly available) application. A list of the resources I created when I ran my Buffalo application in Kubernetes:

Example Kubernetes Resources

Buffalo Application

  • Deployment
  • Ingress
  • Service

Postgres Database

  • Deployment
  • Service
  • Persistent Volume
  • Persistent Volume Claim

Ingress controller

  • Contour

Dynamic Configuration Problem

As we know Buffalo lets users pick various options while building there application. In some cases, these options will need to trickle down into the Kubernetes resources that would be defined. An example would be changing a database from Postgres to something else.

Ksonnet

There are tools like ksonnet that abstract the Kubernetes resources needed to define an application. We could leverage ksonnet's ability to have multiple flavors of an application to handle the dynamic configuration problem

Helm

Most Kubernetes users are familiar with Helm. We could write a Chart that helm could then read and deploy. Helm would also allow us to define various dynamic configuration and logic to include/exclude various resources. The main difference between Helm and Ksonnet is Ksonnet uses an abstraction, where Helm is just a templating language (text/template).

Success

As a user I can create an arbitrary Buffalo application, and in less than 3 commands I can easily have my application running in a properly configured Kubernetes cluster.

As a user who deployed their application to Kubernetes I can easily find a resolvable address where my Buffalo application can be found at.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedFeel free to contribute!proposalA suggestion for a change, feature, enhancement, etc

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions