gke

package
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: 3 Imported by: 0

Documentation

Overview

Package gke implements GKE provider for Kubeformation. It can generate Google Deployment Manager template in Jinja format. Only input required is the Spec object.

Google Deployment Manager template supports Python files, Jinja templates as well as plain Yaml files. Kubeformation converts cluster spec into "Spec" as defined below and generate two files, cluster.jinja and cluster.yaml. These files are defined as Go templates in templates.go and are rendered with Spec as context.

Index

Constants

View Source
const (
	// Default version to be used in case cluster spec did not contain k8sVersion.
	DefaultK8SVersion = "1.9"

	// Google compute machine type to be used as default.
	DefaultMachineType = "n1-standard-1"

	// Default value for OS image.
	DefaultImageType = "cos"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NodePool

type NodePool struct {
	// Name of the node pool
	Name string

	// Kubernetes labels to be applied to nodes in this pool
	Labels map[string]string

	// Number of nodes in this pool
	Size int64

	// Google compute engine machine type to use
	MachineType string

	// Image type to use for the nodes
	ImageType string
}

NodePool defines a collection of nodes with similar properties in a Kubernetes cluster.

type Spec

type Spec struct {
	// Name of the cluster
	Name string

	// Kubernetes version to use
	K8SVersion string

	// Node pools for the cluster
	NodePools []NodePool

	// Persistent disks to be created
	Volumes []Volume
}

Spec defines the context required to render GDM template.

func NewDefaultSpec

func NewDefaultSpec() *Spec

NewDefaultSpec returns a spec object which is complete enough to render a valid GDM template.

func (*Spec) GetType

func (s *Spec) GetType() provider.ProviderType

GetType returns the type of this provider.

func (*Spec) MarshalFiles

func (s *Spec) MarshalFiles() (map[string][]byte, error)

MarshalFiles returns the rendered GDM template as a map which indicates filename as keys and the file content as value. FIXME: test does not capture the template errors.

type Volume

type Volume struct {
	// Name of the disk
	Name string

	// Size of the disk to be created, in GB
	SizeGB int
}

Volume defines a Google Persistent Disk to be created along with the cluster.

Jump to

Keyboard shortcuts

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