Kubeformation is a tool to generate cloud provider specific declarative templates that can be used for creating and managing their managed Kubernetes service. The templates are generated by reading a simple spec file, which describes a Kubernetes cluster in the simplest form.
The cluster spec defines a Kubernetes cluster in a minimalistic way. It takes some parameters for the master, like name and k8s version, and a list of node pools along with their properties. It can also take volumes for which it generates persistent disk in the template and Kubernetes Persistent Volume/Claim object as YAML file.
A sample cluster spec is as follows:
version: v1 name: cluster-name provider: gke k8sVersion: "1.9" nodePools: - name: db-pool type: n1-standard-1 labels: app: postgres - name: backend-pool type: n1-standard-2 size: 2 labels: app: backend volumes: - name: postgres size: 10
A detailed definition can found at https://godoc.org/github.com/hasura/kubeformation/pkg/spec/v1/#ClusterSpec.
The following managed Kubernetes providers are supported:
A cluster spec is converted into Google Deployment Manager Template which defines are Kubernetes cluster. This template can be used by `gcloud` command to create and manage the cluster. GDM templates consists of a jinja template file along with a yaml file that defines the parameters.
For AKS, the cluster spec is converted into a Azure Deployment Manager Template. ARM templates consists of two JSON files, one file defines the deployment while other defines the parameters that can be used with the deployment.
|cmd||Package cmd defines all the executable formats of the tool:|
|cmd/api||An API server to which cluster spec can be POST'ed as JSON, responds with rendered cloud provider templates.|
|cmd/cli||A CLI tool that can read cluster spec from a file and write the rendered templates to a directory.|
|pkg/provider||Package provider implements the logic of generating cloud platform specific templates.|
|pkg/provider/aks||Package aks implements AKS provider for Kubeformation.|
|pkg/provider/gke||Package gke implements GKE provider for Kubeformation.|
|pkg/spec||Package spec implements methods to parse and process the cluster spec, which is the main input to kubeformation.|
|pkg/spec/v1||Package v1 implements handler for Cluster Spec v1|