deploy-agent

command module
v0.0.0-...-aa27f07 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2021 License: MIT Imports: 4 Imported by: 0

README

Deploy Agent

Disclaimer: This project is NOT intended for a production evironment. Use at your own risk.

Depoy agent can run on a remote machine to pull and run containers.

Prerequisites

You need to have the latest versions of Go and Docker

Installation

Build an executable:

go build . 

Specify IP and PORT in .env using the same format as in the .env.example or:

cp .env.example .env

Run an agent:

./deploy-agent
Usage:
Create a deployment from a JSON object:

POST /create


curl -XPOST http://localhost:8008/create -d '{
  "image": "nginx:latest",
  "name": "nginx",
  "containerNet": {
    "port": "80",
    "proto": "tcp"
  },
  "hostNet": {
    "ip": "0.0.0.0",
    "portFirst": 8090,
    "proto": "tcp"
  },
  "replicas": 2,
  "command": [
    "nginx",
    "-g",
    "daemon off;"
  ]
}' -u admin:admin

Get running containers:

GET /get

 curl -XGET http://localhost:8008/get/nginx -u admin:admin
Update deployment image:

PATCH /update

curl -XPATCH localhost:8008/update -d '{"name":"nginx","image":"nginx:1.21.0"}' -u admin:admin
Stop deployment:

POST /stop

 curl -XPOST http://localhost:8008/stop -d '{"name":"nginx"}' -u admin:admin

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL