v1alpha1

package
v0.0.0-...-2a28ce9 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

+k8s:deepcopy-gen=package +groupName=zookeeper.database.apache.com

Index

Constants

View Source
const (
	ZookeeperClusterResourceKind   = "ZookeeperCluster"
	ZookeeperClusterResourcePlural = "zookeeperclusters"
)
View Source
const (
	ClusterPhaseNone     ClusterPhase = ""
	ClusterPhaseCreating              = "Creating"
	ClusterPhaseRunning               = "Running"
	ClusterPhaseFailed                = "Failed"

	// See ./doc/user/conditions_and_events.md
	ClusterConditionAvailable  ClusterConditionType = "Available"
	ClusterConditionRecovering                      = "Recovering"
	ClusterConditionScaling                         = "Scaling"
	ClusterConditionUpgrading                       = "Upgrading"
)
View Source
const (
	DefaultZookeeperVersion = "3.5.3-beta"
)

Variables

View Source
var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme

	SchemeGroupVersion      = schema.GroupVersion{Group: groupName, Version: "v1alpha1"}
	ZookeeperClusterCRDName = ZookeeperClusterResourcePlural + "." + groupName
)

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource gets an ZookeeperCluster GroupResource for a specified resource

Types

type ClusterCondition

type ClusterCondition struct {
	// Type of cluster condition.
	Type ClusterConditionType `json:"type"`
	// Status of the condition, one of True, False, Unknown.
	Status v1.ConditionStatus `json:"status"`
	// The last time this condition was updated.
	LastUpdateTime string `json:"lastUpdateTime,omitempty"`
	// Last time the condition transitioned from one status to another.
	LastTransitionTime string `json:"lastTransitionTime,omitempty"`
	// The reason for the condition's last transition.
	Reason string `json:"reason,omitempty"`
	// A human readable message indicating details about the transition.
	Message string `json:"message,omitempty"`
}

ClusterCondition represents one current condition of an zookeeper cluster. A condition might not show up if it is not happening. For example, if a cluster is not upgrading, the Upgrading condition would not show up. If a cluster is upgrading and encountered a problem that prevents the upgrade, the Upgrading condition's status will would be False and communicate the problem back.

type ClusterConditionType

type ClusterConditionType string

type ClusterPhase

type ClusterPhase string

type ClusterSpec

type ClusterSpec struct {
	// Size is the expected size of the zookeeper cluster.
	// The zookeeper-operator will eventually make the size of the running
	// cluster equal to the expected size.
	// The valid range of the size is from 1 to infinite
	Size int `json:"size"`
	// Repository is the name of the repository that hosts
	// zookeeper container images. It should be direct clone of the repository in official
	// release:
	//   https://hub.docker.com/_/zookeeper/
	// That means, it should have exact same tags and the same meaning for the tags.
	//
	// By default, it is `zookeeper`.
	Repository string `json:"repository,omitempty"`

	// Version is the expected version of the zookeeper cluster.
	// The zookeeper-operator will eventually make the zookeeper cluster version
	// equal to the expected version.
	//
	// The version must follow the [semver]( http://semver.org) format, for example "3.5.3-beta".
	// Only zookeeper released versions are supported: https://hub.docker.com/blafrisch/zookeeper/
	//
	// If version is not set, default is "3.5.3-beta".
	Version string `json:"version,omitempty"`

	// Paused is to pause the control of the operator for the zookeeper cluster.
	Paused bool `json:"paused,omitempty"`

	// Pod defines the policy to create pod for the zookeeper pod.
	//
	// Updating Pod does not take effect on any existing zookeeper pods.
	Pod *PodPolicy `json:"pod,omitempty"`

	// zookeeper JVM policy
	JVM *JVMPolicy `json:"jvm,omitempty"`
}

func (*ClusterSpec) Validate

func (c *ClusterSpec) Validate() error

TODO: move this to initializer

type ClusterStatus

type ClusterStatus struct {
	// Phase is the cluster running phase
	Phase  ClusterPhase `json:"phase"`
	Reason string       `json:"reason,omitempty"`

	// ControlPaused indicates the operator pauses the control of the cluster.
	ControlPaused bool `json:"controlPaused,omitempty"`

	// Condition keeps track of all cluster conditions, if they exist.
	Conditions []ClusterCondition `json:"conditions,omitempty"`

	// Size is the current size of the cluster
	Size int `json:"size"`

	// ServiceName is the LB service for accessing zookeeper nodes.
	ServiceName string `json:"serviceName,omitempty"`

	// ClientPort is the port for zookeeper client to access.
	// It's the same on client LB service and zookeeper nodes.
	ClientPort int `json:"clientPort,omitempty"`

	// Members are the zookeeper members in the cluster
	Members MembersStatus `json:"members"`
	// CurrentVersion is the current cluster version
	CurrentVersion string `json:"currentVersion"`
	// TargetVersion is the version the cluster upgrading to.
	// If the cluster is not upgrading, TargetVersion is empty.
	TargetVersion string `json:"targetVersion"`
}

func (*ClusterStatus) ClearCondition

func (cs *ClusterStatus) ClearCondition(t ClusterConditionType)

