kubernetes

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Selector     = "io.kev.service"
	NetworkLabel = "io.kev.network"
)

Selector used as labels and selector

View Source
const (
	// Name of the converter
	Name = "kubernetes"
)

Variables

This section is empty.

Functions

func PrintList

func PrintList(objects []runtime.Object, opt ConvertOptions, rendered map[string][]byte) error

PrintList prints k8s objects @orig: https://github.com/kubernetes/kompose/blob/master/pkg/transformer/kubernetes/k8sutils.go#L153

Types

type ConvertOptions

type ConvertOptions struct {
	ToStdout     bool     // Display output to STDOUT
	CreateChart  bool     // Create K8s manifests as Chart
	GenerateJSON bool     // Ganerate outcome as JSON. By defaults YAML gets generated.
	EmptyVols    bool     // Treat all referenced volumes as Empty volumes
	Volumes      string   // Volumes to be generated ("persistentVolumeClaim"|"emptyDir"|"hostPath"|"configMap") (default "persistentVolumeClaim")
	InputFiles   []string // Compose files to be processed
	OutFile      string   // If Directory output will be split into individual files
	YAMLIndent   int      // YAML Indentation in resultant K8s manifests
}

ConvertOptions holds all options that controls transformation process

type EnvSort

type EnvSort []v1.EnvVar

EnvSort struct

func (EnvSort) Len

func (env EnvSort) Len() int

Len returns the number of elements in the collection. @orig: https://github.com/kubernetes/kompose/blob/master/pkg/transformer/utils.go#L214-L228

func (EnvSort) Less

func (env EnvSort) Less(i, j int) bool

Less returns whether the element with index i should sort before the element with index j.

func (EnvSort) Swap

func (env EnvSort) Swap(i, j int)

swaps the elements with indexes i and j.

type K8s

type K8s struct{}

K8s is a native kubernetes manifests converter

func New

func New() *K8s

New return a native Kubernetes converter

func (*K8s) Render

func (c *K8s) Render(singleFile bool, dir, workDir string, projects map[string]*composego.Project, files map[string][]string, rendered map[string][]byte) error

Render generates outcome

type Kubernetes

type Kubernetes struct {
	Opt     ConvertOptions // user provided options from the command line
	Project *composego.Project
}

Kubernetes transformer

func (*Kubernetes) Transform

func (k *Kubernetes) Transform() ([]runtime.Object, error)

Transform converts compose project to set of k8s objects returns object that are already sorted in the way that Services are first @orig: https://github.com/kubernetes/kompose/blob/master/pkg/transformer/kubernetes/kubernetes.go#L1140

type ProjectService

type ProjectService composego.ServiceConfig

ProjectService is a wrapper type around composego.ServiceConfig

type Volumes

type Volumes struct {
	SvcName       string // Service name to which volume is linked
	MountPath     string // Mountpath extracted from docker-compose file
	VFrom         string // denotes service name from which volume is coming
	VolumeName    string // name of volume if provided explicitly
	Host          string // host machine address
	Container     string // Mountpath
	Mode          string // access mode for volume
	PVCName       string // name of PVC
	PVCSize       string // PVC size
	StorageClass  string // PVC storage class
	SelectorValue string // Value of the label selector
}

Volumes holds the container volume struct

Jump to

Keyboard shortcuts

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