Documentation ¶
Index ¶
- Constants
- func DiffObject(old, new client.Object) ([]byte, error)
- func GeneratePVC(chainNode *citacloudv1.ChainNode) []corev1.PersistentVolumeClaim
- func GetAccountCertAndKeySecretName(account string) string
- func GetAccountConfigmap(account string) string
- func GetCaSecretName(chainName string) string
- func GetLogConfigName(nodeName string) string
- func GetNodeConfigName(nodeName string) string
- func GetNodePortServiceName(nodeName string) string
- func GetVolumes(chainNode *citacloudv1.ChainNode) []corev1.Volume
- func IsEqual(obj1, obj2 interface{}) bool
- func LabelsForChain(name string) map[string]string
- func LabelsForNode(chainName, nodeName string) map[string]string
- func MergeLabels(allLabels ...map[string]string) map[string]string
- type AccountReconciler
- type ChainConfigReconciler
- func (r *ChainConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *ChainConfigReconciler) SetDefaultSpec(chainConfig *citacloudv1.ChainConfig) error
- func (r *ChainConfigReconciler) SetDefaultStatus(ctx context.Context, chainConfig *citacloudv1.ChainConfig) (bool, error)
- func (r *ChainConfigReconciler) SetupWithManager(mgr ctrl.Manager) error
- type ChainNodeReconciler
- func (r *ChainNodeReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *ChainNodeReconciler) ReconcileAllRecourse(ctx context.Context, chainConfig *citacloudv1.ChainConfig, ...) error
- func (r *ChainNodeReconciler) ReconcileConfigMap(ctx context.Context, chainConfig *citacloudv1.ChainConfig, ...) (bool, error)
- func (r *ChainNodeReconciler) ReconcileLogConfigMap(ctx context.Context, chainConfig *citacloudv1.ChainConfig, ...) (bool, error)
- func (r *ChainNodeReconciler) ReconcileService(ctx context.Context, chainConfig *citacloudv1.ChainConfig, ...) error
- func (r *ChainNodeReconciler) ReconcileStatefulSet(ctx context.Context, chainConfig *citacloudv1.ChainConfig, ...) (bool, error)
- func (r *ChainNodeReconciler) SetDefaultSpec(ctx context.Context, chainConfig *citacloudv1.ChainConfig, ...) error
- func (r *ChainNodeReconciler) SetDefaultStatus(ctx context.Context, chainNode *citacloudv1.ChainNode) (bool, error)
- func (r *ChainNodeReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *ChainNodeReconciler) SyncRunningStatus(ctx context.Context, chainConfig *citacloudv1.ChainConfig, ...) error
- func (r *ChainNodeReconciler) SyncStopStatus(ctx context.Context, chainNode *citacloudv1.ChainNode) error
- type ChainNodeService
- func NewChainNodeServiceForLog(chainConfig *citacloudv1.ChainConfig, chainNode *citacloudv1.ChainNode) *ChainNodeService
- func NewChainNodeServiceForP2P(chainConfig *citacloudv1.ChainConfig, chainNode *citacloudv1.ChainNode, ...) *ChainNodeService
- func NewChainNodeServiceForTls(chainConfig *citacloudv1.ChainConfig, chainNode *citacloudv1.ChainNode, ...) *ChainNodeService
- func (cns *ChainNodeService) GenerateConsensusLogConfig() string
- func (cns *ChainNodeService) GenerateControllerLogConfig() string
- func (cns *ChainNodeService) GenerateExecutorLogConfig() string
- func (cns *ChainNodeService) GenerateKmsLogConfig() string
- func (cns *ChainNodeService) GenerateNetworkLogConfig() string
- func (cns *ChainNodeService) GenerateNodeConfig() string
- func (cns *ChainNodeService) GenerateStorageLogConfig() string
- type ChainNodeServiceImpl
Constants ¶
View Source
const ( NetworkContainer = "network" ConsensusContainer = "consensus" ExecutorContainer = "executor" StorageContainer = "storage" ControllerContainer = "controller" KmsContainer = "kms" AccountVolumeName = "account" AccountVolumeMountPath = "/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 NetworkRPCPort = 50000 ConsensusRPCPort = 50001 ExecutorRPCPort = 50002 StorageRPCPort = 50003 ControllerRPCPort = 50004 KmsRPCPort = 50005 CaCert = "cert.pem" CaKey = "key.pem" NodeCert = "cert.pem" NodeCsr = "csr.pem" NodeKey = "key.pem" )
Variables ¶
This section is empty.
Functions ¶
func GeneratePVC ¶
func GeneratePVC(chainNode *citacloudv1.ChainNode) []corev1.PersistentVolumeClaim
func GetAccountConfigmap ¶
func GetCaSecretName ¶
func GetLogConfigName ¶
GetLogConfigName get node's log config configmap name
func GetNodeConfigName ¶
GetNodeConfigName get node's config configmap name
func GetNodePortServiceName ¶
GetNodePortServiceName get node's clusterIP service name
func GetVolumes ¶
func GetVolumes(chainNode *citacloudv1.ChainNode) []corev1.Volume
func LabelsForChain ¶
func LabelsForNode ¶
Types ¶
type AccountReconciler ¶
AccountReconciler reconciles a Account object
func (*AccountReconciler) SetupWithManager ¶
func (r *AccountReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type ChainConfigReconciler ¶
ChainConfigReconciler reconciles a ChainConfig object
func (*ChainConfigReconciler) SetDefaultSpec ¶
func (r *ChainConfigReconciler) SetDefaultSpec(chainConfig *citacloudv1.ChainConfig) error
func (*ChainConfigReconciler) SetDefaultStatus ¶
func (r *ChainConfigReconciler) SetDefaultStatus(ctx context.Context, chainConfig *citacloudv1.ChainConfig) (bool, error)
func (*ChainConfigReconciler) SetupWithManager ¶
func (r *ChainConfigReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type ChainNodeReconciler ¶
type ChainNodeReconciler struct { client.Client Scheme *runtime.Scheme // contains filtered or unexported fields }
ChainNodeReconciler reconciles a ChainNode object
func (*ChainNodeReconciler) ReconcileAllRecourse ¶
func (r *ChainNodeReconciler) ReconcileAllRecourse(ctx context.Context, chainConfig *citacloudv1.ChainConfig, chainNode *citacloudv1.ChainNode) error
func (*ChainNodeReconciler) ReconcileConfigMap ¶
func (r *ChainNodeReconciler) ReconcileConfigMap(ctx context.Context, chainConfig *citacloudv1.ChainConfig, chainNode *citacloudv1.ChainNode) (bool, error)
func (*ChainNodeReconciler) ReconcileLogConfigMap ¶
func (r *ChainNodeReconciler) ReconcileLogConfigMap(ctx context.Context, chainConfig *citacloudv1.ChainConfig, chainNode *citacloudv1.ChainNode) (bool, error)
func (*ChainNodeReconciler) ReconcileService ¶
func (r *ChainNodeReconciler) ReconcileService(ctx context.Context, chainConfig *citacloudv1.ChainConfig, chainNode *citacloudv1.ChainNode) error
func (*ChainNodeReconciler) ReconcileStatefulSet ¶
func (r *ChainNodeReconciler) ReconcileStatefulSet(ctx context.Context, chainConfig *citacloudv1.ChainConfig, chainNode *citacloudv1.ChainNode) (bool, error)
ReconcileStatefulSet if statefulset update, then should return true for sync status
func (*ChainNodeReconciler) SetDefaultSpec ¶
func (r *ChainNodeReconciler) SetDefaultSpec(ctx context.Context, chainConfig *citacloudv1.ChainConfig, chainNode *citacloudv1.ChainNode) error
func (*ChainNodeReconciler) SetDefaultStatus ¶
func (r *ChainNodeReconciler) SetDefaultStatus(ctx context.Context, chainNode *citacloudv1.ChainNode) (bool, error)
func (*ChainNodeReconciler) SetupWithManager ¶
func (r *ChainNodeReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
func (*ChainNodeReconciler) SyncRunningStatus ¶
func (r *ChainNodeReconciler) SyncRunningStatus(ctx context.Context, chainConfig *citacloudv1.ChainConfig, chainNode *citacloudv1.ChainNode) error
SyncRunningStatus 如果status == Initialized,则判断当前pod的ready
func (*ChainNodeReconciler) SyncStopStatus ¶
func (r *ChainNodeReconciler) SyncStopStatus(ctx context.Context, chainNode *citacloudv1.ChainNode) error
type ChainNodeService ¶
type ChainNodeService struct { ChainConfig *citacloudv1.ChainConfig ChainNode *citacloudv1.ChainNode Account *citacloudv1.Account CaSecret *corev1.Secret NodeCertAndKeySecret *corev1.Secret }
func NewChainNodeServiceForLog ¶
func NewChainNodeServiceForLog(chainConfig *citacloudv1.ChainConfig, chainNode *citacloudv1.ChainNode) *ChainNodeService
func NewChainNodeServiceForP2P ¶
func NewChainNodeServiceForP2P(chainConfig *citacloudv1.ChainConfig, chainNode *citacloudv1.ChainNode, account *citacloudv1.Account) *ChainNodeService
func NewChainNodeServiceForTls ¶
func NewChainNodeServiceForTls(chainConfig *citacloudv1.ChainConfig, chainNode *citacloudv1.ChainNode, account *citacloudv1.Account, caSecret, nodeCertAndKeySecret *corev1.Secret) *ChainNodeService
func (*ChainNodeService) GenerateConsensusLogConfig ¶
func (cns *ChainNodeService) GenerateConsensusLogConfig() string
func (*ChainNodeService) GenerateControllerLogConfig ¶
func (cns *ChainNodeService) GenerateControllerLogConfig() string
func (*ChainNodeService) GenerateExecutorLogConfig ¶
func (cns *ChainNodeService) GenerateExecutorLogConfig() string
func (*ChainNodeService) GenerateKmsLogConfig ¶
func (cns *ChainNodeService) GenerateKmsLogConfig() string
func (*ChainNodeService) GenerateNetworkLogConfig ¶
func (cns *ChainNodeService) GenerateNetworkLogConfig() string
func (*ChainNodeService) GenerateNodeConfig ¶
func (cns *ChainNodeService) GenerateNodeConfig() string
func (*ChainNodeService) GenerateStorageLogConfig ¶
func (cns *ChainNodeService) GenerateStorageLogConfig() string
type ChainNodeServiceImpl ¶
Click to show internal directories.
Click to hide internal directories.