cluster

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const AnnotationPrefix = "archon.kubeup.com/"
View Source
const InitializerKey = "initializers"

Variables

This section is empty.

Functions

func InstanceStatusEqual

func InstanceStatusEqual(l, r InstanceStatus) bool

func IsInstanceAvailable

func IsInstanceAvailable(instance *Instance, minReadySeconds int32, now unversioned.Time) bool

IsInstanceAvailable returns true if a instance is available; false otherwise. Precondition for an available instance is that it must be ready. On top of that, there are two cases when a instance can be considered available: 1. minReadySeconds == 0, or 2. LastTransitionTime (is set) + minReadySeconds < current time

func IsInstanceReady

func IsInstanceReady(instance *Instance) bool

IsInstanceReady returns true if a instance is ready; false otherwise.

func IsInstanceReadyConditionTrue

func IsInstanceReadyConditionTrue(status InstanceStatus) bool

IsInstanceReady retruns true if a instance is ready; false otherwise.

Types

type ConfigSpec

type ConfigSpec struct {
	Name string            `json:"name,omitempty"`
	Data map[string]string `json:"data,omitempty"`
}

func (*ConfigSpec) CodecDecodeSelf

func (x *ConfigSpec) CodecDecodeSelf(d *codec1978.Decoder)

func (*ConfigSpec) CodecEncodeSelf

func (x *ConfigSpec) CodecEncodeSelf(e *codec1978.Encoder)

type FileSpec

type FileSpec struct {
	Name               string `json:"name,omitempty" yaml:"name,omitempty"`
	Encoding           string `` /* 128-byte string literal not displayed */
	Content            string `json:"content,omitempty" yaml:"content,omitempty"`
	Template           string `json:"template,omitempty" yaml:"template,omitempty"`
	Owner              string `json:"owner,omitempty" yaml:"owner,omitempty"`
	Path               string `json:"path,omitempty" yaml:"path,omitempty"`
	RawFilePermissions string `json:"permissions,omitempty" yaml:"permissions,omitempty" valid:"^0?[0-7]{3,4}$"`
}

func (*FileSpec) CodecDecodeSelf

func (x *FileSpec) CodecDecodeSelf(d *codec1978.Decoder)

func (*FileSpec) CodecEncodeSelf

func (x *FileSpec) CodecEncodeSelf(e *codec1978.Encoder)

type Instance

type Instance struct {
	unversioned.TypeMeta `json:",inline"`
	api.ObjectMeta       `json:"metadata"`
	Spec                 InstanceSpec       `json:"spec,omitempty"`
	Status               InstanceStatus     `json:"status,omitempty"`
	Dependency           InstanceDependency `json:"-"`
}

func (*Instance) CodecDecodeSelf

func (x *Instance) CodecDecodeSelf(d *codec1978.Decoder)

func (*Instance) CodecEncodeSelf

func (x *Instance) CodecEncodeSelf(e *codec1978.Encoder)

func (*Instance) GetInitializers

func (i *Instance) GetInitializers() []string

Just a substitute when native initializer/finalizer for tpr is not ready

func (Instance) GetObjectKind

func (i Instance) GetObjectKind() unversioned.ObjectKind

func (Instance) GetObjectMeta

func (i Instance) GetObjectMeta() meta.Object

func (*Instance) SetInitializers

func (i *Instance) SetInitializers(is []string)

type InstanceCondition

type InstanceCondition struct {
	Type   InstanceConditionType `json:"type"`
	Status api.ConditionStatus   `json:"status"`
	// +optional
	LastProbeTime unversioned.Time `json:"lastProbeTime,omitempty"`
	// +optional
	LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty"`
	// +optional
	Reason string `json:"reason,omitempty"`
	// +optional
	Message string `json:"message,omitempty"`
}

func GetInstanceCondition

func GetInstanceCondition(status *InstanceStatus, conditionType InstanceConditionType) (int, *InstanceCondition)

GetInstanceCondition extracts the provided condition from the given status and returns that. Returns nil and -1 if the condition is not present, and the index of the located condition.

func GetInstanceReadyCondition

func GetInstanceReadyCondition(status InstanceStatus) *InstanceCondition

