-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support deploy ros with s3 and mysql in cluster
Signed-off-by: wangxye <xuanyewang.cs@gmail.com>
- Loading branch information
Showing
9 changed files
with
209 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
FROM openjdk:17-jdk-alpine | ||
|
||
MAINTAINER automq | ||
|
||
USER root | ||
|
||
# Install dependency | ||
# RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories | ||
RUN apk add --no-cache bash gettext nmap-ncat openssl busybox-extras libc6-compat libgcc libstdc++ | ||
|
||
|
||
ARG version | ||
|
||
# Rocketmq version | ||
ENV ROCKETMQ_VERSION ${version} | ||
|
||
ARG ROCKETMQ_DIR | ||
|
||
ENV ROCKETMQ_NAME rocketmq-on-s3 | ||
ENV ROCKETMQ_HOME /home/rocketmq/${ROCKETMQ_NAME}-${ROCKETMQ_VERSION} | ||
|
||
WORKDIR ${ROCKETMQ_HOME} | ||
|
||
# Install | ||
COPY rocketmq/ ${ROCKETMQ_HOME}/dist | ||
|
||
RUN mv ${ROCKETMQ_HOME}/dist/* ${ROCKETMQ_HOME}/ && \ | ||
rm -rf ${ROCKETMQ_HOME}/dist | ||
|
||
EXPOSE 8081 | ||
|
||
RUN chmod a+x ${ROCKETMQ_HOME}/bin/run-server.sh | ||
|
||
# Export Java options | ||
RUN export JAVA_OPT=" -Duser.home=/opt" | ||
|
||
WORKDIR ${ROCKETMQ_HOME}/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
ROCKETMQ_VERSION=$1 | ||
ROCKETMQ_REPO=$2 | ||
|
||
cp -r ../../rocketmq ./ | ||
|
||
|
||
docker build --no-cache -f Dockerfile -t ${ROCKETMQ_REPO}:${ROCKETMQ_VERSION} --build-arg version=${ROCKETMQ_VERSION} . --progress=plain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
helm uninstall s3-localstack | ||
helm uninstall mysql | ||
helm uninstall rocketmq-on-s3 | ||
|
||
kubectl delete -f deploy/init-db-configmap.yaml | ||
rm deploy/init-db-configmap.yaml | ||
rm deploy/ddl.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,53 @@ | ||
#!/bin/bash | ||
# echo $KUBE_CONFIG_DATA | base64 -d > ./config | ||
|
||
# DB_SCRIPTS=$1 | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
REPO_DIR=$(dirname "$(dirname "$SCRIPT_DIR")") | ||
export $REPO_DIR | ||
cd "$SCRIPT_DIR" || exit 1 | ||
if [ ! -f "deploy/ddl.sql" ] | ||
then | ||
cp "$REPO_DIR/controller/src/main/resources/ddl.sql" deploy/ | ||
fi | ||
|
||
# make ddl to configmap | ||
if [ ! -f "deploy/init-db-configmap.yaml" ] | ||
then | ||
cp deploy/configmap-template.yaml deploy/init-db-configmap.yaml | ||
sed 's/^/ /' deploy/ddl.sql >> deploy/init-db-configmap.yaml | ||
fi | ||
|
||
kubectl apply -f deploy/init-db-configmap.yaml | ||
|
||
echo "Deploying s3-localstack..." | ||
# deploy s3-localstack | ||
helm repo add localstack-charts https://localstack.github.io/helm-charts | ||
helm install s3-localstack localstack-charts/localstack -f deploy/localstack_s3.yaml | ||
# --kubeconfig ./config | ||
helm install s3-localstack localstack-charts/localstack -f deploy/localstack_s3.yaml | ||
|
||
sleep 10 | ||
|
||
echo "Deploying MySQL..." | ||
# deploy mysql | ||
helm repo add bitnami https://charts.bitnami.com/bitnami | ||
|
||
helm install mysql bitnami/mysql -f deploy/mysql.yaml | ||
|
||
sleep 10 | ||
echo "Deploying rocketmq..." | ||
# deploy rocketmq-on-s3 | ||
helm install rocketmq-on-s3 ../rocketmq-k8s-helm/ -f deploy/helm_sample_values.yaml | ||
helm install rocketmq-on-s3 . -f deploy/helm_sample_values.yaml | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: mysql-initdb-config | ||
data: | ||
initdb.sql: | | ||
use metadata; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.