Skip to content

Commit a4ca9d5

Browse files
author
bebebe-cmd
committed
add k8s
1 parent c81f6fc commit a4ca9d5

File tree

3 files changed

+50
-25
lines changed

3 files changed

+50
-25
lines changed

application/accountant.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def delete_host(name):
179179
elif image in MARKET:
180180
if image == 'k8s':
181181
try:
182-
requests.get(os.environ['K8S_LINK'] + '/api/v1/destroy/' + todelete_hostdata['k8s_data']['id'])
182+
requests.get(os.environ['K8S_LINK'] + '/api/v1/destroy/' + todelete_hostdata['k8s']['id'])
183183
except Exception:
184184
notify('failed to delete k8s cluster')
185185
deactivate_host(name)

how-tos/market/README.md

+16-24
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,30 @@
11
#### Market images
22

3-
Get instance access key:
3+
Bitclouds offers images from market. These are special images sold by community members.
44

5-
`$ curl https://bitclouds.sh/key/hassaleh > ssh.key`
5+
Market images may have limited stock:
66

7-
Connect to the instance:
8-
9-
`$ ssh -i ssh.key [email protected]`
7+
`$ curl https://bitclouds.sh/create/k8s`
108

119
```
12-
------------------: System Data :-------------------------------
13-
Hostname: hassaleh (10.0.0.13)
14-
Kernel: 4.19.0-13-amd64 (Debian GNU/Linux 10 (buster))
15-
Uptime: 06:55:32 up 9 min, 1 user, load average: 0.06, 0.03, 0.00
16-
CPU: Intel(R) Xeon(R) CPU v4 @ 3.60GHz (1 cores)
17-
Memory(Mb): 1 Gb total / 1 Gb free
18-
------------------------: Logged as: [debian] ------------------------------
19-
20-
For support: https://support.bitclouds.sh
21-
22-
23-
debian@hassaleh:~$
24-
10+
{
11+
"error": "out of stock"
12+
}
2513
```
2614

27-
Add balance to your instance:
28-
29-
`$ curl https://bitclouds.sh/topup/hassaleh` to add 99 sats by default
15+
One-time setup fee of 9900 satoshi is applied for market instances
3016

31-
or `$ curl https://bitclouds.sh/topup/hassaleh/30000` specify amount (*==minutes*) you would like to pay
17+
`$ curl https://bitclouds.sh/create/k8s`
3218

3319
```
3420
{
35-
"host": "hassaleh",
36-
"invoice": "lnbc300u1p0ak37tpp52et53crpn0ssvh6w9z0v4jy294q7f258gtxw2gz9mres9vuu87lmsjpk423x63sy2s6dxdfkq0vrwcauuwclyzyfqdqadpshxumpd3jkssrzd96xxmr0w4j8xxqyjw5qcqpjsp5tevhmddxe9sc0w2p7s789c4yjmgfdmhtjsu2776cumx7lpgu5hhsrzjqgfursuzjw8vrwhwkut8r0nr62wjt6r8uxmuqu2x3hf2e6jy26z3uzw435qq8zgqqyqqqp9fqqqqqzcqyg9qy9qsq82x88w4ghzheaqgu9nsl3qmcc4hck0um3v2w63tu56j66gyf6zulmmqctvha422kfsptwajcs"
21+
...
22+
"price": "<1 sat/min",
23+
"setup_fee": "9900 sats",
24+
...
3725
}
3826
```
27+
28+
Usually, market instance name has `m-` prefix (i.e. `m-alpherg`) in it's name
29+
30+
Currently available only [k8s](./k8s.md) image in market

how-tos/market/k8s.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#### Kubernetes cluster
2+
3+
Create image:
4+
5+
`$ curl https://bitclouds.sh/create/k8s`
6+
7+
```
8+
{
9+
"disclaimer": "If you pay the LN invoice, you agree with terms of service: any abuse usage is prohibited. Your instance may be stopped and/or destroyed at any time without any reason. Do backups. Your data is securely encrypted and instances hosted in enterprise-grade datacenters. Your IP and payment information is logged for authorization purposes. Bitclouds never use your data for any purpose except mentioned above.",
10+
"host": "m-alpherg",
11+
"paytostart": "lnbc99990n1p0akcm6pp5lwrq8a4nztensdqld5kkzmrsdpjhye6qvf5hy2vxpqajwp9v7pdx2zcndl5t2shwpge5gn3kfs0a8mv9vgsld6uxrwp8g29m7n5lufqjhcg70lc503y0zp2qqrzjqgqyccjavg3y2cr2r63vr35uldz3ddcrk3u5tgmywufuqhly4t43czw43cqqw6cqqyqqqqlgqqqqqqgq9q9qy9qsqjpzpkp73hjvyd34z9ugx9tggcx2eztrlwfsdk0x2r2wqv39y7779zmt6ahs7ukt2kvddh845ac69pkf0m383x5njwexusu7q9s8lrxgqqk6y3h",
12+
"price": "<1 sat/min",
13+
"setup_fee": "9900 sats",
14+
"support": "https://support.bitclouds.sh"
15+
}
16+
```
17+
18+
Copy kubeconfig to your `~/.kube/config`:
19+
20+
`$ curl https://bitclouds.sh/key/m-alpherg > ~/.kube/config`
21+
22+
Check cluster status:
23+
24+
`$ kubectl get nodes`
25+
26+
```
27+
NAME STATUS ROLES AGE VERSION
28+
master1 Ready master 156m v1.19.4`
29+
```
30+
31+
Deploy sample YML:
32+
33+
`user@local:/home/user/k8s_deployments$ kubectl apply -f sample_deploy.yml`

0 commit comments

Comments
 (0)