Giter Club home page Giter Club logo

simulate-mysql-op's Introduction

simulate-mysql-op

Simulate Operations Including Create, Update and Delete to MySQL Server

database_initial

Initial MySQL database, create db_world database.

concurrency_op

Operate the database in parallel, including create, update and delete.

Demo

Just a demo to show how to use it.

MYSQL_USR_NAME=root
MYSQL_USR_PASSWD=$(kubectl get secret --namespace infra bitnami-mysql -o jsonpath="{.data.mysql-root-password}" | base64 -d)
MYSQL_SERVER_URL=bitnami-mysql-primary.infra.svc.cluster.local
MYSQL_SERVER_PORT=3306

INIT_IMAGE_NAME=registry.jingtao.fun/simulate-mysql-op/database_initial
INIT_IMAGE_ARG=test_v2

OP_IMAGE_NAME=registry.jingtao.fun/simulate-mysql-op/concurrency_op
OP_IMAGE_ARG=test_v2

cd database_initial
docker build -t ${INIT_IMAGE_NAME}:${INIT_IMAGE_ARG} ./
docker push ${INIT_IMAGE_NAME}:${INIT_IMAGE_ARG}
cd -

minikube kubectl --profile playground -- \
  delete pod simulate-mysql-initial -n infra --ignore-not-found=false

minikube kubectl --profile playground -- \
  run simulate-mysql-initial \
  --image ${INIT_IMAGE_NAME}:${INIT_IMAGE_ARG} \
  --restart=Never \
  --namespace=infra \
  --env MYSQL_USR_NAME=${MYSQL_USR_NAME} \
  --env MYSQL_USR_PASSWD=${MYSQL_USR_PASSWD} \
  --env MYSQL_SERVER_URL=${MYSQL_SERVER_URL} \
  --env MYSQL_SERVER_PORT=${MYSQL_SERVER_PORT} 

cd concurrency_op
docker build -t ${OP_IMAGE_NAME}:${OP_IMAGE_ARG} ./
docker push ${OP_IMAGE_NAME}:${OP_IMAGE_ARG}
cd -

minikube kubectl --profile playground -- \
  delete pod simulate-mysql-op -n infra --ignore-not-found=false

minikube kubectl --profile playground -- \
  run simulate-mysql-op \
  --image ${OP_IMAGE_NAME}:${OP_IMAGE_ARG} \
  --restart=Never \
  --namespace=infra \
  --env MYSQL_USR_NAME=${MYSQL_USR_NAME} \
  --env MYSQL_USR_PASSWD=${MYSQL_USR_PASSWD} \
  --env MYSQL_SERVER_URL=${MYSQL_SERVER_URL} \
  --env MYSQL_SERVER_PORT=${MYSQL_SERVER_PORT} \
  6 60
# 6 coroutines operate in parallel for 60 seconds

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.