Documentation ¶
Overview ¶
Package m3db is a generated GoMock package.
Index ¶
- Constants
- func CoordinatorServiceName(clusterName string) string
- func GenerateCRD(enableValidation bool) *apiextensionsv1beta1.CustomResourceDefinition
- func GenerateCoordinatorService(cluster *myspec.M3DBCluster) (*v1.Service, error)
- func GenerateDefaultConfigMap(cluster *myspec.M3DBCluster) (*corev1.ConfigMap, error)
- func GenerateM3DBService(cluster *myspec.M3DBCluster) (*v1.Service, error)
- func GenerateOwnerRef(cluster *myspec.M3DBCluster) *metav1.OwnerReference
- func GenerateStatefulSet(cluster *myspec.M3DBCluster, isolationGroupName string, instanceAmount int32) (*appsv1.StatefulSet, error)
- func GenerateStatefulSetAffinity(isoGroup myspec.IsolationGroup) (*v1.Affinity, error)
- func HeadlessServiceName(clusterName string) string
- func NewBaseStatefulSet(ssName, isolationGroup string, cluster *myspec.M3DBCluster, ...) *appsv1.StatefulSet
- func PlacementInstanceFromPod(cluster *myspec.M3DBCluster, pod *corev1.Pod, idProvider podidentity.Provider) (*placementpb.Instance, error)
- func StatefulSetName(clusterName string, stsID int) string
- type K8sops
- type MockK8sops
- func (m *MockK8sops) CreateOrUpdateCRD(name string, enableValidation bool) error
- func (m *MockK8sops) DeleteService(cluster *v1alpha1.M3DBCluster, name string) error
- func (m *MockK8sops) EXPECT() *MockK8sopsMockRecorder
- func (m *MockK8sops) EnsureService(cluster *v1alpha1.M3DBCluster, svc *v1.Service) error
- func (m *MockK8sops) Events(namespace string) v10.EventInterface
- func (m *MockK8sops) GetService(cluster *v1alpha1.M3DBCluster, name string) (*v1.Service, error)
- type MockK8sopsMockRecorder
- func (mr *MockK8sopsMockRecorder) CreateOrUpdateCRD(name, enableValidation interface{}) *gomock.Call
- func (mr *MockK8sopsMockRecorder) DeleteService(cluster, name interface{}) *gomock.Call
- func (mr *MockK8sopsMockRecorder) EnsureService(cluster, svc interface{}) *gomock.Call
- func (mr *MockK8sopsMockRecorder) Events(namespace interface{}) *gomock.Call
- func (mr *MockK8sopsMockRecorder) GetService(cluster, name interface{}) *gomock.Call
- type Option
- type Port
Constants ¶
const ( PortM3DBNodeClient Port = 9000 PortM3DBNodeCluster = 9001 PortM3DBHTTPNode = 9002 PortM3DBHTTPCluster = 9003 PortM3DBDebug = 9004 PortM3Coordinator = 7201 PortM3CoordinatorMetrics = 7203 PortM3CoordinatorCarbon = 7204 )
Ports used by M3DB nodes and coordinator nodes.
Variables ¶
This section is empty.
Functions ¶
func CoordinatorServiceName ¶
CoordinatorServiceName returns a name for a cluster's coordinator service.
func GenerateCRD ¶
func GenerateCRD(enableValidation bool) *apiextensionsv1beta1.CustomResourceDefinition
GenerateCRD generates the crd object needed for the M3DBCluster
func GenerateCoordinatorService ¶
func GenerateCoordinatorService(cluster *myspec.M3DBCluster) (*v1.Service, error)
GenerateCoordinatorService creates a coordinator service given a cluster name.
func GenerateDefaultConfigMap ¶
func GenerateDefaultConfigMap(cluster *myspec.M3DBCluster) (*corev1.ConfigMap, error)
GenerateDefaultConfigMap creates a ConfigMap for the clusters with the default config.
func GenerateM3DBService ¶
func GenerateM3DBService(cluster *myspec.M3DBCluster) (*v1.Service, error)
GenerateM3DBService will generate the headless service required for an M3DB StatefulSet.
func GenerateOwnerRef ¶
func GenerateOwnerRef(cluster *myspec.M3DBCluster) *metav1.OwnerReference
GenerateOwnerRef generates an owner reference to a given m3db cluster.
func GenerateStatefulSet ¶
func GenerateStatefulSet( cluster *myspec.M3DBCluster, isolationGroupName string, instanceAmount int32, ) (*appsv1.StatefulSet, error)
GenerateStatefulSet provides a statefulset object for a m3db cluster
func GenerateStatefulSetAffinity ¶
func GenerateStatefulSetAffinity(isoGroup myspec.IsolationGroup) (*v1.Affinity, error)
GenerateStatefulSetAffinity generates a node affinity requiring a strict match for given key and values.
func HeadlessServiceName ¶
HeadlessServiceName returns a name for the cluster's headless service.
func NewBaseStatefulSet ¶
func NewBaseStatefulSet(ssName, isolationGroup string, cluster *myspec.M3DBCluster, instanceCount int32) *appsv1.StatefulSet
NewBaseStatefulSet returns a base configured stateful set.
func PlacementInstanceFromPod ¶
func PlacementInstanceFromPod(cluster *myspec.M3DBCluster, pod *corev1.Pod, idProvider podidentity.Provider) (*placementpb.Instance, error)
PlacementInstanceFromPod creates a new m3cluster placement instance given a pod spec.
func StatefulSetName ¶
StatefulSetName provides a formatted string to use for naming StatefulSets
Types ¶
type K8sops ¶
type K8sops interface { // CreateOrUpdateCRD creates the CRD if it does not exist, or updates it to // contain the latest spec if it does exist. CreateOrUpdateCRD(name string, enableValidation bool) error // GetService simply gets a service by name GetService(cluster *myspec.M3DBCluster, name string) (*v1.Service, error) // DeleteService simply deletes a service by name DeleteService(cluster *myspec.M3DBCluster, name string) error // EnsureService will create a service by name if it doesn't exist EnsureService(cluster *myspec.M3DBCluster, svc *v1.Service) error // Events returns an Event interface for a given namespace. Events(namespace string) typedcorev1.EventInterface }
K8sops provides an interface for various Kubernetes API calls
type MockK8sops ¶
type MockK8sops struct {
// contains filtered or unexported fields
}
MockK8sops is a mock of K8sops interface
func NewMockK8sops ¶
func NewMockK8sops(ctrl *gomock.Controller) *MockK8sops
NewMockK8sops creates a new mock instance
func (*MockK8sops) CreateOrUpdateCRD ¶
func (m *MockK8sops) CreateOrUpdateCRD(name string, enableValidation bool) error
CreateOrUpdateCRD mocks base method
func (*MockK8sops) DeleteService ¶
func (m *MockK8sops) DeleteService(cluster *v1alpha1.M3DBCluster, name string) error
DeleteService mocks base method
func (*MockK8sops) EXPECT ¶
func (m *MockK8sops) EXPECT() *MockK8sopsMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockK8sops) EnsureService ¶
func (m *MockK8sops) EnsureService(cluster *v1alpha1.M3DBCluster, svc *v1.Service) error
EnsureService mocks base method
func (*MockK8sops) Events ¶
func (m *MockK8sops) Events(namespace string) v10.EventInterface
Events mocks base method
func (*MockK8sops) GetService ¶
func (m *MockK8sops) GetService(cluster *v1alpha1.M3DBCluster, name string) (*v1.Service, error)
GetService mocks base method
type MockK8sopsMockRecorder ¶
type MockK8sopsMockRecorder struct {
// contains filtered or unexported fields
}
MockK8sopsMockRecorder is the mock recorder for MockK8sops
func (*MockK8sopsMockRecorder) CreateOrUpdateCRD ¶
func (mr *MockK8sopsMockRecorder) CreateOrUpdateCRD(name, enableValidation interface{}) *gomock.Call
CreateOrUpdateCRD indicates an expected call of CreateOrUpdateCRD
func (*MockK8sopsMockRecorder) DeleteService ¶
func (mr *MockK8sopsMockRecorder) DeleteService(cluster, name interface{}) *gomock.Call
DeleteService indicates an expected call of DeleteService
func (*MockK8sopsMockRecorder) EnsureService ¶
func (mr *MockK8sopsMockRecorder) EnsureService(cluster, svc interface{}) *gomock.Call
EnsureService indicates an expected call of EnsureService
func (*MockK8sopsMockRecorder) Events ¶
func (mr *MockK8sopsMockRecorder) Events(namespace interface{}) *gomock.Call
Events indicates an expected call of Events
func (*MockK8sopsMockRecorder) GetService ¶
func (mr *MockK8sopsMockRecorder) GetService(cluster, name interface{}) *gomock.Call
GetService indicates an expected call of GetService
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option provides an interface that can be used for setter options with the constructor
func WithCRDClient ¶
WithCRDClient is a setter to override the default CRD client
func WithExtClient ¶
func WithExtClient(extClient apiextensionsclient.Interface) Option
WithExtClient is a setter to override the default Extensions Client
func WithKClient ¶
func WithKClient(kclient kubernetes.Interface) Option
WithKClient is a setter to override the default Kubernetes client
func WithLogger ¶
WithLogger is a setter to override the default logger