v1alpha1

package
v0.0.0-...-4c0bbbd Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package v1alpha1 is the v1alpha1 version of the API. +groupName=dgraph.io

Index

Constants

View Source
const (
	// CustomResourceDefinitionGroupName is the CRD group name associated with all the dgraph
	// custom resources registered in k8s.
	CustomResourceDefinitionGroupName = "dgraph.io"

	// CustomResourceDefinitionSchemaVersionKey is key to label which holds the CRD schema version
	CustomResourceDefinitionSchemaVersionKey = "io.dgraph.k8s.crd.schema.version"

	// CustomResourceDefinitionSchemaVersion is semver-conformant version of CRD schema
	// Used to determine if CRD needs to be updated in cluster
	CustomResourceDefinitionSchemaVersion = "1.16"

	// CustomResourceDefinitionVersion is the current version of the resource
	CustomResourceDefinitionVersion = "v1alpha1"

	// DgraphClusterKindDefinition is Kind name of the custom resource definition.
	DgraphClusterKindDefinition = "DgraphCluster"
)

Variables

View Source
var (
	// SchemeBuilder is required by k8s deepcopy generator.
	SchemeBuilder runtime.SchemeBuilder

	// AddToScheme adds all types of this clientset into the given scheme.
	// This allows composition of clientsets, like in:
	//
	//   import (
	//     "k8s.io/client-go/kubernetes"
	//     clientsetscheme "k8s.io/client-go/kuberentes/scheme"
	//     aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/
	//        clientset_generated/clientset/scheme"
	//   )
	//
	//   kclientset, _ := kubernetes.NewForConfig(c)
	//   aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
	AddToScheme = localSchemeBuilder.AddToScheme
)
View Source
var (
	// DgraphClusterCRDSingularName is the singular name of custom resource definition
	DgraphClusterCRDSingularName = "dgraphcluster"

	// DgraphClusterCRDPluralName is the plural name of custom resource definition
	DgraphClusterCRDPluralName = "dgraphclusters"

	// DgraphClusterCRDShortNames are the abbreviated names to refer to this CRD's instances
	DgraphClusterCRDShortNames = []string{"dc"}

	// DgraphClusterCRDName is k8s represented name of the custom resource definition.
	DgraphClusterCRDName string = DgraphClusterCRDPluralName + "." + SchemeGroupVersion.Group
)

SchemeGroupVersion is group version used to register these objects

Functions

func CreateCustomResourceDefinitions

func CreateCustomResourceDefinitions(clientset apiextclient.Interface) error

CreateCustomResourceDefinitions creates our CRD objects in the kubernetes cluster using k8s api extension clientset.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns back a Group qualified GroupResource

Types

type AlphaClusterSpec

type AlphaClusterSpec struct {
	DgraphComponentSpec `json:",inline"`

	// Storage is the configuration for persistent storage for dgraph component.
	PersistentStorage *ComponentPersistentStorage `json:"persistentStorage,omitempty"`

	// Number of replicas to run in the cluster.
	Replicas int32 `json:"replicas"`

	// Config is the configuration of the dgraph component.
	Config *AlphaConfig `json:"config,omitempty"`
}

+k8s:openapi-gen=true AlphaClusterSpec is the specification of the dgraph alpha cluster.

func (*AlphaClusterSpec) DeepCopy

func (in *AlphaClusterSpec) DeepCopy() *AlphaClusterSpec

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

func (*AlphaClusterSpec) DeepCopyInto

func (in *AlphaClusterSpec) DeepCopyInto(out *AlphaClusterSpec)

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

func (*AlphaClusterSpec) LruMB

func (acs *AlphaClusterSpec) LruMB() int32

LruMB returns the LRU MB configuration for dgraph alpha.

type AlphaClusterStatus

type AlphaClusterStatus struct {
	// StatefulSet is the status of stateful set associated with the specified
	// alpha cluster.
	StatefulSet *apps.StatefulSetStatus `json:"statefulSet,omitempty"`

	// Members is the map of members in the alpha cluster.
	Members map[string]DgraphComponent `json:"members,omitempty"`
}

AlphaClusterStatus represents the cluster status of dgraph alpha components.

func (*AlphaClusterStatus) DeepCopy

func (in *AlphaClusterStatus) DeepCopy() *AlphaClusterStatus

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

func (*AlphaClusterStatus) DeepCopyInto

func (in *AlphaClusterStatus) DeepCopyInto(out *AlphaClusterStatus)

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

type AlphaConfig

type AlphaConfig struct {
	DgraphConfig `json:",inline"`

	// LruMB is the value of lrumb flag for dgraph alpha.
	LruMB int32 `json:"lruMB,omitempty"`
}

