v1alpha1¶
import "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha1"
Overview¶
+k8s:deepcopy-gen=package +k8s:defaulter-gen=TypeMeta +k8s:openapi-gen=true +k8s:conversion-gen=github.com/weaveworks/ignite/pkg/apis/ignite
Index¶
- Constants
- Variables
- func Convert_ignite_ImageSpec_To_v1alpha1_ImageSpec(in ignite.ImageSpec, out ImageSpec, s conversion.Scope) error
- func Convert_ignite_KernelSpec_To_v1alpha1_KernelSpec(in ignite.KernelSpec, out KernelSpec, s conversion.Scope) error
- func Convert_ignite_OCIImageSource_To_v1alpha1_OCIImageSource(in ignite.OCIImageSource, out OCIImageSource, s conversion.Scope) error
- func Convert_ignite_OCI_To_v1alpha1_OCIClaim(in meta.OCIImageRef, out OCIImageClaim) error
- func Convert_ignite_VMImageSpec_To_v1alpha1_VMImageSpec(in ignite.VMImageSpec, out VMImageSpec, s conversion.Scope) error
- func Convert_ignite_VMKernelSpec_To_v1alpha1_VMKernelSpec(in ignite.VMKernelSpec, out VMKernelSpec, s conversion.Scope) error
- func Convert_ignite_VMSpec_To_v1alpha1_VMSpec(in ignite.VMSpec, out VMSpec, s conversion.Scope) error
- func Convert_ignite_VMStatus_To_v1alpha1_VMStatus(in ignite.VMStatus, out VMStatus, s conversion.Scope) error
- func Convert_v1alpha1_ImageSpec_To_ignite_ImageSpec(in ImageSpec, out ignite.ImageSpec, s conversion.Scope) error
- func Convert_v1alpha1_KernelSpec_To_ignite_KernelSpec(in KernelSpec, out ignite.KernelSpec, s conversion.Scope) error
- func Convert_v1alpha1_OCIClaim_To_ignite_OCI(in OCIImageClaim, out meta.OCIImageRef) error
- func Convert_v1alpha1_OCIImageSource_To_ignite_OCIImageSource(in OCIImageSource, out ignite.OCIImageSource, s conversion.Scope) (err error)
- func Convert_v1alpha1_VMImageSpec_To_ignite_VMImageSpec(in VMImageSpec, out ignite.VMImageSpec, s conversion.Scope) error
- func Convert_v1alpha1_VMKernelSpec_To_ignite_VMKernelSpec(in VMKernelSpec, out ignite.VMKernelSpec, s conversion.Scope) error
- func Convert_v1alpha1_VMNetworkSpec_To_ignite_VMNetworkSpec(in VMNetworkSpec, out ignite.VMNetworkSpec, s conversion.Scope) error
- func Convert_v1alpha1_VMSpec_To_ignite_VMSpec(in VMSpec, out ignite.VMSpec, s conversion.Scope) error
- func Convert_v1alpha1_VMStatus_To_ignite_VMStatus(in VMStatus, out ignite.VMStatus, s conversion.Scope) error
- func SetDefaults_OCIImageClaim(obj *OCIImageClaim)
- func SetDefaults_PoolSpec(obj *PoolSpec)
- func SetDefaults_VMKernelSpec(obj *VMKernelSpec)
- func SetDefaults_VMNetworkSpec(obj *VMNetworkSpec)
- func SetDefaults_VMSpec(obj *VMSpec)
- func SetDefaults_VMStatus(obj *VMStatus)
- type FileMapping
- type Image
- type ImageSourceType
- type ImageSpec
- type ImageStatus
- type Kernel
- type KernelSpec
- type KernelStatus
- type NetworkMode
- type OCIImageClaim
- type OCIImageSource
- type Pool
- type PoolDevice
- type PoolDeviceType
- type PoolSpec
- type PoolStatus
- type SSH
- type VM
- type VMImageSpec
- type VMKernelSpec
- type VMNetworkSpec
- type VMSpec
- type VMState
- type VMStatus
Package files¶
conversion.go defaults.go doc.go json.go register.go types.go
Constants¶
const (
KindImage runtime.Kind = "Image"
KindKernel runtime.Kind = "Kernel"
KindVM runtime.Kind = "VM"
)
const (
// GroupName is the group name use in this package
GroupName = "ignite.weave.works"
)
Variables¶
var (
// SchemeBuilder the schema builder
SchemeBuilder = runtime.NewSchemeBuilder(
addKnownTypes,
addDefaultingFuncs,
)
AddToScheme = localSchemeBuilder.AddToScheme
)
var SchemeGroupVersion = schema.GroupVersion{
Group: GroupName,
Version: "v1alpha1",
}
SchemeGroupVersion is group version used to register these objects
func Convert_ignite_ImageSpec_To_v1alpha1_ImageSpec¶
func Convert_ignite_ImageSpec_To_v1alpha1_ImageSpec(in *ignite.ImageSpec, out *ImageSpec, s conversion.Scope) error
Convert_ignite_ImageSpec_To_v1alpha1_ImageSpec calls the autogenerated conversion function along with custom conversion logic
func Convert_ignite_KernelSpec_To_v1alpha1_KernelSpec¶
func Convert_ignite_KernelSpec_To_v1alpha1_KernelSpec(in *ignite.KernelSpec, out *KernelSpec, s conversion.Scope) error
Convert_ignite_KernelSpec_To_v1alpha1_KernelSpec calls the autogenerated conversion function along with custom conversion logic
func Convert_ignite_OCIImageSource_To_v1alpha1_OCIImageSource¶
func Convert_ignite_OCIImageSource_To_v1alpha1_OCIImageSource(in *ignite.OCIImageSource, out *OCIImageSource, s conversion.Scope) error
Convert_ignite_OCIImageSource_To_v1alpha1_OCIImageSource calls the autogenerated conversion function along with custom conversion logic
func Convert_ignite_OCI_To_v1alpha1_OCIClaim¶
func Convert_ignite_OCI_To_v1alpha1_OCIClaim(in *meta.OCIImageRef, out *OCIImageClaim) error
func Convert_ignite_VMImageSpec_To_v1alpha1_VMImageSpec¶
func Convert_ignite_VMImageSpec_To_v1alpha1_VMImageSpec(in *ignite.VMImageSpec, out *VMImageSpec, s conversion.Scope) error
Convert_ignite_VMImageSpec_To_v1alpha1_VMImageSpec calls the autogenerated conversion function along with custom conversion logic
func Convert_ignite_VMKernelSpec_To_v1alpha1_VMKernelSpec¶
func Convert_ignite_VMKernelSpec_To_v1alpha1_VMKernelSpec(in *ignite.VMKernelSpec, out *VMKernelSpec, s conversion.Scope) error
Convert_ignite_VMKernelSpec_To_v1alpha1_VMKernelSpec calls the autogenerated conversion function along with custom conversion logic
func Convert_ignite_VMSpec_To_v1alpha1_VMSpec¶
func Convert_ignite_VMSpec_To_v1alpha1_VMSpec(in *ignite.VMSpec, out *VMSpec, s conversion.Scope) error
Convert_ignite_VMSpec_To_v1alpha1_VMSpec calls the autogenerated conversion function along with custom conversion logic
func Convert_ignite_VMStatus_To_v1alpha1_VMStatus¶
func Convert_ignite_VMStatus_To_v1alpha1_VMStatus(in *ignite.VMStatus, out *VMStatus, s conversion.Scope) error
Convert_ignite_VMStatus_To_v1alpha1_VMStatus calls the autogenerated conversion function along with custom conversion logic
func Convert_v1alpha1_ImageSpec_To_ignite_ImageSpec¶
func Convert_v1alpha1_ImageSpec_To_ignite_ImageSpec(in *ImageSpec, out *ignite.ImageSpec, s conversion.Scope) error
Convert_v1alpha1_ImageSpec_To_ignite_ImageSpec calls the autogenerated conversion function along with custom conversion logic
func Convert_v1alpha1_KernelSpec_To_ignite_KernelSpec¶
func Convert_v1alpha1_KernelSpec_To_ignite_KernelSpec(in *KernelSpec, out *ignite.KernelSpec, s conversion.Scope) error
Convert_v1alpha1_KernelSpec_To_ignite_KernelSpec calls the autogenerated conversion function along with custom conversion logic
func Convert_v1alpha1_OCIClaim_To_ignite_OCI¶
func Convert_v1alpha1_OCIClaim_To_ignite_OCI(in *OCIImageClaim, out *meta.OCIImageRef) error
func Convert_v1alpha1_OCIImageSource_To_ignite_OCIImageSource¶
func Convert_v1alpha1_OCIImageSource_To_ignite_OCIImageSource(in *OCIImageSource, out *ignite.OCIImageSource, s conversion.Scope) (err error)
Convert_v1alpha1_OCIImageSource_To_ignite_OCIImageSource calls the autogenerated conversion function along with custom conversion logic
func Convert_v1alpha1_VMImageSpec_To_ignite_VMImageSpec¶
func Convert_v1alpha1_VMImageSpec_To_ignite_VMImageSpec(in *VMImageSpec, out *ignite.VMImageSpec, s conversion.Scope) error
Convert_v1alpha1_VMImageSpec_To_ignite_VMImageSpec calls the autogenerated conversion function along with custom conversion logic
func Convert_v1alpha1_VMKernelSpec_To_ignite_VMKernelSpec¶
func Convert_v1alpha1_VMKernelSpec_To_ignite_VMKernelSpec(in *VMKernelSpec, out *ignite.VMKernelSpec, s conversion.Scope) error
Convert_v1alpha1_VMKernelSpec_To_ignite_VMKernelSpec calls the autogenerated conversion function along with custom conversion logic
func Convert_v1alpha1_VMNetworkSpec_To_ignite_VMNetworkSpec¶
func Convert_v1alpha1_VMNetworkSpec_To_ignite_VMNetworkSpec(in *VMNetworkSpec, out *ignite.VMNetworkSpec, s conversion.Scope) error
Convert_v1alpha1_VMNetworkSpec_To_ignite_VMNetworkSpec calls the autogenerated conversion function along with custom conversion logic
func Convert_v1alpha1_VMSpec_To_ignite_VMSpec¶
func Convert_v1alpha1_VMSpec_To_ignite_VMSpec(in *VMSpec, out *ignite.VMSpec, s conversion.Scope) error
Convert_ignite_VMSpec_To_v1alpha1_VMSpec calls the autogenerated conversion function along with custom conversion logic
func Convert_v1alpha1_VMStatus_To_ignite_VMStatus¶
func Convert_v1alpha1_VMStatus_To_ignite_VMStatus(in *VMStatus, out *ignite.VMStatus, s conversion.Scope) error
Convert_v1alpha1_VMStatus_To_ignite_VMStatus calls the autogenerated conversion function along with custom conversion logic
func SetDefaults_OCIImageClaim¶
func SetDefaults_OCIImageClaim(obj *OCIImageClaim)
func SetDefaults_PoolSpec¶
func SetDefaults_PoolSpec(obj *PoolSpec)
func SetDefaults_VMKernelSpec¶
func SetDefaults_VMKernelSpec(obj *VMKernelSpec)
func SetDefaults_VMNetworkSpec¶
func SetDefaults_VMNetworkSpec(obj *VMNetworkSpec)
func SetDefaults_VMSpec¶
func SetDefaults_VMSpec(obj *VMSpec)
func SetDefaults_VMStatus¶
func SetDefaults_VMStatus(obj *VMStatus)
type FileMapping¶
type FileMapping struct {
HostPath string `json:"hostPath"`
VMPath string `json:"vmPath"`
}
FileMapping defines mappings between files on the host and VM
type Image¶
type Image struct {
runtime.TypeMeta `json:",inline"`
// runtime.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID
// Name is available at the .metadata.name JSON path
// ID is available at the .metadata.uid JSON path (the Go type is k8s.io/apimachinery/pkg/types.UID, which is only a typed string)
runtime.ObjectMeta `json:"metadata"`
Spec ImageSpec `json:"spec"`
Status ImageStatus `json:"status"`
}
Image represents a cached OCI image ready to be used with Ignite +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ImageSourceType¶
type ImageSourceType string
ImageSourceType is an enum of different supported Image Source Types
const (
// ImageSourceTypeDocker defines that the image is imported from Docker
ImageSourceTypeDocker ImageSourceType = "Docker"
)
type ImageSpec¶
type ImageSpec struct {
OCIClaim OCIImageClaim `json:"ociClaim"`
}
ImageSpec declares what the image contains
type ImageStatus¶
type ImageStatus struct {
// OCISource contains the information about how this OCI image was imported
OCISource OCIImageSource `json:"ociSource"`
}
ImageStatus defines the status of the image
type Kernel¶
type Kernel struct {
runtime.TypeMeta `json:",inline"`
// runtime.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID
// Name is available at the .metadata.name JSON path
// ID is available at the .metadata.uid JSON path (the Go type is k8s.io/apimachinery/pkg/types.UID, which is only a typed string)
runtime.ObjectMeta `json:"metadata"`
Spec KernelSpec `json:"spec"`
Status KernelStatus `json:"status"`
}
Kernel is a serializable object that caches information about imported kernels This file is stored in /var/lib/firecracker/kernels/{oci-image-digest}/metadata.json +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type KernelSpec¶
type KernelSpec struct {
OCIClaim OCIImageClaim `json:"ociClaim"`
}
KernelSpec describes the properties of a kernel
type KernelStatus¶
type KernelStatus struct {
Version string `json:"version"`
OCISource OCIImageSource `json:"ociSource"`
}
KernelStatus describes the status of a kernel
type NetworkMode¶
type NetworkMode string
NetworkMode defines different states a VM can be in
const (
// NetworkModeCNI specifies the network mode where CNI is used
NetworkModeCNI NetworkMode = "cni"
// NetworkModeDockerBridge specifies the default docker bridge network is used
NetworkModeDockerBridge NetworkMode = "docker-bridge"
)
func (NetworkMode) String¶
func (nm NetworkMode) String() string
type OCIImageClaim¶
type OCIImageClaim struct {
// Type defines how the image should be imported
Type ImageSourceType `json:"type"`
// Ref defines the reference to use when talking to the backend.
// This is most commonly the image name, followed by a tag.
// Other supported ways are $registry/$user/$image@sha256:$digest
// This ref is also used as ObjectMeta.Name for kinds Images and Kernels
Ref meta.OCIImageRef `json:"ref"`
}
OCIImageClaim defines a claim for importing an OCI image
type OCIImageSource¶
type OCIImageSource struct {
// ID defines the source's ID (e.g. the Docker image ID)
ID string `json:"id"`
// Size defines the size of the source in bytes
Size meta.Size `json:"size"`
// RepoDigests defines the image name as it was when pulled
// from a repository, and the digest of the image
// The format is $registry/$user/$image@sha256:$digest
// This field is unpopulated if the image used as the source
// has never been pushed to or pulled from a registry
RepoDigests []string `json:"repoDigests,omitempty"`
}
OCIImageSource specifies how the OCI image was imported. It is the status variant of OCIImageClaim
type Pool¶
type Pool struct {
runtime.TypeMeta `json:",inline"`
Spec PoolSpec `json:"spec"`
Status PoolStatus `json:"status"`
}
Pool defines device mapper pool database This file is managed by the snapshotter part of Ignite, and the file (existing as a singleton) is present at /var/lib/firecracker/snapshotter/pool.json +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type PoolDevice¶
type PoolDevice struct {
Size meta.Size `json:"size"`
Parent meta.DMID `json:"parent"`
// Type specifies the type of the contents of the device
Type PoolDeviceType `json:"type"`
// MetadataPath points to the JSON/YAML file with metadata about this device
// This is most often of the format /var/lib/firecracker/{type}/{id}/metadata.json
MetadataPath string `json:"metadataPath"`
}
PoolDevice defines one device in the pool
type PoolDeviceType¶
type PoolDeviceType string
const (
PoolDeviceTypeImage PoolDeviceType = "Image"
PoolDeviceTypeResize PoolDeviceType = "Resize"
PoolDeviceTypeKernel PoolDeviceType = "Kernel"
PoolDeviceTypeVM PoolDeviceType = "VM"
)
type PoolSpec¶
type PoolSpec struct {
// MetadataSize specifies the size of the pool's metadata
MetadataSize meta.Size `json:"metadataSize"`
// DataSize specifies the size of the pool's data
DataSize meta.Size `json:"dataSize"`
// AllocationSize specifies the smallest size that can be allocated at a time
AllocationSize meta.Size `json:"allocationSize"`
// MetadataPath points to the file where device mapper stores all metadata information
// Defaults to constants.SNAPSHOTTER_METADATA_PATH
MetadataPath string `json:"metadataPath"`
// DataPath points to the backing physical device or sparse file (to be loop mounted) for the pool
// Defaults to constants.SNAPSHOTTER_DATA_PATH
DataPath string `json:"dataPath"`
}
PoolSpec defines the Pool’s specification
type PoolStatus¶
type PoolStatus struct {
// The Devices array needs to contain pointers to accommodate "holes" in the mapping
// Where devices have been deleted, the pointer is nil
Devices []*PoolDevice `json:"devices"`
}
PoolStatus defines the Pool’s current status
type SSH¶
type SSH struct {
Generate bool `json:"-"`
PublicKey string `json:"-"`
}
SSH specifies different ways to connect via SSH to the VM SSH uses a custom marshaller/unmarshaller. If generate is true, it marshals to true (a JSON bool). If PublicKey is set, it marshals to that string.
func (*SSH) MarshalJSON¶
func (s *SSH) MarshalJSON() ([]byte, error)
func (*SSH) UnmarshalJSON¶
func (s *SSH) UnmarshalJSON(b []byte) error
type VM¶
type VM struct {
runtime.TypeMeta `json:",inline"`
// runtime.ObjectMeta is also embedded into the struct, and defines the human-readable name, and the machine-readable ID
// Name is available at the .metadata.name JSON path
// ID is available at the .metadata.uid JSON path (the Go type is k8s.io/apimachinery/pkg/types.UID, which is only a typed string)
runtime.ObjectMeta `json:"metadata"`
Spec VMSpec `json:"spec"`
Status VMStatus `json:"status"`
}
VM represents a virtual machine run by Firecracker These files are stored in /var/lib/firecracker/vm/{vm-id}/metadata.json +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type VMImageSpec¶
type VMImageSpec struct {
OCIClaim OCIImageClaim `json:"ociClaim"`
}
type VMKernelSpec¶
type VMKernelSpec struct {
OCIClaim OCIImageClaim `json:"ociClaim"`
CmdLine string `json:"cmdLine,omitempty"`
}
type VMNetworkSpec¶
type VMNetworkSpec struct {
Mode NetworkMode `json:"mode"`
Ports meta.PortMappings `json:"ports,omitempty"`
}
type VMSpec¶
type VMSpec struct {
Image VMImageSpec `json:"image"`
Kernel VMKernelSpec `json:"kernel"`
CPUs uint64 `json:"cpus"`
Memory meta.Size `json:"memory"`
DiskSize meta.Size `json:"diskSize"`
Network VMNetworkSpec `json:"network"`
// This will be done at either "ignite start" or "ignite create" time
// TODO: We might revisit this later
CopyFiles []FileMapping `json:"copyFiles,omitempty"`
// SSH specifies how the SSH setup should be done
// nil here means "don't do anything special"
// If SSH.Generate is set, Ignite will generate a new SSH key and copy it in to authorized_keys in the VM
// Specifying a path in SSH.Generate means "use this public key"
// If SSH.PublicKey is set, this struct will marshal as a string using that path
// If SSH.Generate is set, this struct will marshal as a bool => true
SSH *SSH `json:"ssh,omitempty"`
}
VMSpec describes the configuration of a VM
type VMState¶
type VMState string
VMState defines different states a VM can be in
const (
VMStateCreated VMState = "Created"
VMStateRunning VMState = "Running"
VMStateStopped VMState = "Stopped"
)
type VMStatus¶
type VMStatus struct {
State VMState `json:"state"`
IPAddresses meta.IPAddresses `json:"ipAddresses,omitempty"`
Image OCIImageSource `json:"image"`
Kernel OCIImageSource `json:"kernel"`
}
VMStatus defines the status of a VM
Generated by godoc2md