v1

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

Documentation

Overview

Package v1 implements handler for Cluster Spec v1

Index

Constants

This section is empty.

Variables

View Source
var ErrEmtpyInput = errors.New("kubeformation: empty input data")
View Source
var ErrSpecParseFailure = errors.New("kubeformation: parsing spec failed")

ErrSpecParseFailure can be thrown if the given spec cannot be parsed into a known format

Functions

This section is empty.

Types

type ClusterSpec

type ClusterSpec struct {
	// Version is the spec version
	Version string `json:"version"`

	// Name of the Kubernetes cluster
	Name string `json:"name"`

	// Provider for which the template has to be generated
	Provider string `json:"provider"`

	// K8SVersion is the version for Kubernetes Cluster. Specific version numbers
	// will vary from provider to provider
	K8SVersion string `json:"k8sVersion"`

	// NodePools denotes the node pools for the cluster
	NodePools []NodePool `json:"nodePools"`

	// Volumes are the persistent volumes to be used in this cluster.
	// Corresponding disk and k8s persistent volume object will be created.
	Volumes []Volume `json:"volumes"`
}

ClusterSpec defines the structure of a Kubernetes cluster

func (*ClusterSpec) GenerateProviderTemplate

func (s *ClusterSpec) GenerateProviderTemplate(providerType provider.ProviderType) (map[string][]byte, error)

GenerateProviderTemplate returns a map of template files for the given provider. If provider is not explicitly passed, it is taken from the Spec.

func (*ClusterSpec) GetVersion

func (s *ClusterSpec) GetVersion() string

GetVersion returns the current spec version

func (*ClusterSpec) Read

func (s *ClusterSpec) Read(data []byte) (spec.VersionedSpecHandler, error)

Read returns a Handler after reading the spec

type NodePool

type NodePool struct {
	// Name of the node pool
	Name string `json:"name"`

	// Size is the number of nodes in this node pool
	Size int64 `json:"size"`

	// Type of the nodes in this pool. Value will be provider specific
	Type string `json:"type"`

	// OSImage is the OS to be used for the node
	OSImage string `json:"osImage"`

	// Labels to be applied to the nodes in the pool
	Labels map[string]string `json:"labels"`
}

NodePools indicate the spec for a Kubernetes node pools. A NodePool is just a collection of nodes having the same configuration

type Volume

type Volume struct {
	// Name of the volume
	Name string `json:"name"`

	// Size of the volume in GB
	Size int `json:"size"`
}

Volume denotes a volume to be used in the cluster. A backing disk and a k8s PV object will be created for each volume.

Jump to

Keyboard shortcuts

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