diff --git a/chart/stardb-proxy/Chart.yaml b/chart/stardb-proxy/Chart.yaml index 55902bb6a80719..e273e4b792e3c8 100644 --- a/chart/stardb-proxy/Chart.yaml +++ b/chart/stardb-proxy/Chart.yaml @@ -19,15 +19,4 @@ apiVersion: v2 appVersion: 5.3.2 name: stardb-proxy version: 0.16.0 -#maintainers: -# - name: dev@shardingsphere.apache.org -#dependencies: -# - condition: governance.enabled -# name: governance -# repository: file://./charts/governance -# version: 1.x.x -# - name: common -# repository: https://charts.bitnami.com/bitnami -# tags: -# - bitnami-common -# version: 1.x.x + diff --git a/chart/stardb-proxy/templates/statefulset.yaml b/chart/stardb-proxy/templates/statefulset.yaml index 86be3411333048..2efa18923a7fb5 100644 --- a/chart/stardb-proxy/templates/statefulset.yaml +++ b/chart/stardb-proxy/templates/statefulset.yaml @@ -78,6 +78,8 @@ spec: env: - name: PORT value: "{{ .Values.compute.startPort }}" + - name: WITH_AGENT + value: "{{ .Values.compute.agent.enabled }}" ports: - name: start-port containerPort: {{ .Values.compute.startPort }} diff --git a/chart/stardb-proxy/values.yaml b/chart/stardb-proxy/values.yaml index 01d576cc95fe9b..55d32c3c5b110b 100644 --- a/chart/stardb-proxy/values.yaml +++ b/chart/stardb-proxy/values.yaml @@ -15,72 +15,35 @@ # limitations under the License. # -## @section Governance-Node parameters -## @param governance.enabled Switch to enable or disable the governance helm chart -## governance: enabled: true - ## @section Governance-Node ZooKeeper parameters zookeeper: - ## @param governance.zookeeper.enabled Switch to enable or disable the ZooKeeper helm chart - ## enabled: true - ## @param governance.zookeeper.replicaCount Number of ZooKeeper nodes - ## replicaCount: 3 - ## ZooKeeper Persistence parameters - ## ref: https://kubernetes.io/docs/user-guide/persistent-volumes/ - ## @param governance.zookeeper.persistence.enabled Enable persistence on ZooKeeper using PVC(s) - ## @param governance.zookeeper.persistence.storageClass Persistent Volume storage class - ## @param governance.zookeeper.persistence.accessModes Persistent Volume access modes - ## @param governance.zookeeper.persistence.size Persistent Volume size - ## persistence: enabled: false storageClass: "" accessModes: - ReadWriteOnce size: 8Gi - ## ZooKeeper's resource requests and limits - ## ref: https://kubernetes.io/docs/user-guide/compute-resources/ - ## @param governance.zookeeper.resources.limits The resources limits for the ZooKeeper containers - ## @param governance.zookeeper.resources.requests.memory The requested memory for the ZooKeeper containers - ## @param governance.zookeeper.resources.requests.cpu The requested cpu for the ZooKeeper containers - ## resources: limits: {} requests: memory: 4Gi cpu: 2 -## @section Compute-Node parameters -## compute: clusterName: wzm namespace: wzm-test - ## @section Compute-Node ShardingSphere-Proxy parameters - ## ref: https://kubernetes.io/docs/concepts/containers/images/ - ## @param compute.image.repository Image name of ShardingSphere-Proxy. - ## @param compute.image.pullPolicy The policy for pulling ShardingSphere-Proxy image - ## @param compute.image.tag ShardingSphere-Proxy image tag - ## image: repository: "jvesselv2-dockerhub-test.jdcloud.com/stardb/stardb" hub: "jvesselv2-dockerhub-test.jdcloud.com" pullPolicy: IfNotPresent - ## Overrides the image tag whose default is the chart appVersion. - ## tag: "5.3.2" imagePullSecrets: name: jvessel-secret user: passwd: - ## ShardingSphere-Proxy resource requests and limits - ## ref: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - ## @param compute.resources.limits The resources limits for the ShardingSphere-Proxy containers - ## @param compute.resources.requests.memory The requested memory for the ShardingSphere-Proxy containers - ## @param compute.resources.requests.cpu The requested cpu for the ShardingSphere-Proxy containers - ## resources: requests: cpu: 2 @@ -88,65 +51,23 @@ compute: limits: cpu: 4 memory: 4Gi - ## ShardingSphere-Proxy Deployment Configuration - ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ - ## ref: https://kubernetes.io/docs/concepts/services-networking/service/ - ## @param compute.replicas Number of cluster replicas - ## replicas: 3 - ## @param compute.service.type ShardingSphere-Proxy network mode - ## @param compute.service.port ShardingSphere-Proxy expose port - ## service: type: LoadBalancer port: 3307 - ## MySQL connector Configuration - ## ref: https://shardingsphere.apache.org/document/current/en/quick-start/shardingsphere-proxy-quick-start/ - ## @param compute.mysqlConnector.version MySQL connector version - ## # mysqlConnector: # version: "" - ## @param compute.startPort ShardingSphere-Proxy start port - ## ShardingSphere-Proxy start port - ## ref: https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-proxy/startup/docker/ - ## startPort: 3307 -# agent: -# enabled: true + agent: + enabled: true # terminationGracePeriodSeconds: 30 - ## @section Compute-Node ShardingSphere-Proxy ServerConfiguration parameters - ## NOTE: If you use the sub-charts to deploy Zookeeper, the server-lists field must be "{{ printf \"%s-zookeeper.%s:2181\" .Release.Name .Release.Namespace }}", - ## otherwise please fill in the correct zookeeper address - ## The server.yaml is auto-generated based on this parameter. - ## If it is empty, the server.yaml is also empty. - ## ref: https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/yaml-config/mode/ - ## ref: https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/builtin-algorithm/metadata-repository/ - ## serverConfig: - ## @section Compute-Node ShardingSphere-Proxy ServerConfiguration authority parameters - ## NOTE: It is used to set up initial user to login compute node, and authority data of storage node. - ## ref: https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-proxy/yaml-config/authentication/ - ## @param compute.serverConfig.authority.privilege.type authority provider for storage node, the default value is ALL_PERMITTED - ## @param compute.serverConfig.authority.users[0].password Password for compute node. - ## @param compute.serverConfig.authority.users[0].user Username,authorized host for compute node. Format: @ hostname is % or empty string means do not care about authorized host - ## # authority: # privilege: # type: ALL_PERMITTED # users: # - password: root # user: root@% - ## @section Compute-Node ShardingSphere-Proxy ServerConfiguration mode Configuration parameters - ## @param compute.serverConfig.mode.type Type of mode configuration. Now only support Cluster mode - ## @param compute.serverConfig.mode.repository.props.namespace Namespace of registry center - ## @param compute.serverConfig.mode.repository.props.server-lists Server lists of registry center - ## @param compute.serverConfig.mode.repository.props.maxRetries Max retries of client connection - ## @param compute.serverConfig.mode.repository.props.operationTimeoutMilliseconds Milliseconds of operation timeout - ## @param compute.serverConfig.mode.repository.props.retryIntervalMilliseconds Milliseconds of retry interval - ## @param compute.serverConfig.mode.repository.props.timeToLiveSeconds Seconds of ephemeral data live - ## @param compute.serverConfig.mode.repository.type Type of persist repository. Now only support ZooKeeper - ## @param compute.serverConfig.mode.overwrite Whether overwrite persistent configuration with local configuration - ## # mode: # repository: # props: diff --git a/distribution/proxy/dockerfile/Dockerfile b/distribution/proxy/dockerfile/Dockerfile index b92c07af13b527..f5940adb175871 100644 --- a/distribution/proxy/dockerfile/Dockerfile +++ b/distribution/proxy/dockerfile/Dockerfile @@ -19,6 +19,7 @@ ARG RUNTIME_IMAGE=hub.jdcloud.com/stardb/openjdk-amd64:17 FROM ${BUILD_IMAGE} AS prepare ARG APP_NAME="stardb-proxy-bin-5.3.2" +ARG AGENT_NAME="stardb-agent-bin-5.3.2" ARG WORK_DIR="/usr/src/mymaven" ENV LOCAL_PATH="/opt/stardb-proxy" @@ -31,6 +32,9 @@ WORKDIR /usr/src/mymaven/distribution/proxy/target RUN tar -zxvf ${APP_NAME}.tar.gz -C /opt RUN mv /opt/${APP_NAME} ${LOCAL_PATH} && mkdir -p ${LOCAL_PATH}/ext-lib +RUN tar -zxvf ${AGENT_NAME}.tar.gz -C /opt +RUN mkdir -p ${LOCAL_PATH}/agent && mv /opt/${AGENT_NAME} ${LOCAL_PATH}/agent + FROM ${RUNTIME_IMAGE} LABEL maintainer="zhangjunjie64@jd.com" diff --git a/distribution/proxy/dockerfile/Dockerfile-openeuler22-amd64 b/distribution/proxy/dockerfile/Dockerfile-openeuler22-amd64 index 02da8441c2b26f..cadc4cccc35ca5 100644 --- a/distribution/proxy/dockerfile/Dockerfile-openeuler22-amd64 +++ b/distribution/proxy/dockerfile/Dockerfile-openeuler22-amd64 @@ -19,6 +19,7 @@ ARG RUNTIME_IMAGE=hub.jdcloud.com/stardb/openjdk-amd64:17 FROM ${BUILD_IMAGE} AS prepare ARG APP_NAME="stardb-proxy-bin-5.3.2" +ARG AGENT_NAME="stardb-agent-bin-5.3.2" ARG WORK_DIR="/usr/src/mymaven" ENV LOCAL_PATH="/opt/stardb-proxy" @@ -31,6 +32,9 @@ WORKDIR /usr/src/mymaven/distribution/proxy/target RUN tar -zxvf ${APP_NAME}.tar.gz -C /opt RUN mv /opt/${APP_NAME} ${LOCAL_PATH} && mkdir -p ${LOCAL_PATH}/ext-lib +RUN tar -zxvf ${AGENT_NAME}.tar.gz -C /opt +RUN mkdir -p ${LOCAL_PATH}/agent && mv /opt/${AGENT_NAME} ${LOCAL_PATH}/agent + FROM ${RUNTIME_IMAGE} LABEL maintainer="zhangjunjie64@jd.com" diff --git a/distribution/proxy/dockerfile/Dockerfile-openeuler22-arm64 b/distribution/proxy/dockerfile/Dockerfile-openeuler22-arm64 index 60c17661f8fa01..9cc032fc4ec9ba 100644 --- a/distribution/proxy/dockerfile/Dockerfile-openeuler22-arm64 +++ b/distribution/proxy/dockerfile/Dockerfile-openeuler22-arm64 @@ -19,6 +19,7 @@ ARG RUNTIME_IMAGE=hub.jdcloud.com/stardb/openjdk-arm64:17 FROM ${BUILD_IMAGE} AS prepare ARG APP_NAME="stardb-proxy-bin-5.3.2" +ARG AGENT_NAME="stardb-agent-bin-5.3.2" ARG WORK_DIR="/usr/src/mymaven" ENV LOCAL_PATH="/opt/stardb-proxy" @@ -31,6 +32,9 @@ WORKDIR /usr/src/mymaven/distribution/proxy/target RUN tar -zxvf ${APP_NAME}.tar.gz -C /opt RUN mv /opt/${APP_NAME} ${LOCAL_PATH} && mkdir -p ${LOCAL_PATH}/ext-lib +RUN tar -zxvf ${AGENT_NAME}.tar.gz -C /opt +RUN mkdir -p ${LOCAL_PATH}/agent && mv /opt/${AGENT_NAME} ${LOCAL_PATH}/agent + FROM ${RUNTIME_IMAGE} LABEL maintainer="zhangjunjie64@jd.com" diff --git a/distribution/proxy/src/main/resources/bin/start.sh b/distribution/proxy/src/main/resources/bin/start.sh index 4c21f7be480243..938c23f28ac8d2 100644 --- a/distribution/proxy/src/main/resources/bin/start.sh +++ b/distribution/proxy/src/main/resources/bin/start.sh @@ -95,8 +95,6 @@ fi JAVA_MEM_OPTS=" -server ${JAVA_MEM_COMMON_OPTS} -Xss1m -XX:AutoBoxCacheMax=4096 -XX:+UseNUMA -XX:+DisableExplicitGC -XX:LargePageSizeInBytes=128m ${VERSION_OPTS} -Dio.netty.leakDetection.level=DISABLED " - - MAIN_CLASS=org.apache.shardingsphere.proxy.Bootstrap unset -v PORT @@ -158,7 +156,7 @@ PARAMETER_INDEX=0 PARAMETERS=( $* ) for arg in $* do - if [ "$arg" == "-g" ] || [ "$arg" == "--agent" ] ; then + if [ "$arg" == "-g" ] || [ "$arg" == "--agent" ] || [ -n "${WITH_AGENT}" ]; then set_agent_name set_agent_parameter unset PARAMETERS[PARAMETER_INDEX]