You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "mlycore (via GitHub)" <gi...@apache.org> on 2023/05/28 09:56:16 UTC
[GitHub] [shardingsphere-on-cloud] mlycore opened a new issue, #166: [Feat] Introduce new CRD as ComputeNode for better usability
mlycore opened a new issue, #166:
URL: https://github.com/apache/shardingsphere-on-cloud/issues/166
Consider merging CRDs `ShardingSphereProxy` and `ShardingSphereProxyServerConfig` into` ComputeNode`.
Here the spec of `ComputeNode`.
--
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.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere-on-cloud] mlycore closed issue #166: [Feat] Introduce new CRD as ComputeNode for better usability
Posted by "mlycore (via GitHub)" <gi...@apache.org>.
mlycore closed issue #166: [Feat] Introduce new CRD as ComputeNode for better usability
URL: https://github.com/apache/shardingsphere-on-cloud/issues/166
--
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
[GitHub] [shardingsphere-on-cloud] mlycore commented on issue #166: WIP: [Refactor] Merge CRDs ShardingSphereProxy and ShardingSphereProxyServerConfig into ComputeNode
Posted by GitBox <gi...@apache.org>.
mlycore commented on issue #166:
URL: https://github.com/apache/shardingsphere-on-cloud/issues/166#issuecomment-1381467252
A simplified example
```yaml
apiVersion: shardingsphere.apache.org/v1alpha1
kind: ComputeNode
metadata:
labels:
app: test-cluster
name: test-cluster
namespace: oncloud-test
spec:
storageNodeConnector:
type: mysql
version: 5.1.47
serverVersion: 5.3.0
replicas: 1
selector:
matchLabels:
app: test-cluster
portBindings:
- name: server
containerPort: 3307
servicePort: 3307
protocol: TCP
serviceType: NodePort
bootstrap:
serverConfig:
authority:
privilege:
type: ALL_PERMITTED
users:
- user: root%
password: root
mode:
type: Cluster
repository:
type: ZooKeeper
props:
timeToLiveSeconds: "600"
server-lists: ss-zookeeper.operatortest:2181
retryIntervalMilliseconds: "500"
operationTimeoutMilliseconds: "5000"
namespace: governance_ds
maxRetries: "3"
props:
proxy-frontend-database-protocol-type: MySQL
```
--
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
[GitHub] [shardingsphere-on-cloud] mlycore closed issue #166: [Feat] Introduce new CRD as ComputeNode for better usability
Posted by "mlycore (via GitHub)" <gi...@apache.org>.
mlycore closed issue #166: [Feat] Introduce new CRD as ComputeNode for better usability
URL: https://github.com/apache/shardingsphere-on-cloud/issues/166
--
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
[GitHub] [shardingsphere-on-cloud] mlycore commented on issue #166: [Feat] Introduce new CRD as ComputeNode for better usability
Posted by "mlycore (via GitHub)" <gi...@apache.org>.
mlycore commented on issue #166:
URL: https://github.com/apache/shardingsphere-on-cloud/issues/166#issuecomment-1399470934
Plan to add a subresource Scale for `kubectl scale ComputeNode xxx --replicas=*` sematics.
--
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
[GitHub] [shardingsphere-on-cloud] mlycore commented on issue #166: [Refactor] Introduce new CRD as ComputeNode for better usability
Posted by GitBox <gi...@apache.org>.
mlycore commented on issue #166:
URL: https://github.com/apache/shardingsphere-on-cloud/issues/166#issuecomment-1381533053
#181 pull request
--
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
[GitHub] [shardingsphere-on-cloud] mlycore commented on issue #166: [Feat] Introduce new CRD as ComputeNode for better usability
Posted by "mlycore (via GitHub)" <gi...@apache.org>.
mlycore commented on issue #166:
URL: https://github.com/apache/shardingsphere-on-cloud/issues/166#issuecomment-1632203239
Refers to #433 . Add a `Selector` attribute which type is `string` to `ComuteNodeStatus` for HPA.
```golang
// ComputeNodeStatus defines the observed state of ShardingSphere Proxy
type ComputeNodeStatus struct {
Selector string `json:'selector"`
Replicas int32 `json:"replicas"`
// The generation observed by the deployment controller.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// ShardingSphere-Proxy phase are a brief summary of the ShardingSphere-Proxy life cycle
// There are two possible phase values:
// Ready: ShardingSphere-Proxy can already provide external services
// NotReady: ShardingSphere-Proxy cannot provide external services
// +optional
Phase ComputeNodePhaseStatus `json:"phase"`
// Conditions The conditions array, the reason and message fields
// +optional
Conditions ComputeNodeConditions `json:"conditions"`
// ReadyInstances shows the number of replicas that ShardingSphere-Proxy is running normally
// +optional
ReadyInstances int32 `json:"readyInstances"`
// LoadBalancer contains the current status of the load-balancer,
// if one is present.
// +optional
LoadBalancer LoadBalancerStatus `json:"loadBalancer,omitempty"`
}
```
--
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
[GitHub] [shardingsphere-on-cloud] mlycore commented on issue #166: WIP: [Refactor] Merge CRDs ShardingSphereProxy and ShardingSphereProxyServerConfig into ComputeNode
Posted by GitBox <gi...@apache.org>.
mlycore commented on issue #166:
URL: https://github.com/apache/shardingsphere-on-cloud/issues/166#issuecomment-1378565961
Here's an example for MySQL:
```yaml
apiVersion: shardingsphere.apache.org/v1alpha1
kind: ComputeNode
metadata:
labels:
app: test
name: test
namespace: oncloud-test
spec:
bootstrap:
logbackConfig: "<?xml version=\"1.0\"?>\n<configuration>\n <appender name=\"console\"
class=\"ch.qos.logback.core.ConsoleAppender\">\n <encoder>\n <pattern>[%-5level]
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %logger{36} - %msg%n</pattern>\n </encoder>\n
\ </appender>\n <appender name=\"sqlConsole\" class=\"ch.qos.logback.core.ConsoleAppender\">\n
\ <encoder>\n <pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS}
[%thread] [%X{database}] [%X{user}] [%X{host}] %logger{36} - %msg%n</pattern>\n
\ </encoder>\n </appender>\n \n <logger name=\"ShardingSphere-SQL\"
level=\"info\" additivity=\"false\">\n <appender-ref ref=\"sqlConsole\"
/>\n </logger>\n <logger name=\"org.apache.shardingsphere\" level=\"info\"
additivity=\"false\">\n <appender-ref ref=\"console\" />\n </logger>\n
\ \n <logger name=\"com.zaxxer.hikari\" level=\"error\" />\n \n <logger
name=\"com.atomikos\" level=\"error\" />\n \n <logger name=\"io.netty\"
level=\"error\" />\n \n <root>\n <level value=\"info\" />\n <appender-ref
ref=\"console\" />\n </root>\n</configuration> \n"
serverConfig:
authority:
privilege:
type: ALL_PERMITTED
users:
- user: root%
password: root
mode:
type: Cluster
repository:
type: ZooKeeper
props:
timeToLiveSeconds: 600
server-lists: ss-zookeeper.operatortest:2181
retryIntervalMilliseconds: 500
operationTimeoutMilliseconds: 5000
namespace: governance_ds
maxRetries: 3
props:
proxy-frontend-database-protocol-type: MySQL
version: 5.3.0
replicas: 1
connector:
type: mysql
version: 5.1.47
ports:
- name: server
containerPort: 3307
service:
type: ClusterIP
ports:
- name: server
port: 3307
targetPort: 3307
```
--
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
[GitHub] [shardingsphere-on-cloud] mlycore closed issue #166: [Feat] Introduce new CRD as ComputeNode for better usability
Posted by GitBox <gi...@apache.org>.
mlycore closed issue #166: [Feat] Introduce new CRD as ComputeNode for better usability
URL: https://github.com/apache/shardingsphere-on-cloud/issues/166
--
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
[GitHub] [shardingsphere-on-cloud] mlycore commented on issue #166: [Feat] Introduce new CRD as ComputeNode for better usability
Posted by GitBox <gi...@apache.org>.
mlycore commented on issue #166:
URL: https://github.com/apache/shardingsphere-on-cloud/issues/166#issuecomment-1397982444
Two more tasks:
[ ] Write back NodePort as Service usually do
[ ] Take NodePort/Port as Service status
--
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
[GitHub] [shardingsphere-on-cloud] mlycore commented on issue #166: [Feat] Introduce new CRD as ComputeNode for better usability
Posted by GitBox <gi...@apache.org>.
mlycore commented on issue #166:
URL: https://github.com/apache/shardingsphere-on-cloud/issues/166#issuecomment-1398091205
#187
--
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
[GitHub] [shardingsphere-on-cloud] mlycore commented on issue #166: [Feat] Introduce new CRD as ComputeNode for better usability
Posted by GitBox <gi...@apache.org>.
mlycore commented on issue #166:
URL: https://github.com/apache/shardingsphere-on-cloud/issues/166#issuecomment-1397979645
#186
--
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
[GitHub] [shardingsphere-on-cloud] mlycore commented on issue #166: [Refactor] Merge CRDs ShardingSphereProxy and ShardingSphereProxyServerConfig into ComputeNode
Posted by GitBox <gi...@apache.org>.
mlycore commented on issue #166:
URL: https://github.com/apache/shardingsphere-on-cloud/issues/166#issuecomment-1367747836
```golang
// ComputeNodeList contains a list of ShardingSphereProxy
type ComputeNodeList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ComputeNode `json:"items"`
}
// ComputeNode is the Schema for the proxies API
type ComputeNode struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ComputeNodeSpec `json:"spec,omitempty"`
Status ComputeNodeStatus `json:"status,omitempty"`
}
type PrivilegeType string
const (
AllPermitted PrivilegeType = "ALL_PERMITTED"
)
type Privilege struct {
Type PrivilegeType `json:"type"`
}
type User struct {
User string `json:"user"`
Password string `json:"password"`
}
type Authority struct {
Privilege Privilege `json:"privilege"`
Users []User `json:"users"`
}
type RepositoryType string
const (
RepositoryTypeZookeeper RepositoryType = "ZooKeeper"
RepositoryTypeEtcd RepositoryType = "Etcd"
RepositoryTypeMate RepositoryType = "Mate"
)
type Repository struct {
Type RepositoryType `json:"type"`
Properties map[string]string `json:"properties"`
}
type ModeType string
const (
ModeTypeCluster ModeType = "cluster"
ModeTypeStandalone ModeType = "memory"
)
type ServerMode struct {
Repository Repository `json:"repositoryType"`
Type ModeType `json:"type"`
Properties map[string]string `json:"properties"`
}
type ServerConfig struct {
Authority Authority `json:"authority"`
Mode ServerMode `json:"mode"`
}
type LogbackConfig struct {
}
// 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"`
}
// ServiceType defines the Service in Kubernetes of ShardingSphere-Proxy
type Service struct {
Ports []ServicePort `json:"ports,omitempty"`
// +kubebuilder:validation:Enum=ClusterIP;NodePort;LoadBalancer;ExternalName
Type v1.ServiceType `json:"type"`
}
type ProxyProbe struct {
// Probes are not allowed for ephemeral containers.
// +optional
LivenessProbe *v1.Probe `json:"livenessProbe,omitempty"`
// Probes are not allowed for ephemeral containers.
// +optional
ReadinessProbe *v1.Probe `json:"readinessProbe,omitempty" `
// Probes are not allowed for ephemeral containers.
// +optional
StartupProbe *v1.Probe `json:"startupProbe,omitempty"`
}
type JDBCType string
const (
JDBCTypeMySQL JDBCType = "mysql"
JDBCTypePostgreSQL JDBCType = "postgresql"
)
// MySQLDriver Defines the mysql-driven version in ShardingSphere-proxy
type JDBC struct {
Type: JDBCType `json:"type"`
// +kubebuilder:validation:Pattern=`^([1-9]\d|[1-9])(\.([1-9]\d|\d)){2}$`
// mysql-driven version,must be x.y.z
Version string `json:"version"`
}
// ProxySpec defines the desired state of ShardingSphereProxy
type ComputeNodeSpec struct {
ServerConfig ServerConfig `json:"serverConfig,omitempty"`
LogbackConfig LogbackConfig `json:"logbackConfig,omitempty"`
// +optional
AutomaticScaling *AutomaticScaling `json:"automaticScaling,omitempty"`
//Replicas is the expected number of replicas of ShardingSphere-Proxy
Replicas int32 `json:"replicas"`
Probes ProxyProbe `json:"probes"`
Service Service `json:"serviceType"`
// +optional
JDBC *JDBC `json:"jdbc,omitempty"`
// Version is the version of ShardingSphere-Proxy
Version string `json:"version"`
// +optional
ImagePullSecrets []v1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
//Port is ShardingSphere-Proxy startup port
Ports []corev1.Port `json:"ports"`
Env []corev1.EnvVar `json:"env"`
// +optional
Resources v1.ResourceRequirements `json:"resources,omitempty"`
}
```
--
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
[GitHub] [shardingsphere-on-cloud] mlycore commented on issue #166: WIP: [Refactor] Merge CRDs ShardingSphereProxy and ShardingSphereProxyServerConfig into ComputeNode
Posted by GitBox <gi...@apache.org>.
mlycore commented on issue #166:
URL: https://github.com/apache/shardingsphere-on-cloud/issues/166#issuecomment-1381466681
ComputeNodeStatus
```golang
// ComputeNodeStatus defines the observed state of ShardingSphere Proxy
type ComputeNodeStatus struct {
// The generation observed by the deployment controller.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// ShardingSphere-Proxy phase are a brief summary of the ShardingSphere-Proxy life cycle
// There are two possible phase values:
// Ready: ShardingSphere-Proxy can already provide external services
// NotReady: ShardingSphere-Proxy cannot provide external services
// +optional
Phase ComputeNodePhaseStatus `json:"phase"`
// Conditions The conditions array, the reason and message fields
// +optional
Conditions ComputeNodeConditions `json:"conditions"`
// ReadyInstances shows the number of replicas that ShardingSphere-Proxy is running normally
// +optional
ReadyInstances int32 `json:"readyInstances"`
// LoadBalancer contains the current status of the load-balancer,
// if one is present.
// +optional
LoadBalancer LoadBalancerStatus `json:"loadBalancer,omitempty"`
}
type LoadBalancerStatus struct {
// +optional
ClusterIP string `json:"clusterIP,omitempty"`
// Ingress is a list containing ingress points for the load-balancer.
// Traffic intended for the service should be sent to these ingress points.
// +optional
Ingress []corev1.LoadBalancerIngress `json:"ingress,omitempty"`
}
type ComputeNodePhaseStatus string
const (
ComputeNodeStatusReady ComputeNodePhaseStatus = "Ready"
ComputeNodeStatusNotReady ComputeNodePhaseStatus = "NotReady"
)
type ComputeNodeConditionType string
// ComputeNodeConditionType shows some states during the startup process of ShardingSphere-Proxy
const (
ComputeNodeConditionInitialized ComputeNodeConditionType = "Initialized"
ComputeNodeConditionStarted ComputeNodeConditionType = "Started"
ComputeNodeConditionReady ComputeNodeConditionType = "Ready"
ComputeNodeConditionUnknown ComputeNodeConditionType = "Unknown"
ComputeNodeConditionDeployed ComputeNodeConditionType = "Deployed"
ComputeNodeConditionFailed ComputeNodeConditionType = "Failed"
)
type ComputeNodeConditions []ComputeNodeCondition
type ConditionStatus string
const (
ConditionStatusTrue = "True"
ConditionStatusFalse = "False"
ConditionStatusUnknown = "Unknown"
)
// ComputeNodeCondition
// | **phase** | **condition** | **descriptions**|
// | ------------- | ---------- | ---------------------------------------------------- |
// | NotReady | Deployed | pods are deployed but are not created or currently pending|
// | NotReady | Started | pods are started but not satisfy ready requirements|
// | Ready | Ready | minimum pods satisfy ready requirements|
// | NotReady | Unknown | can not locate the status of pods |
// | NotReady | Failed | ShardingSphere-Proxy failed to start correctly due to some problems|
type ComputeNodeCondition struct {
Type ComputeNodeConditionType `json:"type"`
Status ConditionStatus `json:"status"`
LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
Reason string `json:"reason"`
Message string `json:"message"`
}
```
--
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
[GitHub] [shardingsphere-on-cloud] mlycore commented on issue #166: [Feat] Introduce new CRD as ComputeNode for better usability
Posted by "mlycore (via GitHub)" <gi...@apache.org>.
mlycore commented on issue #166:
URL: https://github.com/apache/shardingsphere-on-cloud/issues/166#issuecomment-1566055658
Update ComputeNodeConditions
```go
type ComputeNodePhaseStatus string
const (
ComputeNodeStatusReady ComputeNodePhaseStatus = "Ready"
ComputeNodeStatusNotReady ComputeNodePhaseStatus = "NotReady"
ComputeNodeStatusUnknown ComputeNodePhaseStatus = "Unknown"
)
type ComputeNodeConditionType string
// ComputeNodeConditionType shows some states during the startup process of ShardingSphere-Proxy
const (
ComputeNodeConditionInitialized ComputeNodeConditionType = "Initialized"
ComputeNodeConditionStarted ComputeNodeConditionType = "Started"
ComputeNodeConditionReady ComputeNodeConditionType = "Ready"
ComputeNodeConditionUnknown ComputeNodeConditionType = "Unknown"
ComputeNodeConditionDeployed ComputeNodeConditionType = "Deployed"
ComputeNodeConditionFailed ComputeNodeConditionType = "Failed"
ComputeNodeConditionPending ComputeNodeConditionType = "Pending"
ComputeNodeConditionSucceed ComputeNodeConditionType = "Succeed"
)
type ConditionStatus string
const (
ConditionStatusTrue = "True"
ConditionStatusFalse = "False"
ConditionStatusUnknown = "Unknown"
)
type ComputeNodeCondition struct {
Type ComputeNodeConditionType `json:"type"`
Status ConditionStatus `json:"status"`
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
Reason string `json:"reason"`
Message string `json:"message"`
}
```
--
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