Extracts the instance ready condition from the given status and returns that. Returns nil if the condition is not present.

func (*InstanceCondition) CodecDecodeSelf

func (x *InstanceCondition) CodecDecodeSelf(d *codec1978.Decoder)

func (*InstanceCondition) CodecEncodeSelf

func (x *InstanceCondition) CodecEncodeSelf(e *codec1978.Encoder)

type InstanceConditionType

type InstanceConditionType string
const (
	// InstanceScheduled represents status of the scheduling process for this instance.
	InstanceScheduled InstanceConditionType = "InstanceScheduled"
	// InstanceReady means the instance is able to service requests and should be added to the
	// load balancing pools of all matching services.
	InstanceReady InstanceConditionType = "Ready"
	// InstanceInitialized means that all init containers in the instance have started successfully.
	InstanceInitialized InstanceConditionType = "Initialized"
	// InstanceReasonUnschedulable reason in InstanceScheduled InstanceCondition means that the scheduler
	// can't schedule the instance right now, for example due to insufficient resources in the cluster.
	InstanceReasonUnschedulable = "Unschedulable"
)

These are valid conditions of instance.

func (*InstanceConditionType) CodecDecodeSelf

func (x *InstanceConditionType) CodecDecodeSelf(d *codec1978.Decoder)

func (InstanceConditionType) CodecEncodeSelf

func (x InstanceConditionType) CodecEncodeSelf(e *codec1978.Encoder)

type InstanceDependency

type InstanceDependency struct {
	Network Network      `json:"network,omitempty"`
	Secrets []api.Secret `json:"secrets,omitempty"`
	Users   []User       `json:"users,omitempty"`
}

func (*InstanceDependency) CodecDecodeSelf

func (x *InstanceDependency) CodecDecodeSelf(d *codec1978.Decoder)

func (*InstanceDependency) CodecEncodeSelf

func (x *InstanceDependency) CodecEncodeSelf(e *codec1978.Encoder)

type InstanceGroup

type InstanceGroup struct {
	unversioned.TypeMeta `json:",inline"`
	api.ObjectMeta       `json:"metadata"`
	Spec                 InstanceGroupSpec   `json:"spec,omitempty"`
	Status               InstanceGroupStatus `json:"status,omitempty"`
}

func (*InstanceGroup) CodecDecodeSelf

func (x *InstanceGroup) CodecDecodeSelf(d *codec1978.Decoder)

func (*InstanceGroup) CodecEncodeSelf

func (x *InstanceGroup) CodecEncodeSelf(e *codec1978.Encoder)

func (InstanceGroup) GetObjectKind

func (i InstanceGroup) GetObjectKind() unversioned.ObjectKind

func (InstanceGroup) GetObjectMeta

func (i InstanceGroup) GetObjectMeta() meta.Object

type InstanceGroupCondition

type InstanceGroupCondition struct {
	// Type of replica set condition.
	Type InstanceGroupConditionType `json:"type"`
	// Status of the condition, one of True, False, Unknown.
	Status api.ConditionStatus `json:"status"`
	// The last time the condition transitioned from one status to another.
	// +optional
	LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty"`
	// The reason for the condition's last transition.
	// +optional
	Reason string `json:"reason,omitempty"`
	// A human readable message indicating details about the transition.
	// +optional
	Message string `json:"message,omitempty"`
}

InstanceGroupCondition describes the state of a replica set at a certain point.

func (*InstanceGroupCondition) CodecDecodeSelf

func (x *InstanceGroupCondition) CodecDecodeSelf(d *codec1978.Decoder)

func (*InstanceGroupCondition) CodecEncodeSelf

func (x *InstanceGroupCondition) CodecEncodeSelf(e *codec1978.Encoder)

type InstanceGroupConditionType

type InstanceGroupConditionType string
const (
	// InstanceGroupReplicaFailure is added in a replica set when one of its instances fails to be created
	// due to insufficient quota, limit ranges, instance security policy, node selectors, etc. or deleted
	// due to kubelet being down or finalizers are failing.
	InstanceGroupReplicaFailure InstanceGroupConditionType = "ReplicaFailure"
)

These are valid conditions of a replica set.