func (*ClusterStatus) Control

func (cs *ClusterStatus) Control()

func (*ClusterStatus) IsFailed

func (cs *ClusterStatus) IsFailed() bool

func (*ClusterStatus) PauseControl

func (cs *ClusterStatus) PauseControl()

func (*ClusterStatus) SetPhase

func (cs *ClusterStatus) SetPhase(p ClusterPhase)

func (*ClusterStatus) SetReadyCondition

func (cs *ClusterStatus) SetReadyCondition()

func (*ClusterStatus) SetReason

func (cs *ClusterStatus) SetReason(r string)

func (*ClusterStatus) SetRecoveringCondition

func (cs *ClusterStatus) SetRecoveringCondition()

func (*ClusterStatus) SetScalingDownCondition

func (cs *ClusterStatus) SetScalingDownCondition(from, to int)

func (*ClusterStatus) SetScalingUpCondition

func (cs *ClusterStatus) SetScalingUpCondition(from, to int)

func (*ClusterStatus) SetUpgradingCondition

func (cs *ClusterStatus) SetUpgradingCondition(to string)

func (*ClusterStatus) SetVersion

func (cs *ClusterStatus) SetVersion(v string)

func (*ClusterStatus) UpgradeVersionTo

func (cs *ClusterStatus) UpgradeVersionTo(v string)

type JVMPolicy

type JVMPolicy struct {
	HeapSizeInMB int `json:"heapSizeInMB"`

	NewGenSizeInMB int `json:"newGenSizeInMB"`

	TunuringThreshold int `json:"tenuringThreshold"`
}

type MembersStatus

type MembersStatus struct {
	// Ready are the zookeeper members that are ready to serve requests
	// The member names are the same as the zookeeper pod names
	Ready []string `json:"ready,omitempty"`
	// Unready are the zookeeper members not ready to serve requests
	Unready []string `json:"unready,omitempty"`
}

type PodPolicy

type PodPolicy struct {
	// Labels specifies the labels to attach to pods the operator creates for the
	// zookeeper cluster.
	// "app" and "zookeeper_*" labels are reserved for the internal use of the zookeeper operator.
	// Do not overwrite them.
	Labels map[string]string `json:"labels,omitempty"`

	// NodeSelector specifies a map of key-value pairs. For the pod to be eligible
	// to run on a node, the node must have each of the indicated key-value pairs as
	// labels.
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`

	// The scheduling constraints on zookeeper pods.
	Affinity *v1.Affinity `json:"affinity,omitempty"`
	// **DEPRECATED**. Use Affinity instead.
	AntiAffinity bool `json:"antiAffinity,omitempty"`

	// Resources is the resource requirements for the zookeeper container.
	// This field cannot be updated once the cluster is created.
	Resources v1.ResourceRequirements `json:"resources,omitempty"`

	// Tolerations specifies the pod's tolerations.
	Tolerations []v1.Toleration `json:"tolerations,omitempty"`

	// List of environment variables to set in the zookeeper container.
	// This is used to configure zookeeper process. zookeeper cluster cannot be created, when
	// bad environement variables are provided. Do not overwrite any flags used to
	// bootstrap the cluster (for example `--initial-cluster` flag).
	// This field cannot be updated.
	ZookeeperEnv []v1.EnvVar `json:"zookeeperEnv,omitempty"`

	// PersistentVolumeClaimSpec is the spec to describe PVC for the zookeeper container
	// This field is optional. If no PVC spec, zookeeper container will use emptyDir as volume
	// Note. This feature is in alpha stage. It is currently only used as non-stable storage,
	// not the stable storage. Future work need to make it used as stable storage.
	PersistentVolumeClaimSpec *v1.PersistentVolumeClaimSpec `json:"persistentVolumeClaimSpec,omitempty"`

	// Annotations specifies the annotations to attach to pods the operator creates for the
	// zookeeper cluster.
	// The "zookeeper.version" annotation is reserved for the internal use of the zookeeper operator.
	Annotations map[string]string `json:"annotations,omitempty"`

	// busybox init container image. default is busybox:1.28.0-glibc
	// busybox:latest uses uclibc which contains a bug that sometimes prevents name resolution
	// More info: https://github.com/docker-library/busybox/issues/27
	BusyboxImage string `json:"busyboxImage,omitempty"`
}

PodPolicy defines the policy to create pod for the zookeeper container.

type ZookeeperCluster

type ZookeeperCluster struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              ClusterSpec   `json:"spec"`
	Status            ClusterStatus `json:"status"`
}

func (*ZookeeperCluster) AsOwner

func (c *ZookeeperCluster) AsOwner() metav1.OwnerReference

func (*ZookeeperCluster) SetDefaults

func (e *ZookeeperCluster) SetDefaults()

SetDefaults cleans up user passed spec, e.g. defaulting, transforming fields. TODO: move this to initializer

type ZookeeperClusterList

type ZookeeperClusterList struct {
	metav1.TypeMeta `json:",inline"`
	// Standard list metadata
	// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ZookeeperCluster `json:"items"`
}

ZookeeperClusterList is a list of zookeeper clusters.

Jump to

Keyboard shortcuts

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