Documentation ¶
Index ¶
- Constants
- Variables
- func CleanJob(ctx context.Context, cli client.Client, job *v1.Job, ttl int64)
- func GeneratePVC(node *citacloudv1.CitaNode) []corev1.PersistentVolumeClaim
- func GetErrorLogFromPod(ctx context.Context, cli client.Client, namespace, name, jobId string) (string, error)
- func GetLogConfigName(nodeName string) string
- func GetMountPoint(path string) (string, error)
- func GetNodeLabelKeyByType(deployMethod nodepkg.DeployMethod) (string, error)
- func GetNodePortServiceName(nodeName string) string
- func GetVolumes(node *citacloudv1.CitaNode) []corev1.Volume
- func IsEqual(obj1, obj2 interface{}) bool
- func LabelsForChain(chainName string) map[string]string
- func LabelsForNode(chainName, nodeName string) map[string]string
- func MergeLabels(allLabels ...map[string]string) map[string]string
- func SetAffinity(podAffinityFlag bool, key, value string) *corev1.Affinity
- type BackupReconciler
- type BlockHeightFallbackReconciler
- type ChainNodeServiceImpl
- type ChangeOwnerReconciler
- type CitaNodeReconciler
- func (r *CitaNodeReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *CitaNodeReconciler) ReconcileAllRecourse(ctx context.Context, node *citacloudv1.CitaNode) error
- func (r *CitaNodeReconciler) ReconcileConfigMap(ctx context.Context, node *citacloudv1.CitaNode) (bool, error)
- func (r *CitaNodeReconciler) ReconcileLogConfigMap(ctx context.Context, node *citacloudv1.CitaNode) (bool, error)
- func (r *CitaNodeReconciler) ReconcileService(ctx context.Context, node *citacloudv1.CitaNode) error
- func (r *CitaNodeReconciler) ReconcileStatefulSet(ctx context.Context, node *citacloudv1.CitaNode) (*NodeValue, error)
- func (r *CitaNodeReconciler) SetDefaultStatus(ctx context.Context, node *citacloudv1.CitaNode) (bool, error)
- func (r *CitaNodeReconciler) SetStatusAndCondition(ctx context.Context, wantedStatus citacloudv1.Status, ...) error
- func (r *CitaNodeReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *CitaNodeReconciler) SyncStatus(ctx context.Context, node *citacloudv1.CitaNode) error
- type DuplicateReconciler
- type JobRbac
- type NodeService
- func (cns *NodeService) GenerateConsensusLogConfig() string
- func (cns *NodeService) GenerateControllerLogConfig() string
- func (cns *NodeService) GenerateExecutorLogConfig() string
- func (cns *NodeService) GenerateKmsLogConfig() string
- func (cns *NodeService) GenerateNetworkLogConfig() string
- func (cns *NodeService) GenerateStorageLogConfig() string
- type NodeValue
- type RecoverReconciler
- type RestoreReconciler
- type SnapshotReconciler
- type SwitchoverReconciler
Constants ¶
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 POD_NAME_ENV = "MY_POD_NAME" POD_NAMESPACE_ENV = "MY_POD_NAMESPACE" )
Variables ¶
var NodeMap sync.Map
Functions ¶
func GeneratePVC ¶
func GeneratePVC(node *citacloudv1.CitaNode) []corev1.PersistentVolumeClaim
func GetErrorLogFromPod ¶ added in v0.0.3
func GetLogConfigName ¶
GetLogConfigName get node's log config configmap name
func GetMountPoint ¶ added in v0.0.5
func GetNodeLabelKeyByType ¶ added in v0.0.2
func GetNodeLabelKeyByType(deployMethod nodepkg.DeployMethod) (string, error)
func GetNodePortServiceName ¶
GetNodePortServiceName get node's clusterIP service name
func GetVolumes ¶
func GetVolumes(node *citacloudv1.CitaNode) []corev1.Volume
func LabelsForChain ¶ added in v0.0.2
func LabelsForNode ¶
func MergeLabels ¶
MergeLabels merges all labels together and returns a new label.
Types ¶
type BackupReconciler ¶
BackupReconciler reconciles a Backup object
func (*BackupReconciler) SetupWithManager ¶
func (r *BackupReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type BlockHeightFallbackReconciler ¶
BlockHeightFallbackReconciler reconciles a BlockHeightFallback object
func (*BlockHeightFallbackReconciler) SetupWithManager ¶
func (r *BlockHeightFallbackReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type ChainNodeServiceImpl ¶
type ChangeOwnerReconciler ¶ added in v0.0.2
ChangeOwnerReconciler reconciles a ChangeOwner object
func (*ChangeOwnerReconciler) Reconcile ¶ added in v0.0.2
func (r *ChangeOwnerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the ChangeOwner object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.11.0/pkg/reconcile
func (*ChangeOwnerReconciler) SetupWithManager ¶ added in v0.0.2
func (r *ChangeOwnerReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type CitaNodeReconciler ¶
type CitaNodeReconciler struct { client.Client Scheme *runtime.Scheme Recorder record.EventRecorder }
CitaNodeReconciler reconciles a CitaNode object
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 DuplicateReconciler ¶ added in v0.0.5
DuplicateReconciler reconciles a Duplicate object
func (*DuplicateReconciler) SetupWithManager ¶ added in v0.0.5
func (r *DuplicateReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type JobRbac ¶
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 RecoverReconciler ¶ added in v0.0.5
RecoverReconciler reconciles a Recover object
func (*RecoverReconciler) SetupWithManager ¶ added in v0.0.5
func (r *RecoverReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type RestoreReconciler ¶
type RestoreReconciler struct { client.Client Scheme *runtime.Scheme // contains filtered or unexported fields }
RestoreReconciler reconciles a Restore object
func (*RestoreReconciler) SetupWithManager ¶
func (r *RestoreReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type SnapshotReconciler ¶ added in v0.0.2
SnapshotReconciler reconciles a Snapshot object
func (*SnapshotReconciler) SetupWithManager ¶ added in v0.0.2
func (r *SnapshotReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type SwitchoverReconciler ¶ added in v0.0.2
SwitchoverReconciler reconciles a Switchover object
func (*SwitchoverReconciler) SetupWithManager ¶ added in v0.0.2
func (r *SwitchoverReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
Source Files ¶
- affinity.go
- backup_controller.go
- blockheightfallback_controller.go
- cache.go
- changeowner_controller.go
- citanode_controller.go
- common.go
- configmap.go
- constant.go
- duplicate_controller.go
- job_rbac.go
- labels.go
- names.go
- node_service.go
- predicate.go
- recover_controller.go
- restore_controller.go
- service.go
- snapshot_controller.go
- statefulset.go
- switchover_controller.go
- ttl.go
- utils.go