+k8s:openapi-gen=true AlphaConfig is the configuration for dgraph alpha component.

func (*AlphaConfig) DeepCopy

func (in *AlphaConfig) DeepCopy() *AlphaConfig

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

func (*AlphaConfig) DeepCopyInto

func (in *AlphaConfig) DeepCopyInto(out *AlphaConfig)

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

type ClusterState

type ClusterState string

ClusterState represents the state of the cluster.

var (
	// ClusterStateCreating represents that the cluster is being created.
	ClusterStateCreating ClusterState = "creating"

	// ClusterStateRunning represents that the cluster is being updated.
	ClusterStateRunning ClusterState = "running"

	// ClusterStateUpdating represents that the cluster is being updated.
	ClusterStateUpdating ClusterState = "updating"
)

type ComponentPersistentStorage

type ComponentPersistentStorage struct {
	// StorageClassName is the name of the storage class to use for the
	// persistent volumes for the dgraph component.
	StorageClassName string `json:"storageClassName,omitempty"`

	// Resource requirements for dgraph persistent storage.
	Requests corev1.ResourceList `json:"requests,omitempty"`
}

ComponentPersistentStorage is the common type for storing configuration for persistent storage to associate with the dgraph component.

func (*ComponentPersistentStorage) DeepCopy

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

func (*ComponentPersistentStorage) DeepCopyInto

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

func (*ComponentPersistentStorage) StorageRequest

func (cps *ComponentPersistentStorage) StorageRequest() corev1.ResourceList

type DgraphCluster

type DgraphCluster struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Specification of the Dgraph cluster to create in the k8s cluster.
	Spec DgraphClusterSpec `json:"spec"`

	// Most recently observed status of the dgraph cluster
	Status DgraphClusterStatus `json:"status,omitempty"`
}

+k8s:openapi-gen=true DgraphCluster is a Kubernetes custom resource which represents a dgraph cluster.

func (*DgraphCluster) AlphaClusterSpec

func (dc *DgraphCluster) AlphaClusterSpec() *AlphaClusterSpec

AlphaClusterSpec returns cluster specification for dgraph Alpha component applying default values wherever necessery. It returns pointer to a copy of actual AlphaClusterSpec object in the DgraphCluster object.

func (*DgraphCluster) AsOwnerReference

func (dc *DgraphCluster) AsOwnerReference() metav1.OwnerReference

AsOwnerReference returns the OwnerReference corresponding to DgraphCluster which can be used as OwnerReference for other resources in the cluster.

func (*DgraphCluster) DeepCopy

func (in *DgraphCluster) DeepCopy() *DgraphCluster

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

func (*DgraphCluster) DeepCopyInto

func (in *DgraphCluster) DeepCopyInto(out *DgraphCluster)

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

func (*DgraphCluster) DeepCopyObject

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

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

func (*DgraphCluster) RatelClusterSpec

func (dc *DgraphCluster) RatelClusterSpec() *RatelSpec

RatelClusterSpec returns cluster specification for dgraph Ratel component applying default values wherever necessery. It returns pointer to a copy of actual RatelClusterSpec object in the DgraphCluster object.

func (*DgraphCluster) ZeroClusterSpec

func (dc *DgraphCluster) ZeroClusterSpec() *ZeroClusterSpec

ZeroClusterSpec returns cluster specification for dgraph zero component applying default values wherever necessery. It returns pointer to a copy of actual ZeroClusterSpec object in the DgraphCluster object.

type DgraphClusterList

type DgraphClusterList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	// Items is the list of DgraphCluster
	Items []DgraphCluster `json:"items"`
}

+k8s:openapi-gen=true DgraphClusterList is the list of DgraphCluster in the k8s cluster.

func (*DgraphClusterList) DeepCopy

func (in *DgraphClusterList) DeepCopy() *DgraphClusterList

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

func (*DgraphClusterList) DeepCopyInto

func (in *DgraphClusterList) DeepCopyInto(out *DgraphClusterList)

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

func (*DgraphClusterList) DeepCopyObject

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

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

type DgraphClusterSpec

