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

Selector used as labels and selector

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


This section is empty.



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:

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:

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