api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Overview

Package v1alpha1 implements the v1alpha1 apiVersion of ctlptl's cluster configuration

Borrows the approach of clientcmd/api and KIND, maintaining an API similar to other Kubernetes APIs without pulling in the API machinery.

+k8s:deepcopy-gen=package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	TypeMeta `yaml:",inline"`

	// The cluster name. Pulled from .kube/config.
	Name string `json:"name,omitempty" yaml:"name,omitempty"`

	// The name of the tool used to create this cluster.
	Product string `json:"product,omitempty" yaml:"product,omitempty"`

	// Make sure that the cluster has access to at least this many
	// CPUs. This is mostly helpful for ensuring that your Docker Desktop
	// VM has enough CPU. If ctlptl can't guarantee this many
	// CPU, it will return an error.
	MinCPUs int `json:"minCPUs,omitempty" yaml:"minCPUs,omitempty"`

	// The name of a registry.
	//
	// If the registry doesn't exist, ctlptl will create one with this name.
	//
	// The registry can be configured by creating a `kind: Registry` config file.
	//
	// Not supported on all cluster products.
	Registry string `json:"registry,omitempty" yaml:"registry,omitempty"`

	// Most recently observed status of the cluster.
	// Populated by the system.
	// Read-only.
	Status ClusterStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

Cluster contains cluster configuration. +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*Cluster) DeepCopy

func (in *Cluster) DeepCopy() *Cluster

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

func (*Cluster) DeepCopyInto

func (in *Cluster) DeepCopyInto(out *Cluster)

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

func (*Cluster) DeepCopyObject

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

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

func (*Cluster) GetName

func (c *Cluster) GetName() string

func (*Cluster) GetObjectKind

func (obj *Cluster) GetObjectKind() schema.ObjectKind

func (*Cluster) GroupVersionKind

func (obj *Cluster) GroupVersionKind() schema.GroupVersionKind

func (*Cluster) SetGroupVersionKind

func (obj *Cluster) SetGroupVersionKind(gvk schema.GroupVersionKind)

type ClusterList

type ClusterList struct {
	TypeMeta `json:",inline"`

	// List of clusters.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md
	Items []Cluster `json:"items" protobuf:"bytes,2,rep,name=items"`
}

ClusterList is a list of Clusters. +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*ClusterList) DeepCopy

func (in *ClusterList) DeepCopy() *ClusterList

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

func (*ClusterList) DeepCopyInto

func (in *ClusterList) DeepCopyInto(out *ClusterList)

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

func (*ClusterList) DeepCopyObject

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

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

func (*ClusterList) GetObjectKind

func (obj *ClusterList) GetObjectKind() schema.ObjectKind

func (*ClusterList) GroupVersionKind

func (obj *ClusterList) GroupVersionKind() schema.GroupVersionKind

func (*ClusterList) SetGroupVersionKind

func (obj *ClusterList) SetGroupVersionKind(gvk schema.GroupVersionKind)

type ClusterStatus

type ClusterStatus struct {
	// When the cluster was first created.
	CreationTimestamp metav1.Time `json:"creationTimestamp,omitempty" yaml:"creationTimestamp,omitempty"`

	// Local registry status documented on the cluster itself.
	LocalRegistryHosting *localregistry.LocalRegistryHostingV1 `json:"localRegistryHosting,omitempty" yaml:"localRegistryHosting,omitempty"`

	// The number of CPU. Only applicable to local clusters.
	CPUs int `json:"cpus,omitempty" yaml:"cpus,omitempty"`
}

func (*ClusterStatus) DeepCopy

func (in *ClusterStatus) DeepCopy() *ClusterStatus

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

func (*ClusterStatus) DeepCopyInto

func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus)

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

type Registry

type Registry struct {
	TypeMeta `yaml:",inline"`

	// The registry name. Get/set from the Docker container name.
	Name string `json:"name,omitempty" yaml:"name,omitempty"`

	// The desired host port. Set to 0 to choose a random port.
	Port int `json:"port,omitempty" yaml:"port,omitempty"`

	// Most recently observed status of the registry.
	// Populated by the system.
	// Read-only.
	Status RegistryStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

Cluster contains registry configuration.

Currently designed for local registries on the host machine, but may eventually expand to support remote registries.

+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*Registry) DeepCopy

func (in *Registry) DeepCopy() *Registry

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

func (*Registry) DeepCopyInto

func (in *Registry) DeepCopyInto(out *Registry)

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

func (*Registry) DeepCopyObject

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

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

func (*Registry) GetName

func (r *Registry) GetName() string

func (*Registry) GetObjectKind

func (obj *Registry) GetObjectKind() schema.ObjectKind

func (*Registry) GroupVersionKind

func (obj *Registry) GroupVersionKind() schema.GroupVersionKind

func (*Registry) SetGroupVersionKind

func (obj *Registry) SetGroupVersionKind(gvk schema.GroupVersionKind)

type RegistryList

type RegistryList struct {
	TypeMeta `json:",inline"`

	// List of registrys.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md
	Items []Registry `json:"items" protobuf:"bytes,2,rep,name=items"`
}

RegistryList is a list of Registrys. +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*RegistryList) DeepCopy

func (in *RegistryList) DeepCopy() *RegistryList

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

func (*RegistryList) DeepCopyInto

func (in *RegistryList) DeepCopyInto(out *RegistryList)

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

func (*RegistryList) DeepCopyObject

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

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

func (*RegistryList) GetObjectKind

func (obj *RegistryList) GetObjectKind() schema.ObjectKind

func (*RegistryList) GroupVersionKind

func (obj *RegistryList) GroupVersionKind() schema.GroupVersionKind

func (*RegistryList) SetGroupVersionKind

func (obj *RegistryList) SetGroupVersionKind(gvk schema.GroupVersionKind)

type RegistryStatus

type RegistryStatus struct {
	// When the registry was first created.
	CreationTimestamp metav1.Time `json:"creationTimestamp,omitempty" yaml:"creationTimestamp,omitempty"`

	// The IPv4 address for the bridge network.
	IPAddress string `json:"ipAddress,omitempty" yaml:"ipAddress,omitempty"`

	// The public port that the registry is listening on on the host machine.
	HostPort int `json:"hostPort,omitempty" yaml:"hostPort,omitempty"`

	// The private port that the registry is listening on inside the registry network.
	//
	// We try to make this not configurable, because there's no real reason not
	// to use the default registry port 5000.
	ContainerPort int `json:"containerPort,omitempty" yaml:containerPort,omitempty"`

	// Networks that the registry container is connected to.
	Networks []string `json:"networks,omitempty" yaml:"networks,omitempty"`

	// The ID of the container in Docker.
	ContainerID string `json:"containerId,omitempty" yaml:"containerId,omitempty"`
}

func (*RegistryStatus) DeepCopy

func (in *RegistryStatus) DeepCopy() *RegistryStatus

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

func (*RegistryStatus) DeepCopyInto

func (in *RegistryStatus) DeepCopyInto(out *RegistryStatus)

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

type TypeMeta

type TypeMeta struct {
	Kind       string `json:"kind,omitempty" yaml:"kind,omitempty"`
	APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"`
}

TypeMeta partially copies apimachinery/pkg/apis/meta/v1.TypeMeta No need for a direct dependence; the fields are stable.

func (*TypeMeta) DeepCopy

func (in *TypeMeta) DeepCopy() *TypeMeta

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

func (*TypeMeta) DeepCopyInto

func (in *TypeMeta) DeepCopyInto(out *TypeMeta)

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