controllers

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NetworkContainer    = "network"
	ConsensusContainer  = "consensus"
	ExecutorContainer   = "executor"
	StorageContainer    = "storage"
	ControllerContainer = "controller"
	KmsContainer        = "kms"

	AccountVolumeName         = "account"
	KmsDBMountPath            = "/mnt"
	LogConfigVolumeName       = "log-config"
	NodeConfigVolumeName      = "node-config"
	NodeConfigVolumeMountPath = "/etc/cita-cloud/config"
	DataVolumeName            = "datadir"
	DataVolumeMountPath       = "/data"
	LogConfigVolumeMountPath  = "/etc/cita-cloud/log"
	LogDir                    = DataVolumeMountPath + "/logs"

	NodeConfigFile          = "config.toml"
	ControllerLogConfigFile = "controller-log4rs.yaml"
	ExecutorLogConfigFile   = "executor-log4rs.yaml"
	KmsLogConfigFile        = "kms-log4rs.yaml"
	NetworkLogConfigFile    = "network-log4rs.yaml"
	StorageLogConfigFile    = "storage-log4rs.yaml"
	ConsensusLogConfigFile  = "consensus-log4rs.yaml"

	NetworkPort    = 40000
	ControllerPort = 50004
	ExecutorPort   = 50002
)

Variables

View Source
var NodeMap sync.Map

Functions

func CleanJob

func CleanJob(ctx context.Context, cli client.Client, job *v1.Job, ttl int64)

func GetLogConfigName

func GetLogConfigName(nodeName string) string

GetLogConfigName get node's log config configmap name

func GetNodePortServiceName

func GetNodePortServiceName(nodeName string) string

GetNodePortServiceName get node's clusterIP service name

func GetVolumes

func GetVolumes(node *citacloudv1.CitaNode) []corev1.Volume

func IsEqual

func IsEqual(obj1, obj2 interface{}) bool

IsEqual check two object is equal.

func LabelsForNode

func LabelsForNode(chainName, nodeName string) map[string]string

func MergeLabels

func MergeLabels(allLabels ...map[string]string) map[string]string

MergeLabels merges all labels together and returns a new label.

Types

type BackupReconciler

type BackupReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

BackupReconciler reconciles a Backup object

func (*BackupReconciler) Reconcile

func (r *BackupReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*BackupReconciler) SetupWithManager

func (r *BackupReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type BlockHeightFallbackReconciler

type BlockHeightFallbackReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

BlockHeightFallbackReconciler reconciles a BlockHeightFallback object

func (*BlockHeightFallbackReconciler) Reconcile

func (*BlockHeightFallbackReconciler) SetupWithManager

func (r *BlockHeightFallbackReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type ChainNodeServiceImpl

type ChainNodeServiceImpl interface {
	GenerateControllerLogConfig() string
	GenerateExecutorLogConfig() string
	GenerateKmsLogConfig() string
	GenerateNetworkLogConfig() string
	GenerateStorageLogConfig() string
	GenerateConsensusLogConfig() string
}

type CitaNodeReconciler

type CitaNodeReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

CitaNodeReconciler reconciles a CitaNode object

func (*CitaNodeReconciler) Reconcile

func (r *CitaNodeReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*CitaNodeReconciler) ReconcileAllRecourse

func (r *CitaNodeReconciler) ReconcileAllRecourse(ctx context.Context, node *citacloudv1.CitaNode) error

func (*CitaNodeReconciler) ReconcileConfigMap

func (r *CitaNodeReconciler) ReconcileConfigMap(ctx context.Context, node *citacloudv1.CitaNode) (bool, error)

func (*CitaNodeReconciler) ReconcileLogConfigMap

func (r *CitaNodeReconciler) ReconcileLogConfigMap(ctx context.Context, node *citacloudv1.CitaNode) (bool, error)

func (*CitaNodeReconciler) ReconcileService

func (r *CitaNodeReconciler) ReconcileService(ctx context.Context, node *citacloudv1.CitaNode) error

func (*CitaNodeReconciler) ReconcileStatefulSet

func (r *CitaNodeReconciler) ReconcileStatefulSet(ctx context.Context, node *citacloudv1.CitaNode) (*NodeValue, error)

func (*CitaNodeReconciler) SetDefaultStatus

func (r *CitaNodeReconciler) SetDefaultStatus(ctx context.Context, node *citacloudv1.CitaNode) (bool, error)

func (*CitaNodeReconciler) SetStatusAndCondition

func (r *CitaNodeReconciler) SetStatusAndCondition(ctx context.Context, wantedStatus citacloudv1.Status,
	node *citacloudv1.CitaNode, conditionType status.ConditionType, conditionStatus corev1.ConditionStatus,
	reason status.ConditionReason, message string, eventType string) error

func (*CitaNodeReconciler) SetupWithManager

func (r *CitaNodeReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

func (*CitaNodeReconciler) SyncStatus

func (r *CitaNodeReconciler) SyncStatus(ctx context.Context, node *citacloudv1.CitaNode) error

type JobRbac

type JobRbac struct {
	client.Client
	Log            logr.Logger
	Namespace      string
	ServiceAccount string
	Role           string
	RoleBinding    string
}

func (*JobRbac) Ensure

func (r *JobRbac) Ensure(ctx context.Context) error

type NodeService

type NodeService struct {
	Node *citacloudv1.CitaNode
}

func NewChainNodeServiceForLog

func NewChainNodeServiceForLog(node *citacloudv1.CitaNode) *NodeService

func (*NodeService) GenerateConsensusLogConfig

func (cns *NodeService) GenerateConsensusLogConfig() string

func (*NodeService) GenerateControllerLogConfig

func (cns *NodeService) GenerateControllerLogConfig() string

func (*NodeService) GenerateExecutorLogConfig

func (cns *NodeService) GenerateExecutorLogConfig() string

func (*NodeService) GenerateKmsLogConfig

func (cns *NodeService) GenerateKmsLogConfig() string

func (*NodeService) GenerateNetworkLogConfig

func (cns *NodeService) GenerateNetworkLogConfig() string

func (*NodeService) GenerateStorageLogConfig

func (cns *NodeService) GenerateStorageLogConfig() string

type NodeValue

type NodeValue struct {
	Status citacloudv1.Status
}

func NewNodeValue

func NewNodeValue(status citacloudv1.Status) *NodeValue

type RestoreReconciler

type RestoreReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

RestoreReconciler reconciles a Restore object

func (*RestoreReconciler) Reconcile

func (r *RestoreReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*RestoreReconciler) SetupWithManager

func (r *RestoreReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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