Documentation

Index

Constants

View Source
const (
	// QuarksStatefulSetResourceKind is the kind name of QuarksStatefulSet
	QuarksStatefulSetResourceKind = "QuarksStatefulSet"
	// QuarksStatefulSetResourcePlural is the plural name of QuarksStatefulSet
	QuarksStatefulSetResourcePlural = "quarksstatefulsets"
)
View Source
const DefaultZoneNodeLabel = "failure-domain.beta.kubernetes.io/zone"

    DefaultZoneNodeLabel is the default node label for available zones

    Variables

    View Source
    var (
    
    	// AddToScheme is used for schema registrations in the controller package
    	// and also in the generated kube code
    	AddToScheme = schemeBuilder.AddToScheme
    
    	// QuarksStatefulSetResourceShortNames is the short names of QuarksStatefulSet
    	QuarksStatefulSetResourceShortNames = []string{"qsts"}
    
    	// QuarksStatefulSetValidation is the validation method for QuarksStatefulSet
    	QuarksStatefulSetValidation = extv1.CustomResourceValidation{
    		OpenAPIV3Schema: &extv1.JSONSchemaProps{
    			Type: "object",
    			Properties: map[string]extv1.JSONSchemaProps{
    				"spec": {
    					Type: "object",
    					Properties: map[string]extv1.JSONSchemaProps{
    						"template": {
    							Type:                   "object",
    							Description:            "A template for a regular StatefulSet",
    							XPreserveUnknownFields: pointers.Bool(true),
    						},
    						"updateOnConfigChange": {
    							Type:        "boolean",
    							Description: "Indicate whether to update Pods in the StatefulSet when an env value or mount changes",
    						},
    						"activePassiveProbes": {
    							Type:                   "object",
    							Description:            "Defines probes to determine active/passive component instances",
    							XPreserveUnknownFields: pointers.Bool(true),
    						},
    						"injectReplicasEnv": {
    							Type:        "boolean",
    							Description: "Determines if the REPLICAS env var is injected into pod containers.",
    						},
    						"zoneNodeLabel": {
    							Type:        "string",
    							Description: "Indicates the node label that a node locates",
    						},
    						"zones": {
    							Type:        "array",
    							Description: "Indicates the availability zones that the QuarksStatefulSet needs to span",
    							Items: &extv1.JSONSchemaPropsOrArray{
    								Schema: &extv1.JSONSchemaProps{
    									Type: "string",
    								},
    							},
    						},
    					},
    					Required: []string{
    						"template",
    					},
    				},
    				"status": {
    					Type: "object",
    					Properties: map[string]extv1.JSONSchemaProps{
    						"lastReconcile": {
    							Type: "string",
    						},
    						"ready": {
    							Type: "boolean",
    						},
    					},
    				},
    			},
    		},
    	}
    
    	// QuarksStatefulSetAdditionalPrinterColumns are used by `kubectl get`
    	QuarksStatefulSetAdditionalPrinterColumns = []extv1.CustomResourceColumnDefinition{
    		{
    			Name:        "ready",
    			Type:        "boolean",
    			Description: "",
    			JSONPath:    ".status.ready",
    		},
    	}
    
    	// QuarksStatefulSetResourceName is the resource name of QuarksStatefulSet
    	QuarksStatefulSetResourceName = fmt.Sprintf("%s.%s", QuarksStatefulSetResourcePlural, apis.GroupName)
    
    	// SchemeGroupVersion is group version used to register these objects
    	SchemeGroupVersion = schema.GroupVersion{Group: apis.GroupName, Version: "v1alpha1"}
    )
    View Source
    var (
    	// AnnotationVersion is the annotation key for the StatefulSet version
    	AnnotationVersion = fmt.Sprintf("%s/version", apis.GroupName)
    	// AnnotationZones is an array of all zones
    	AnnotationZones = fmt.Sprintf("%s/zones", apis.GroupName)
    	// LabelAZIndex is the index of available zone
    	LabelAZIndex = fmt.Sprintf("%s/az-index", apis.GroupName)
    	// LabelAZName is the name of available zone
    	LabelAZName = fmt.Sprintf("%s/az-name", apis.GroupName)
    	// LabelPodOrdinal is the index of pod ordinal
    	LabelPodOrdinal = fmt.Sprintf("%s/pod-ordinal", apis.GroupName)
    
    	// LabelQStsName is the name of the StatefulSet, not the
    	// QuarksStatefulSet. It's used for active-passive probes. In contrast
    	// to the qsts name, a statefulset name might have an AZ suffix, since
    	// there is one sts per AZ.
    	//
    	// So this label has the wrong name, but since Spec.Selector has to
    	// match Spec.Template.Labels and it's forbidden to update
    	// Spec.Selector, we can't fix the name.
    	LabelQStsName = fmt.Sprintf("%s/quarks-statefulset-name", apis.GroupName)
    
    	// LabelActivePod is the active pod on an active/passive setup
    	LabelActivePod = fmt.Sprintf("%s/pod-active", apis.GroupName)
    )

    Functions

    func Kind

    func Kind(kind string) schema.GroupKind

      Kind takes an unqualified kind and returns back a Group qualified GroupKind

      func Resource

      func Resource(resource string) schema.GroupResource

        Resource takes an unqualified resource and returns a Group qualified GroupResource

        Types

        type QuarksStatefulSet

        type QuarksStatefulSet struct {
        	metav1.TypeMeta   `json:",inline"`
        	metav1.ObjectMeta `json:"metadata,omitempty"`
        
        	Spec   QuarksStatefulSetSpec   `json:"spec,omitempty"`
        	Status QuarksStatefulSetStatus `json:"status,omitempty"`
        }

          QuarksStatefulSet is the Schema for the QuarksStatefulSet API +k8s:openapi-gen=true

          func (*QuarksStatefulSet) DeepCopy

          func (in *QuarksStatefulSet) DeepCopy() *QuarksStatefulSet

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

            func (*QuarksStatefulSet) DeepCopyInto

            func (in *QuarksStatefulSet) DeepCopyInto(out *QuarksStatefulSet)

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

              func (*QuarksStatefulSet) DeepCopyObject

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

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

                func (*QuarksStatefulSet) GetMaxAvailableVersion

                func (q *QuarksStatefulSet) GetMaxAvailableVersion(versions map[int]bool) int

                  GetMaxAvailableVersion gets the greatest available version owned by the QuarksStatefulSet

                  func (*QuarksStatefulSet) GetNamespacedName

                  func (q *QuarksStatefulSet) GetNamespacedName() string

                    GetNamespacedName returns the resource name with its namespace

                    type QuarksStatefulSetList

                    type QuarksStatefulSetList struct {
                    	metav1.TypeMeta `json:",inline"`
                    	metav1.ListMeta `json:"metadata,omitempty"`
                    	Items           []QuarksStatefulSet `json:"items"`
                    }

                      QuarksStatefulSetList contains a list of QuarksStatefulSet

                      func (*QuarksStatefulSetList) DeepCopy

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

                        func (*QuarksStatefulSetList) DeepCopyInto

                        func (in *QuarksStatefulSetList) DeepCopyInto(out *QuarksStatefulSetList)

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

                          func (*QuarksStatefulSetList) DeepCopyObject

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

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

                            type QuarksStatefulSetSpec

                            type QuarksStatefulSetSpec struct {
                            	// Indicates whether to update Pods in the StatefulSet when an env value or mount changes
                            	UpdateOnConfigChange bool `json:"updateOnConfigChange"`
                            
                            	// Indicates the node label that a node locates
                            	ZoneNodeLabel string `json:"zoneNodeLabel,omitempty"`
                            
                            	// Indicates the availability zones that the QuarksStatefulSet needs to span
                            	Zones []string `json:"zones,omitempty"`
                            
                            	// Defines a regular StatefulSet template
                            	Template appsv1.StatefulSet `json:"template"`
                            
                            	// Periodic probe for active/passive containers
                            	// Only an active container will process request from a service
                            	ActivePassiveProbes map[string]corev1.Probe `json:"activePassiveProbes,omitempty"`
                            
                            	// Determines whether the REPLICAS env var should be injected into pod containers
                            	// By default, true.
                            	InjectReplicasEnv *bool `json:"injectReplicasEnv,omitempty"`
                            }

                              QuarksStatefulSetSpec defines the desired state of QuarksStatefulSet

                              func (*QuarksStatefulSetSpec) DeepCopy

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

                                func (*QuarksStatefulSetSpec) DeepCopyInto

                                func (in *QuarksStatefulSetSpec) DeepCopyInto(out *QuarksStatefulSetSpec)

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

                                  type QuarksStatefulSetStatus

                                  type QuarksStatefulSetStatus struct {
                                  	// Timestamp for the last reconcile
                                  	LastReconcile *metav1.Time `json:"lastReconcile"`
                                  	// Ready determines whether the QuarksStatefulSet is ready for serve
                                  	Ready bool `json:"ready"`
                                  }

                                    QuarksStatefulSetStatus defines the observed state of QuarksStatefulSet

                                    func (*QuarksStatefulSetStatus) DeepCopy

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

                                      func (*QuarksStatefulSetStatus) DeepCopyInto

                                      func (in *QuarksStatefulSetStatus) DeepCopyInto(out *QuarksStatefulSetStatus)

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