v1

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package v1 is the initial version of types which integrate with the Kubernetes API.

Contains the Stack Definition Language(pkg: github.com/ovrclk/akash/sdl) Manifest declarations which are written to Kubernetes CRDs for storage.

Manifest {
	ManifestSpec {
		k8s.TypeMeta
		LeaseID
		ManifestGroup
			k8s.TypeMeta
			Name
			[]*ManifestService
				ManifestService analogous to a running container.
	ManifestStatus
		State
		Message
}

Index

Constants

View Source
const (
	// CRDSingular the singleton name
	CRDSingular string = "manifest"
	// CRDPlural represents CRD resource Plural
	CRDPlural string = "manifests"
	// CRDGroup represents CRD resource Group
	CRDGroup string = "akash.network"
	// CRDVersion represents CRD resource Version
	CRDVersion string = "v1"
	// FullCRDName represents CRD resource fullname
	FullCRDName string = CRDPlural + "." + CRDGroup
)

Variables

View Source
var (
	// SchemeBuilder represents new CRD scheme builder
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme applies all the stored functions to the scheme
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: CRDGroup, Version: CRDVersion}

Create a Rest client with the new CRD Schema

Functions

func CreateCRD

func CreateCRD(ctx context.Context, clientset apiextcs.Interface) error

CreateCRD creates the CRD resource, ignore error if it already exists

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type LeaseID

type LeaseID struct {
	metav1.ObjectMeta `json:"metadata"`
	metav1.TypeMeta   `json:",inline"`

	// Deployment Sequence ID + Owner Account address marshalled
	Deployment []byte `protobuf:"bytes,1,opt,name=deployment,proto3,customtype=github.com/ovrclk/akash/types/base.Bytes" json:"deployment"`

	// Group sequence
	Group uint64 `protobuf:"varint,2,opt,name=group,proto3" json:"group,omitempty"`

	// Order sequence
	Order uint64 `protobuf:"varint,3,opt,name=order,proto3" json:"order,omitempty"`

	// Provider address
	Provider []byte `protobuf:"bytes,4,opt,name=provider,proto3,customtype=github.com/ovrclk/akash/types/base.Bytes" json:"provider"`
}

LeaseID stores deployment, group sequence, order, provider and metadata

func LeaseIDFromAkash added in v0.3.0

func LeaseIDFromAkash(id mtypes.LeaseID) LeaseID

LeaseIDFromAkash returns LeaseID instance from akash

func (*LeaseID) DeepCopy

func (in *LeaseID) DeepCopy() *LeaseID

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeaseID.

func (*LeaseID) DeepCopyInto

func (in *LeaseID) DeepCopyInto(out *LeaseID)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LeaseID) DeepCopyObject

func (in *LeaseID) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (LeaseID) ToAkash added in v0.3.0

func (id LeaseID) ToAkash() mtypes.LeaseID

ToAkash returns LeaseID from LeaseID details

type Manifest

type Manifest struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata"`
	Spec              ManifestSpec
	Status            ManifestStatus
}

Manifest store metadata, specifications and status of the Lease ./k8s.io/code-generator/generate-groups.sh all github.com/ovrclk/akash/pkg/client github.com/ovrclk/akash/pkg/apis akash.network:v1 For more details of code-generator, please visit https://github.com/kubernetes/code-generator +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func NewManifest

func NewManifest(name string, lid mtypes.LeaseID, mgroup *manifest.Group) (*Manifest, error)

NewManifest creates new manifest with provided details. Returns error incase of failure.

func (*Manifest) DeepCopy

func (in *Manifest) DeepCopy() *Manifest

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Manifest.

func (*Manifest) DeepCopyInto

func (in *Manifest) DeepCopyInto(out *Manifest)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Manifest) DeepCopyObject

func (in *Manifest) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (Manifest) LeaseID

func (m Manifest) LeaseID() mtypes.LeaseID

LeaseID returns lease details from manifest

func (Manifest) ManifestGroup

func (m Manifest) ManifestGroup() manifest.Group

ManifestGroup returns Group details from manifest

type ManifestGroup

type ManifestGroup struct {
	metav1.TypeMeta `json:",inline"`
	// Placement profile name
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Service definitions
	Services []*ManifestService `protobuf:"bytes,2,rep,name=services" json:"services,omitempty"`
}

ManifestGroup stores metadata, name and list of SDL manifest services

func ManifestGroupFromAkash added in v0.3.0

func ManifestGroupFromAkash(m *manifest.Group) ManifestGroup

ManifestGroupFromAkash returns manifest group instance from akash group

func (*ManifestGroup) DeepCopy

func (in *ManifestGroup) DeepCopy() *ManifestGroup

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManifestGroup.

