You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/12/30 06:14:24 UTC

[GitHub] [shardingsphere-on-cloud] mlycore commented on issue #167: [New Feature] Introduce new CRD Cluster

mlycore commented on issue #167:
URL: https://github.com/apache/shardingsphere-on-cloud/issues/167#issuecomment-1367746645

   ```golang
   type ClusterList struct {
           metav1.TypeMeta `json:",inline"`
           metav1.ListMeta `json:"metadata,omitempty"`
           Items           []Cluster `json:"items"`
   }
   
   type Cluster struct {
           metav1.TypeMeta   `json:",inline"`
           metav1.ObjectMeta `json:"metadata,omitempty"`
   
           Spec   ClusterSpec   `json:"spec,omitempty"`
           Status ClusterStatus `json:"status,omitempty"`
   }
   
   type GovernanceProvider string
   const (
           GovernanceProviderZooKeeper GovernanceProvider = "zookeeper"
           GovernanceProviderEtcd GovernanceProvider = "etcd"
           GovernanceProviderMate GovernandeProvider = "mate"
   )
   
   type GovernanceSpec struct {
           Provider GovernanceProvider `json:"provider"`
           *Zookeeper `json:"zookeeper"`
           *Etcd `json:"etcd"`
           *Mate `json:"mate"`
   }
   
   type GovernanceConfig struct {
           Name string `json:"name"`
           Spec GovernanceSpec `json:"spec"`
   }
   
   // AutomaticScaling HPA configuration
   type AutomaticScaling struct {
           // +optional
           ScaleUpWindows int32 `json:"scaleUpWindows,omitempty"`
           // +optional
           ScaleDownWindows int32 `json:"scaleDownWindows,omitempty"`
           // +optional
           Target int32 `json:"target,omitempty"`
           // +optional
           MaxInstance int32 `json:"maxInstance,omitempty"`
           // +optional
           MinInstance int32 `json:"minInstance,omitempty"`
           // +optional
           CustomMetrics []autoscalingv2beta2.MetricSpec `json:"customMetrics,omitempty"`
   }
   
   type ComputeNodeTemplate struct {
           Spec ComputeNodeSpec `json:"spec"`
   }
   
   type ComputeConfig struct {
           Replicas int32 `json:"replicas"`
           AutomaticScaling AutomaticScaling `json:"automicScaling"`
           Template  ComputeNodeTemplate `json:"template"`
   }
   
   type StorageConfig struct {
           DatabaseClassName string `json:"databaseClassName"`
   }
   
   type Topology struct {
           Governance GovernanceConfig `json:"governance"`
           Compute ComputeConfig `json:"compute"`
           Storage StorageConfig `json:"storage"`
   }
   
   type ClusterSpec struct {
           RepoNamespace string `json:"repoNamespace"`
           ClusterTopology Topology `json:"topology"`
   }
   
   type ClusterStatus struct {}
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org