Giter VIP home page Giter VIP logo

container-ship's Introduction

Container Ship

Go Report Card CI Status Docker Pulls Ship Docker Pulls Cargo

Deployment of containers type master-workers fits for multiple regions, minimum settings, access controls and opening ports.

Preview

Try fast start

  1. git clone https://github.com/oxmix/container-ship.git
  2. cd container-ship/example && ./start
  3. open http://localhost:3080

Mini Wiki

Connect machine, will be install cargo-deployer

  • Execute on the worker node
curl -sk https://ctr-ship.domain.tld/connection | sudo bash -

Apply deployment manifest

$parentHostname is variable hostname parent/internal node, option if needs

curl -kX POST https://ctr-ship.domain.tld/deployment --data-binary @- << 'EOF'
space: my-project
name: test-deployment
containers:
  - name: test-nginx
    from: nginx
    hostname: $parentHostname
    stop-time: 30
    ports:
      - 8080:80
EOF

Add/update node to a ship

curl -kX POST https://ctr-ship.domain.tld/nodes/apply --data-binary @- << 'EOF'
IPv4: 127.0.0.1
name: localhost
deployments:
  - my-project.test-deployment
EOF

Delete node

  • All containers will be destroyed and cargo-deployer too
curl -kX DELETE https://ctr-ship.domain.tld/nodes/apply?name=localhost

Delete manifest deployment

  • All containers of manifest will be destroyed
curl -kX DELETE https://ctr-ship.domain.tld/deployment?name=my-project.test-deployment

Magic environment

  • update node
curl -kX POST https://ctr-ship.domain.tld/nodes/apply --data-binary @- << 'EOF'
IPv4: 127.0.0.1
name: localhost
deployments: 
  - my-project.test-nginx
variables:
  - key: PASS_SEC
    val: 32167
EOF
  • auto replace in each manifest deployment if set equal node and variables {}
curl -kX POST https://ctr-ship.domain.tld/deployment --data-binary @- << 'EOF'
space: example
name: magick-envs-deployment
containers:
  - name: nginx
    from: nginx
    ports:
      - 8081:80
    environment:
      - PASS={PASS_SEC}
EOF

Usage own registry with auto access control by IP nodes

  • To raise docker registry:2
docker run -d --name docker-registry \
    --restart always --log-driver json-file --log-opt max-size=5m \
    -p 127.0.0.1:5035:5035 \
    -v `pwd`/data:/var/lib/registry \
  registry:2

Manual raise master daemon container-ship

mkdir $(pwd)/assets && \
docker run -d --name container-ship \
    -v $(pwd)/assets:/assets \
    -p 127.0.0.1:8443:8443 \
    -e ENDPOINT=127.0.0.1:8443 \
    --restart always \
    --log-driver json-file \
    --log-opt max-size=5m \
oxmix/container-ship

Logs alert to telegram

  • golang by matching: fatal error:|panic:
  • php by matching: PHP Parse error|PHP Fatal error|PHP Warning|PHP Notice
  • node by matching: Error:|EvalError:|RangeError:|ReferenceError:|SyntaxError:|TypeError:|URIError:
docker run ... \
    ...
    -e NOTIFY_MATCH='fatal error:|panic:|my custom warning' \
    -e NOTIFY_TG_TOKEN=... \
    -e NOTIFY_TG_CHAT_ID=... \
    ...
oxmix/container-ship

Deployment through file

curl -kX POST https://ctr-ship.domain.tld/deployment --data-binary "@test-deployment.yaml"

Update node through file

curl -kX POST https://ctr-ship.domain.tld/nodes/apply --data-binary "@localhost.yaml"

Tab Nodes

  • Shows stats by nodes

Preview

Example Hub

  • Shows own docker registry

Preview

Example Logs

  • Showing logs realtime from container with support json pretty

Preview

container-ship's People

Contributors

oxmix avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.