type DgraphClusterSpec struct {
	// ClusterID is the ID of the dgraph cluster deployed.
	ClusterID string `json:"clusterID"`

	// Cluster specification for dgraph alpha components.
	AlphaCluster *AlphaClusterSpec `json:"alpha"`

	// Cluster specification for dgraph zero components.
	ZeroCluster *ZeroClusterSpec `json:"zero"`

	// Specification for dgraph ratel component for providing UI.
	Ratel *RatelSpec `json:"ratel,omitempty"`

	// Base image to use for dgraph cluster individual components, this can be overridden
	BaseImage string `json:"baseImage"`

	// Version of the component. Override the cluster-level version if non-empty
	Version string `json:"version"`

	// ServiceType is the type of kubernetes service to create for the Cluster components.
	ServiceType string `json:"serviceType,omitempty"`

	// ImagePullPolicy of the dgraph component.
	ImagePullPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

	// Annotations of the component.
	// Cluster level annotation is not overridden by the component configuration
	// rather merged with the underlying specified annotations.
	Annotations map[string]string `json:"annotations,omitempty"`

	// Resource requirements of the components, this can be overridden at component level.
	Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
}

+k8s:openapi-gen=true DgraphClusterSpec is the underlying specification of the DgraphCluster CRD. There are three important components of a Dgraph Cluster 1. Alpha 2. Zero 3. Ratel(optional)

func (*DgraphClusterSpec) AlphaServiceType

func (dc *DgraphClusterSpec) AlphaServiceType() corev1.ServiceType

AlphaServiceType returns the kubernetes service type to use for Alpha Cluster

func (*DgraphClusterSpec) DeepCopy

func (in *DgraphClusterSpec) DeepCopy() *DgraphClusterSpec

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

func (*DgraphClusterSpec) DeepCopyInto

func (in *DgraphClusterSpec) DeepCopyInto(out *DgraphClusterSpec)

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

func (*DgraphClusterSpec) GetClusterID

func (dc *DgraphClusterSpec) GetClusterID() string

GetClusterID returns the cluster ID for the provided Dgraph Cluster.

func (*DgraphClusterSpec) RatelServiceType

func (dc *DgraphClusterSpec) RatelServiceType() corev1.ServiceType

RatelServiceType returns the kubernetes service type to use for Ratel Cluster

func (*DgraphClusterSpec) ZeroServiceType

func (dc *DgraphClusterSpec) ZeroServiceType() corev1.ServiceType

ZeroServiceType returns the kubernetes service type to use for Zero Cluster

type DgraphClusterStatus

type DgraphClusterStatus struct {
	// ClusterID is the ID of the dgraph cluster deployed.
	ClusterID string `json:"clusterID"`

	State ClusterState `json:"state"`

	// Status of individual dgraph components like alpha, zero and ratel.
	AlphaCluster AlphaClusterStatus `json:"alpha,omitempty"`
	ZeroCluster  ZeroClusterStatus  `json:"zero,omitempty"`
	Ratel        RatelStatus        `json:"ratel,omitempty"`
}

DgraphClusterStatus represents the status of a DgraphCluster.

func (*DgraphClusterStatus) DeepCopy

func (in *DgraphClusterStatus) DeepCopy() *DgraphClusterStatus

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

func (*DgraphClusterStatus) DeepCopyInto

func (in *DgraphClusterStatus) DeepCopyInto(out *DgraphClusterStatus)

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

type DgraphComponent

type DgraphComponent struct {
	Name string `json:"name"`

	ID           string `json:"id"`
	ComponentURL string `json:"componentURL"`
	Healthy      bool   `json:"health"`
}

DgraphComponent represents a single member of either alpha or zero cluster.

func (*DgraphComponent) DeepCopy

func (in *DgraphComponent) DeepCopy() *DgraphComponent

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

func (*DgraphComponent) DeepCopyInto

func (in *DgraphComponent) DeepCopyInto(out *DgraphComponent)

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

type DgraphComponentSpec

type DgraphComponentSpec struct {
	// Resource requirements of the components.
	Resources *corev1.ResourceRequirements `json:"resources,omitempty"`

	// Base image of the component
	BaseImage string `json:"baseImage,omitempty"`

	// ServiceType is type of service to create for the component.
	// One of NodePort, ClusterIP, LoadBalancer. Defaults to ClusterIP.
	ServiceType string `json:"serviceType,omitempty"`

	// Version of the component. Override the cluster-level version if non-empty
	Version string `json:"version,omitempty"`

	// ImagePullPolicy of the dgraph component.
	ImagePullPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

	// Annotations of the component.
	Annotations map[string]string `json:"annotations,omitempty"`
}

+k8s:openapi-gen=true DgraphComponentSpec is the common configuration values shared among different dgraph components.

func (*DgraphComponentSpec) DeepCopy

func (in *DgraphComponentSpec) DeepCopy() *DgraphComponentSpec

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

func (*DgraphComponentSpec) DeepCopyInto

func (in *DgraphComponentSpec) DeepCopyInto(out *DgraphComponentSpec)

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

func (*DgraphComponentSpec) Image

func (dcs *DgraphComponentSpec) Image() string