func (*ManifestGroup) DeepCopyInto

func (in *ManifestGroup) DeepCopyInto(out *ManifestGroup)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ManifestGroup) DeepCopyObject

func (in *ManifestGroup) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (ManifestGroup) ToAkash added in v0.3.0

func (m ManifestGroup) ToAkash() *manifest.Group

ToAkash returns akash group details formatted from manifest group

type ManifestList

type ManifestList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:",inline"`
	Items           []Manifest `json:"items"`
}

ManifestList stores metadata and items list of manifest

func (*ManifestList) DeepCopy

func (in *ManifestList) DeepCopy() *ManifestList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManifestList.

func (*ManifestList) DeepCopyInto

func (in *ManifestList) DeepCopyInto(out *ManifestList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ManifestList) DeepCopyObject

func (in *ManifestList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ManifestService

type ManifestService struct {
	// Service name
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Docker image
	Image string   `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"`
	Args  []string `protobuf:"bytes,3,rep,name=args" json:"args,omitempty"`
	Env   []string `protobuf:"bytes,4,rep,name=env" json:"env,omitempty"`
	// Resource requirements
	Unit ResourceUnit `protobuf:"bytes,5,opt,name=unit" json:"unit"`
	// Number of instances
	Count uint32 `protobuf:"varint,6,opt,name=count,proto3" json:"count,omitempty"`
	// Overlay Network Links
	Expose []*ManifestServiceExpose `protobuf:"bytes,7,rep,name=expose" json:"expose,omitempty"`
}

ManifestService stores name, image, args, env, unit, count and expose list of service

func (*ManifestService) DeepCopy

func (in *ManifestService) DeepCopy() *ManifestService

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManifestService.

func (*ManifestService) DeepCopyInto

func (in *ManifestService) DeepCopyInto(out *ManifestService)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ManifestServiceExpose

type ManifestServiceExpose struct {
	Port         uint32 `protobuf:"varint,1,opt,name=port,proto3" json:"port,omitempty"`
	ExternalPort uint32 `protobuf:"varint,2,opt,name=externalPort,proto3" json:"externalPort,omitempty"`
	Proto        string `protobuf:"bytes,3,opt,name=proto,proto3" json:"proto,omitempty"`
	Service      string `protobuf:"bytes,4,opt,name=service,proto3" json:"service,omitempty"`
	Global       bool   `protobuf:"varint,5,opt,name=global,proto3" json:"global,omitempty"`
	// accepted hostnames
	Hosts []string `protobuf:"bytes,6,rep,name=hosts" json:"hosts,omitempty"`
}

ManifestServiceExpose stores exposed ports and accepted hosts details

func (*ManifestServiceExpose) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManifestServiceExpose.

func (*ManifestServiceExpose) DeepCopyInto

func (in *ManifestServiceExpose) DeepCopyInto(out *ManifestServiceExpose)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ManifestSpec

type ManifestSpec struct {
	metav1.TypeMeta `json:",inline"`
	LeaseID         LeaseID       `json:"lease_id"`
	ManifestGroup   ManifestGroup `json:"manifest_group"`
}

ManifestSpec stores LeaseID, Group and metadata details

func (*ManifestSpec) DeepCopy

func (in *ManifestSpec) DeepCopy() *ManifestSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManifestSpec.

func (*ManifestSpec) DeepCopyInto

func (in *ManifestSpec) DeepCopyInto(out *ManifestSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ManifestSpec) DeepCopyObject

func (in *ManifestSpec) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ManifestStatus

type ManifestStatus struct {
	State   string `json:"state,omitempty"`
	Message string `json:"message,omitempty"`
}

ManifestStatus stores state and message of manifest

func (*ManifestStatus) DeepCopy

func (in *ManifestStatus) DeepCopy() *ManifestStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManifestStatus.

func (*ManifestStatus) DeepCopyInto

func (in *ManifestStatus) DeepCopyInto(out *ManifestStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceUnit

type ResourceUnit struct {
	CPU     uint32 `protobuf:"varint,1,opt,name=CPU,proto3" json:"CPU,omitempty"`
	Memory  uint64 `protobuf:"varint,2,opt,name=memory,proto3" json:"memory,omitempty"`
	Storage uint64 `protobuf:"varint,3,opt,name=storage,proto3" json:"storage,omitempty"`
}

ResourceUnit stores cpu, memory and storage details

func (*ResourceUnit) DeepCopy

func (in *ResourceUnit) DeepCopy() *ResourceUnit

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceUnit.

func (*ResourceUnit) DeepCopyInto

func (in *ResourceUnit) DeepCopyInto(out *ResourceUnit)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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