func (*InstanceGroupConditionType) CodecDecodeSelf

func (x *InstanceGroupConditionType) CodecDecodeSelf(d *codec1978.Decoder)

func (InstanceGroupConditionType) CodecEncodeSelf

func (x InstanceGroupConditionType) CodecEncodeSelf(e *codec1978.Encoder)

type InstanceGroupList

type InstanceGroupList struct {
	unversioned.TypeMeta `json:",inline"`
	unversioned.ListMeta `json:"metadata"`

	Items []*InstanceGroup `json:"items"`
}

func (*InstanceGroupList) CodecDecodeSelf

func (x *InstanceGroupList) CodecDecodeSelf(d *codec1978.Decoder)

func (*InstanceGroupList) CodecEncodeSelf

func (x *InstanceGroupList) CodecEncodeSelf(e *codec1978.Encoder)

func (InstanceGroupList) GetObjectKind

func (il InstanceGroupList) GetObjectKind() unversioned.ObjectKind

func (InstanceGroupList) GetObjectMeta

func (il InstanceGroupList) GetObjectMeta() unversioned.List

type InstanceGroupSpec

type InstanceGroupSpec struct {
	Replicas int32 `json:"replicas,omitempty"`

	// Minimum number of seconds for which a newly created instance should be ready
	// without any of its container crashing, for it to be considered available.
	// Defaults to 0 (instance will be considered available as soon as it is ready)
	// +optional
	MinReadySeconds int32                      `json:"minReadySeconds,omitempty"`
	Selector        *unversioned.LabelSelector `json:"selector,omitempty"`
	Template        InstanceTemplateSpec       `json:"template,omitempty"`
}

func (*InstanceGroupSpec) CodecDecodeSelf

func (x *InstanceGroupSpec) CodecDecodeSelf(d *codec1978.Decoder)

func (*InstanceGroupSpec) CodecEncodeSelf

func (x *InstanceGroupSpec) CodecEncodeSelf(e *codec1978.Encoder)

type InstanceGroupStatus

