kubeformation

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2018 License: Apache-2.0 Imports: 0 Imported by: 0

README

kubeformation

Create declarative specifications for your managed Kubernetes cloud vendor (GKE, AKS).

GoDoc Chat on Discord Follow on Twitter

Kubeformation Diagram

Motivation

With Kubernetes, it becomes possible to start making everything about your application declarative. As cloud vendors start providing managed Kubernetes services, provisioning a Kubernetes cluster via the vendor’s API becomes declarative as well.

Kubeformation is a simple web UI and CLI that helps you create “Google Deployment manager” or “Azure Resoure Manager” templates which are a little painful to create by hand.

Once you have this file, you can run your cloud vendor CLI on it to provision your cluster. You can edit this file to add vendor specific configuration too.

Usage

or

  • Write cluster spec yourself. [docs]
  • Use the kubeformation CLI to generate template. [docs]
  • Follow provider specific instructions to create the cluster. [docs]

Example

Here's a spec that defines a Kubernetes cluster: cluster.yaml

version: v1
name: cluster-name
provider: gke
k8sVersion: "1.9"
nodePools:
- name: db-pool
  type: n1-standard-1
  size: 1
  labels:
    app: postgres
- name: backend-pool
  type: n1-standard-2
  size: 2
  labels:
    app: backend
volumes:
- name: postgres
  size: 10

kubeformation can read this file and generate Google Cloud Deployment Manager template, which can then be used with gcloud command to create the GKE cluster. This is a declarative template that can be used to further do create or modify the cluster.

$ kubeformation -f cluster.yaml -o templates

Then, use gcloud CLI to create the deployment. [docs]

$ gcloud deployment-manager deployments create my-cluster --config templates/gke-cluster.yaml

NOTE: kubeformation is exclusively meant for managed Kubernetes providers. The following providers are currently supported:

  1. Google Kubernetes Engine (GKE)
  2. Azure Container Service (AKS)

Installation

Download CLI for your platform from the releases page, add it to PATH and give execute permissions.

$ chmod +x kubeformation

Docs

Read complete docs here.

FAQ

  • Why cloud provider specific information, such as zone/region/location etc. does not appear in the cluster spec?
    • The purpose of Kubeformation is to bootstrap a cloud provider specific template that you can later modify according to your needs.

Roadmap

Kubeformation is open to evolution. Current goal is to support all managed Kubernetes vendors that support declarative specification.

  • EKS support (#10)
  • Other providers (#11)

Contributing

Kubeformation is an open source project licensed under Apache 2.0. Checkout the contributing guide to get started.

Maintainers

Current maintainers: @shahidh_k, @arvishankar, @JaisonTitus.

Documentation

Overview

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.

Cluster Spec

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:

Google Kubernetes Engine - GKE

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.

Azure Kubernetes Service - AKS

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.

Directories

Path Synopsis
cmd
Package cmd defines all the executable formats of the tool: 1.
Package cmd defines all the executable formats of the tool: 1.
api
An API server to which cluster spec can be POST'ed as JSON, responds with rendered cloud provider templates.
An API server to which cluster spec can be POST'ed as JSON, responds with rendered cloud provider templates.
cli
A CLI tool that can read cluster spec from a file and write the rendered templates to a directory.
A CLI tool that can read cluster spec from a file and write the rendered templates to a directory.
pkg
cmd
provider
Package provider implements the logic of generating cloud platform specific templates.
Package provider implements the logic of generating cloud platform specific templates.
provider/aks
Package aks implements AKS provider for Kubeformation.
Package aks implements AKS provider for Kubeformation.
provider/gke
Package gke implements GKE provider for Kubeformation.
Package gke implements GKE provider for Kubeformation.
spec
Package spec implements methods to parse and process the cluster spec, which is the main input to kubeformation.
Package spec implements methods to parse and process the cluster spec, which is the main input to kubeformation.
spec/v1
Package v1 implements handler for Cluster Spec v1
Package v1 implements handler for Cluster Spec v1

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL