Giter VIP home page Giter VIP logo

k8s-seckill's Introduction

部署秒杀服务

1、部署 MySQL、Redis(数据库节点单独部署)

请按照 ./database/readme.md 执行

2、Kubernetes 集群节点部署

    git clone https://github.com/usoftglobal/k8s-seckill.git

2.1、制作秒杀服务镜像

请按照 ./image/readme.md 执行

2.2、部署秒杀集群

    cd k8s-seckill

    # 修改部署
    # image 改为你推送的远程地址如(registry.cn-shanghai.aliyuncs.com/usoftglobal/seckill:1.0.0)
    # replicas 按照实际集群规模修改
    vim seckill-deployment.yaml

    # 执行部署
    kubectl apply -f seckill-deployment.yaml

    # 查看 pod 状态,Running 正常
    kubectl get pods

    # 查看外部端口
    kubectl get services

    # 结果如下
    # NAME         TYPE        CLUSTER-IP    EXTERNAL-IP   PORT(S)          AGE
    # kubernetes   ClusterIP   10.96.0.1     <none>        443/TCP          15m
    # seckill      NodePort    10.111.1.62   <none>        3000:31806/TCP   44s
    
    # 访问测试
    http://你的公网IP:31806

    # 创建商品
    http://你的公网IP:31806/goodsCreate?number=10000

    # 秒杀下单
    http://你的公网IP:31806/seckill/buy?goods_id=1&number=10

k8s-seckill's People

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

yuyaozhao

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.