type InstanceGroupStatus struct {
	// Replicas is the number of actual replicas.
	Replicas int32 `json:"replicas"`

	// The number of instances that have labels matching the labels of the instance template of the instancegroup.
	// +optional
	FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty"`

	// The number of ready replicas for this replica set.
	// +optional
	ReadyReplicas int32 `json:"readyReplicas,omitempty"`

	// The number of available replicas (ready for at least minReadySeconds) for this replica set.
	// +optional
	AvailableReplicas int32 `json:"availableReplicas,omitempty"`

	// ObservedGeneration is the most recent generation observed by the controller.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	Conditions []InstanceGroupCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}

func (*InstanceGroupStatus) CodecDecodeSelf

func (x *InstanceGroupStatus) CodecDecodeSelf(d *codec1978.Decoder)

func (*InstanceGroupStatus) CodecEncodeSelf

func (x *InstanceGroupStatus) CodecEncodeSelf(e *codec1978.Encoder)

type InstanceList

type InstanceList struct {
	unversioned.TypeMeta `json:",inline"`
	unversioned.ListMeta `json:"metadata"`

	Items []*Instance `json:"items"`
}

func (*InstanceList) CodecDecodeSelf

func (x *InstanceList) CodecDecodeSelf(d *codec1978.Decoder)

func (*InstanceList) CodecEncodeSelf

func (x *InstanceList) CodecEncodeSelf(e *codec1978.Encoder)

func (InstanceList) GetObjectKind

func (il InstanceList) GetObjectKind() unversioned.ObjectKind

func (InstanceList) GetObjectMeta

func (il InstanceList) GetObjectMeta() unversioned.List

type InstanceOptions

type InstanceOptions struct {
	UsePrivateIP string `k8s:"use-private-ip"`
}

func (*InstanceOptions) CodecDecodeSelf

func (x *InstanceOptions) CodecDecodeSelf(d *codec1978.Decoder)

func (*InstanceOptions) CodecEncodeSelf

func (x *InstanceOptions) CodecEncodeSelf(e *codec1978.Encoder)

type InstancePhase

type InstancePhase string
const (
	InstancePending      InstancePhase = ""
	InstanceInitializing InstancePhase = "Initializing"
	InstanceRunning      InstancePhase = "Running"
	InstanceFailed       InstancePhase = "Failed"
	InstanceUnknown      InstancePhase = "Unknown"
)

func (*InstancePhase) CodecDecodeSelf

func (x *InstancePhase) CodecDecodeSelf(d *codec1978.Decoder)

func (InstancePhase) CodecEncodeSelf

func (x InstancePhase) CodecEncodeSelf(e *codec1978.Encoder)

type InstanceSpec

type InstanceSpec struct {
	OS           string                 `json:"os,omitempty"`
	Image        string                 `json:"image,omitempty"`
	InstanceType string                 `json:"instanceType,omitempty"`
	NetworkName  string                 `json:"networkName,omitempty"`
	Files        []FileSpec             `json:"files,omitempty"`
	Secrets      []LocalObjectReference `json:"secrets,omitempty"`
	Configs      []ConfigSpec           `json:"configs,omitempty"`
	Users        []LocalObjectReference `json:"users,omitempty"`
	Hostname     string                 `json:"hostname,omitempty"`
}

func (*InstanceSpec) CodecDecodeSelf

func (x *InstanceSpec) CodecDecodeSelf(d *codec1978.Decoder)

func (*InstanceSpec) CodecEncodeSelf

func (x *InstanceSpec) CodecEncodeSelf(e *codec1978.Encoder)

type InstanceStatus

type InstanceStatus struct {
	Phase      InstancePhase       `json:"phase,omitempty"`
	Conditions []InstanceCondition `json:"conditions,omitempty"`
	// TODO: allow multiple ips
	PrivateIP         string           `json:"privateIP,omitempty"`
	PublicIP          string           `json:"publicIP,omitempty"`
	InstanceID        string           `json:"instanceID,omitempty"`
	CreationTimestamp unversioned.Time `json:"creationTimestamp,omitempty" protobuf:"bytes,8,opt,name=creationTimestamp"`
}

func InstanceStatusDeepCopy

func InstanceStatusDeepCopy(s *InstanceStatus) *InstanceStatus

func (*InstanceStatus) CodecDecodeSelf

func (x *InstanceStatus) CodecDecodeSelf(d *codec1978.Decoder)

func (*InstanceStatus) CodecEncodeSelf

func (x *InstanceStatus) CodecEncodeSelf(e *codec1978.Encoder)

type InstanceTemplateSpec

type InstanceTemplateSpec struct {
	api.ObjectMeta `json:"metadata"`
	Spec           InstanceSpec `json:"spec,omitempty"`
	Secrets        []api.Secret `json:"secrets,omitempty"`
}

func (*InstanceTemplateSpec) CodecDecodeSelf

func (x *InstanceTemplateSpec) CodecDecodeSelf(d *codec1978.Decoder)

func (*InstanceTemplateSpec) CodecEncodeSelf

func (x *InstanceTemplateSpec) CodecEncodeSelf(e *codec1978.Encoder)

type LocalObjectReference

type LocalObjectReference struct {
	//TODO: Add other useful fields.  apiVersion, kind, uid?
	Name string `json:"name,omitempty"`
}

LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.

func (*LocalObjectReference) CodecDecodeSelf

func (x *LocalObjectReference) CodecDecodeSelf(d *codec1978.Decoder)

func (*LocalObjectReference) CodecEncodeSelf

func (x *LocalObjectReference) CodecEncodeSelf(e *codec1978.Encoder)

type Network

type Network struct {
	unversioned.TypeMeta `json:",inline"`
	api.ObjectMeta       `json:"metadata"`
	Spec                 NetworkSpec   `json:"spec,omitempty"`
	Status               NetworkStatus `json:"status,omitempty"`
}

func (*Network) CodecDecodeSelf

func (x *Network) CodecDecodeSelf(d *codec1978.Decoder)

func (*Network) CodecEncodeSelf

func (x *Network) CodecEncodeSelf(e *codec1978.Encoder)

func (Network) GetObjectKind

func (i Network) GetObjectKind() unversioned.ObjectKind

func (Network) GetObjectMeta

func (i Network) GetObjectMeta() meta.Object

type NetworkList

type NetworkList struct {
	unversioned.TypeMeta `json:",inline"`
	unversioned.ListMeta `json:"metadata"`

	Items []*Network `json:"items"`
}

func (*NetworkList) CodecDecodeSelf

func (x *NetworkList) CodecDecodeSelf(d *codec1978.Decoder)

func (*NetworkList) CodecEncodeSelf

func (x *NetworkList) CodecEncodeSelf(e *codec1978.Encoder)

func (NetworkList) GetObjectKind

func (il NetworkList) GetObjectKind() unversioned.ObjectKind

func (NetworkList) GetObjectMeta

func (il NetworkList) GetObjectMeta() unversioned.List

type NetworkPhase

type NetworkPhase string
const (
	NetworkPending NetworkPhase = "Pending"
	NetworkRunning NetworkPhase = "Running"
	NetworkFailed  NetworkPhase = "Failed"
	NetworkUnknown NetworkPhase = "Unknown"
)

func (*NetworkPhase) CodecDecodeSelf

func (x *NetworkPhase) CodecDecodeSelf(d *codec1978.Decoder)

func (NetworkPhase) CodecEncodeSelf

func (x NetworkPhase) CodecEncodeSelf(e *codec1978.Encoder)

type NetworkSpec

type NetworkSpec struct {
	Region string `k8s:"region" json:"region,omitempty"`
	Zone   string `k8s:"zone" json:"zone,omitempty"`
	Subnet string `k8s:"subnet" json:"subnet,omitempty"`
}

func (*NetworkSpec) CodecDecodeSelf

func (x *NetworkSpec) CodecDecodeSelf(d *codec1978.Decoder)

func (*NetworkSpec) CodecEncodeSelf

func (x *NetworkSpec) CodecEncodeSelf(e *codec1978.Encoder)

type NetworkStatus

type NetworkStatus struct {
	Phase NetworkPhase `json:"phase,omitempty"`
}

func NetworkStatusDeepCopy

func NetworkStatusDeepCopy(s *NetworkStatus) *NetworkStatus

func (*NetworkStatus) CodecDecodeSelf

func (x *NetworkStatus) CodecDecodeSelf(d *codec1978.Decoder)

func (*NetworkStatus) CodecEncodeSelf

func (x *NetworkStatus) CodecEncodeSelf(e *codec1978.Encoder)

type User

type User struct {
	unversioned.TypeMeta `json:",inline"`
	api.ObjectMeta       `json:"metadata"`
	Spec                 UserSpec `json:"spec"`
}

func (*User) CodecDecodeSelf

func (x *User) CodecDecodeSelf(d *codec1978.Decoder)

func (*User) CodecEncodeSelf

func (x *User) CodecEncodeSelf(e *codec1978.Encoder)

func (User) GetObjectKind

func (i User) GetObjectKind() unversioned.ObjectKind

func (User) GetObjectMeta

func (i User) GetObjectMeta() meta.Object

type UserList

type UserList struct {
	unversioned.TypeMeta `json:",inline"`
	unversioned.ListMeta `json:"metadata"`

	Items []*User `json:"items"`
}

func (*UserList) CodecDecodeSelf

func (x *UserList) CodecDecodeSelf(d *codec1978.Decoder)

func (*UserList) CodecEncodeSelf

func (x *UserList) CodecEncodeSelf(e *codec1978.Encoder)

func (UserList) GetObjectKind

func (il UserList) GetObjectKind() unversioned.ObjectKind

func (UserList) GetObjectMeta

func (il UserList) GetObjectMeta() unversioned.List

type UserSpec

type UserSpec struct {
	Name              string   `json:"name,omitempty"`
	PasswordHash      string   `json:"passwordHash,omitempty"`
	SSHAuthorizedKeys []string `json:"sshAuthorizedKeys,omitempty"`
}

func (*UserSpec) CodecDecodeSelf

func (x *UserSpec) CodecDecodeSelf(d *codec1978.Decoder)

func (*UserSpec) CodecEncodeSelf

func (x *UserSpec) CodecEncodeSelf(e *codec1978.Encoder)

Jump to

Keyboard shortcuts

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