解决频繁开通竞价机器
- 开通Linux/Windows竞价机器
- 重启机器
- 销毁机器同时删除解析记录
- 列出镜像列表
- 选择镜像启动虚拟机
- 开通LinuxArm架构按量机器(限定广州六区/上海二区, 白名单支持信创机型)
- 支持添加解析记录
从 Github Release 下载已经编译好的二进制文件:
- 支持brew方式
brew tap ysicing/tap
brew install spotvm
echo "deb [trusted=yes] https://mirrors.ysicing.net/ysicing/apt/ /" | sudo tee /etc/apt/sources.list.d/ysicing.list
apt update
apt install -y spot
spot -v
cat /etc/yum.repos.d/fury.repo
[fury]
name=Gemfury Private Repo
baseurl=https://yum.fury.io/ysicing/
enabled=1
gpgcheck=0
- 支持go v1.21+
# Clone the repo
# Build and run the executable
make build && ./dist/spot_darwin_amd64
cat /home/ysicing/.spot.yaml
qcloud:
account:
id: AKIDxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
secret: AKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
zone: ap-shanghai-5
region: ap-shanghai
# 可选, 方便计费
# project:
# id: 1250841
instance:
# 镜像
image: img-xxxx
# 规格这个规格比较便宜
type: SA2.MEDIUM4
network:
vpc:
id: vpc-xxxx
subnet:
id: subnet-xxxx
auth:
# 只支持密钥登录
sshkey:
ids:
- skey-xxxx
# 安全组
securitygroup:
id: sg-xxxx
dnspod:
main: "ysicing.net"
sub: "*.dev"
# 创建1台机器, 默认开启公网访问100M按流量计费, 超过1台则默认不分配公网ip(因为我们环境默认nat出去)
spot new --config /home/ysicing/.spot.yaml
# 列表
spot list --config /home/ysicing/.spot.yaml
INFO[0000] Using config file: /home/ysicing/.spot.yaml
创建时间 Name ID 内网IP 公网IP 规格 类型 状态
2022-08-22T13:17:34Z spot-20220822211647 ins-kysdso6l 10.10.16.39 42.192.202.136 SA2.MEDIUM4 SPOTPAID RUNNING
# 销毁
spot destroy --config /home/ysicing/.spot.yaml
# 销毁全部
spot destroy --config /home/ysicing/.spot.yaml --all
# 添加解析记录
spot dnspod --config /home/ysicing/.spot.yaml
INFO[0000] Using config file: /home/ysicing/.spot.yaml
🎉 10.10.16.25
INFO[0003] create record success *.dev.ysicing.net ---> 106.54.x.x