Skip to content

v1alpha4

import "github.com/weaveworks/ignite/pkg/apis/ignite/v1alpha4"

Overview

+k8s:deepcopy-gen=package +k8s:defaulter-gen=TypeMeta +k8s:openapi-gen=true +k8s:conversion-gen=github.com/weaveworks/ignite/pkg/apis/ignite

Index

Package files

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: "v1alpha4",
}

SchemeGroupVersion is group version used to register these objects

func SetDefaults_ConfigurationSpec

func SetDefaults_ConfigurationSpec(obj *ConfigurationSpec)

func SetDefaults_PoolSpec

func SetDefaults_PoolSpec(obj *PoolSpec)

func SetDefaults_VMKernelSpec

func SetDefaults_VMKernelSpec(obj *VMKernelSpec)

func SetDefaults_VMSandboxSpec

func SetDefaults_VMSandboxSpec(obj *VMSandboxSpec)

func SetDefaults_VMSpec

func SetDefaults_VMSpec(obj *VMSpec)

func SetDefaults_VMStatus

func SetDefaults_VMStatus(obj *VMStatus)

type BlockDeviceVolume

type BlockDeviceVolume struct {
    Path string `json:"path"`
}

BlockDeviceVolume defines a block device on the host

type Configuration

type Configuration struct {
    runtime.TypeMeta   `json:",inline"`
    runtime.ObjectMeta `json:"metadata"`

    Spec ConfigurationSpec `json:"spec"`
}

Configuration represents the ignite runtime configuration. +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type ConfigurationSpec

type ConfigurationSpec struct {
    Runtime           igniteRuntime.Name       `json:"runtime,omitempty"`
    NetworkPlugin     igniteNetwork.PluginName `json:"networkPlugin,omitempty"`
    VMDefaults        VMSpec                   `json:"vmDefaults,omitempty"`
    IDPrefix          string                   `json:"idPrefix,omitempty"`
    RegistryConfigDir string                   `json:"registryConfigDir,omitempty"`
}

ConfigurationSpec defines the ignite configuration.

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 ImageSpec

type ImageSpec struct {
    OCI meta.OCIImageRef `json:"oci"`
}

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 {
    OCI meta.OCIImageRef `json:"oci"`
}

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 Network

type Network struct {
    Plugin      igniteNetwork.PluginName `json:"plugin"`
    IPAddresses meta.IPAddresses         `json:"ipAddresses"`
}

Network specifies the VM’s network information.

type OCIImageSource

type OCIImageSource struct {
    // ID defines the source's content ID (e.g. the canonical OCI path or Docker image ID)
    ID *meta.OCIContentID `json:"id"`
    // Size defines the size of the source in bytes
    Size meta.Size `json:"size"`
}

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 Runtime

type Runtime struct {
    ID   string             `json:"id"`
    Name igniteRuntime.Name `json:"name"`
}

Runtime specifies the VM’s runtime information

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 {
    OCI meta.OCIImageRef `json:"oci"`
}

type VMKernelSpec

type VMKernelSpec struct {
    OCI     meta.OCIImageRef `json:"oci"`
    CmdLine string           `json:"cmdLine,omitempty"`
}

type VMNetworkSpec

type VMNetworkSpec struct {
    Ports meta.PortMappings `json:"ports,omitempty"`
}

type VMSandboxSpec

type VMSandboxSpec struct {
    OCI meta.OCIImageRef `json:"oci"`
}

VMSandboxSpec is the spec of the sandbox used for the VM.

type VMSpec

type VMSpec struct {
    Image    VMImageSpec   `json:"image"`
    Sandbox  VMSandboxSpec `json:"sandbox"`
    Kernel   VMKernelSpec  `json:"kernel"`
    CPUs     uint64        `json:"cpus"`
    Memory   meta.Size     `json:"memory"`
    DiskSize meta.Size     `json:"diskSize"`
    // TODO: Implement working omitempty without pointers for the following entries
    // Currently both will show in the JSON output as empty arrays. Making them
    // pointers requires plenty of nil checks (as their contents are accessed directly)
    // and is very risky for stability. APIMachinery potentially has a solution.
    Network VMNetworkSpec `json:"network,omitempty"`
    Storage VMStorageSpec `json:"storage,omitempty"`
    // 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 VMStatus

type VMStatus struct {
    Running   bool           `json:"running"`
    Runtime   *Runtime       `json:"runtime,omitempty"`
    StartTime *runtime.Time  `json:"startTime,omitempty"`
    Network   *Network       `json:"network,omitempty"`
    Image     OCIImageSource `json:"image"`
    Kernel    OCIImageSource `json:"kernel"`
    IDPrefix  string         `json:"idPrefix"`
}

VMStatus defines the status of a VM

type VMStorageSpec

type VMStorageSpec struct {
    Volumes      []Volume      `json:"volumes,omitempty"`
    VolumeMounts []VolumeMount `json:"volumeMounts,omitempty"`
}

VMStorageSpec defines the VM’s Volumes and VolumeMounts

type Volume

type Volume struct {
    Name        string             `json:"name"`
    BlockDevice *BlockDeviceVolume `json:"blockDevice,omitempty"`
}

Volume defines named storage volume

type VolumeMount

type VolumeMount struct {
    Name      string `json:"name"`
    MountPath string `json:"mountPath"`
}

VolumeMount defines the mount point for a named volume inside a VM


Generated by godoc2md