Image returns the image to be used for deployment of the dgraph component.

func (*DgraphComponentSpec) PodImagePullPolicy

func (dcs *DgraphComponentSpec) PodImagePullPolicy() corev1.PullPolicy

PodImagePullPolicy returns the image pull policy to be used for deployment of the dgraph component.

func (*DgraphComponentSpec) ResourceRequirements

func (dcs *DgraphComponentSpec) ResourceRequirements() corev1.ResourceRequirements

ResourceRequirements returns the resource requirements to be used for deployment of the dgraph component.

type DgraphConfig

type DgraphConfig struct {
	// URL of the jaeger collector for dgraph alpha and zero components.
	JaegerCollector string `json:"jaegerCollector,omitempty"`
}

+k8s:openapi-gen=true DgraphConfig is the common configuration for dgraph components.

func (*DgraphConfig) DeepCopy

func (in *DgraphConfig) DeepCopy() *DgraphConfig

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

func (*DgraphConfig) DeepCopyInto

func (in *DgraphConfig) DeepCopyInto(out *DgraphConfig)

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

type RatelSpec

type RatelSpec struct {
	DgraphComponentSpec `json:",inline"`

	// Number of replicas of ratel to run in the cluster.
	Replicas int32 `json:"replicas"`
}

+k8s:openapi-gen=true RatelSpec holds the configuration of dgraph ratel components.

func (*RatelSpec) DeepCopy

func (in *RatelSpec) DeepCopy() *RatelSpec

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

func (*RatelSpec) DeepCopyInto

func (in *RatelSpec) DeepCopyInto(out *RatelSpec)

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

type RatelStatus

type RatelStatus struct {
	// Deployment is the status of stateful set associated with the specified
	// ratel cluster.
	Deployment *apps.DeploymentStatus `json:"deployment,omitempty"`

	// Members is the map of members in the zero cluster.
	Members map[string]DgraphComponent `json:"members,omitempty"`
}

RatelStatus holds the status of dgraph ratel component.

func (*RatelStatus) DeepCopy

func (in *RatelStatus) DeepCopy() *RatelStatus

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

func (*RatelStatus) DeepCopyInto

func (in *RatelStatus) DeepCopyInto(out *RatelStatus)

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

type ZeroClusterSpec

type ZeroClusterSpec struct {
	DgraphComponentSpec `json:",inline"`

	// PersistentStorage is the configuration for persistent storage for dgraph component.
	PersistentStorage *ComponentPersistentStorage `json:"persistentStorage,omitempty"`

	// Number of replicas to run in the cluster.
	Replicas int32 `json:"replicas"`

	// Config is the configuration of the dgraph zero.
	Config *ZeroConfig `json:"config,omitempty"`
}

+k8s:openapi-gen=true ZeroClusterSpec is the specification of the dgraph alpha cluster.

func (*ZeroClusterSpec) DeepCopy

func (in *ZeroClusterSpec) DeepCopy() *ZeroClusterSpec

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

func (*ZeroClusterSpec) DeepCopyInto

func (in *ZeroClusterSpec) DeepCopyInto(out *ZeroClusterSpec)

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

func (*ZeroClusterSpec) ShardReplicaCount

func (zcs *ZeroClusterSpec) ShardReplicaCount() int32

ShardReplicaCount returns the zero replica count to be used for deployment of the dgraph component.

type ZeroClusterStatus

type ZeroClusterStatus struct {
	// StatefulSet is the status of stateful set associated with the specified
	// zero cluster.
	StatefulSet *apps.StatefulSetStatus `json:"statefulSet,omitempty"`

	// Members is the map of members in the zero cluster.
	Members map[string]DgraphComponent `json:"members,omitempty"`
}

ZeroClusterStatus represents the cluster status of dgraph alpha components.

func (*ZeroClusterStatus) DeepCopy

func (in *ZeroClusterStatus) DeepCopy() *ZeroClusterStatus

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

func (*ZeroClusterStatus) DeepCopyInto

func (in *ZeroClusterStatus) DeepCopyInto(out *ZeroClusterStatus)

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

type ZeroConfig

type ZeroConfig struct {
	DgraphConfig `json:",inline"`

	// ShardReplicaCount is the max number of replicas per data shard.
	ShardReplicaCount int32 `json:"shardReplicaCount,omitempty"`
}

+k8s:openapi-gen=true ZeroConfig is the configuration of dgraph zero component.

func (*ZeroConfig) DeepCopy

func (in *ZeroConfig) DeepCopy() *ZeroConfig

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

func (*ZeroConfig) DeepCopyInto

func (in *ZeroConfig) DeepCopyInto(out *ZeroConfig)

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