Skip to content

Commit 37d5d5b

Browse files
authored
Merge pull request #4 from jianxiaoguo/master
chore(docs):add volumes and resources docs
2 parents 7bbe892 + bc70954 commit 37d5d5b

4 files changed

Lines changed: 136 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ venv/
2222
_build/
2323

2424
.DS_Store
25+
.idea/*

mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ nav:
5050
- Managing App Processes: applications/managing-app-processes.md
5151
- Managing App Configuration: applications/managing-app-configuration.md
5252
- Managing App Lifecycle: applications/managing-app-lifecycle.md
53+
- Managing App Volumes: applications/managing-app-volumes.md
54+
- Managing App Resources: applications/managing-app-resources.md
5355
- Inter-app Communication: applications/inter-app-communication.md
5456
- Resource Limits: applications/managing-resource-limits.md
5557
- Domains and Routing: applications/domains-and-routing.md
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Managing resources for an Application
2+
3+
We can use blow command to create resources and bind which resource is created.
4+
This command depend on [service-catalog](https://svc-cat.io).
5+
6+
7+
Use `drycc resources` to create and bind a resource for a deployed application.
8+
9+
$ drycc help resources
10+
Valid commands for resources:
11+
12+
resources:create create a resource for the application
13+
resources:list list resources in the application
14+
resources:describe get a resource detail info in the application
15+
resources:update update a resource from the application
16+
resources:destroy delete a resource from the applicationa
17+
resources:bind bind a resource to servicebroker
18+
resources:unbind unbind a resource from servicebroker
19+
20+
Use 'drycc help [command]' to learn more.
21+
22+
## Create resource in application
23+
24+
You can create a resource with one `drycc resources:create` command
25+
26+
$ drycc resources:create memcached:custom memcached
27+
Creating memcached to scenic-icehouse... done
28+
29+
After resources are created, you can list the resources in this application.
30+
31+
$ drycc resources:list
32+
=== scenic-icehouse resources
33+
memcached memcached:custom
34+
35+
## Bind resources
36+
37+
The resource which is named memcached is created, you can bind the memcached to the application,
38+
use the command of `drycc resources:bind memcached`.
39+
40+
$ drycc resources:bind memcached
41+
Binding resource... done
42+
43+
## Describe resources
44+
45+
And use `drycc resources:describe` show the binding detail. If the binding is successful, this command will show the information of connect to the resource.
46+
47+
$ drycc resources:describe memcached
48+
=== scenic-icehouse resource memcached
49+
plan: memcached:custom
50+
status: Ready
51+
binding: Ready
52+
53+
HOST: 10.1.7.241 10.1.7.101
54+
PORT: 11211
55+
56+
## Update resources
57+
58+
You can use the `drycc resources:update` command to upgrade a new plan.
59+
An example of how to upgrade the plan's capacity to 100MB:
60+
61+
$ drycc resources:update memcached:100 memcached
62+
Updating memcached to scenic-icehouse... done
63+
64+
## Remove the resource
65+
66+
If you don't need resources, use `drycc resources:unbind` to unbind the resource and then use `drycc resources:destroy` to delete the resource from the application.
67+
Before deleting the resource, the resource must be unbinded.
68+
69+
$ drycc resources:unbind memcached
70+
Unbinding resource... done
71+
72+
$ drycc resources:destroy memcached
73+
Deleting memcached from scenic-icehouse... done
74+
75+
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Mounting volumes for an Application
2+
3+
We can use the blow command to create volumes and mount the created volumes.
4+
Drycc create volume support [ReadWriteMany](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes), so before deploying drycc, you need to have a StorageClass ready which can support ReadWriteMany.
5+
Deploying drycc, set controller.app_storage_class to this StorageClass.
6+
7+
8+
Use `drycc volumes` to mount a volume for a deployed application's processes.
9+
10+
$ drycc help volumes
11+
Valid commands for volumes:
12+
13+
volumes:create create a volume for the application
14+
volumes:list list volumes in the application
15+
volumes:delete delete a volume from the application
16+
volumes:mount mount a volume to process of the application
17+
volumes:unmount unmount a volume from process of the application
18+
19+
Use 'drycc help [command]' to learn more.
20+
21+
## Create a volume for the application
22+
23+
You can create a volume with the `drycc volumes:create` command
24+
25+
$ drycc volumes:create myvolume 200M
26+
Creating myvolumes to scenic-icehouse... done
27+
28+
## List volumes in the application
29+
30+
After volume is created, you can list the volumes in this application.
31+
32+
$ drycc volumes:list
33+
=== scenic-icehouse volumes
34+
--- myvolumes 200M
35+
36+
## Mount a volume
37+
38+
The volume which is named myvolumes is created, you can mount the volume with process of the application,
39+
use the command of `drycc volumes:mount`. When volume is mounted, a new release will be created and deployed automatically.
40+
41+
$ drycc volumes:mount myvolumes web=/data/web
42+
Mounting volume... done
43+
44+
And use `drycc volumes:list` show mount detail.
45+
46+
$ drycc volumes:list
47+
=== scenic-icehouse volumes
48+
--- myvolumes 200M
49+
web /data/web
50+
51+
If you don't need the volume, use `drycc volumes:unmount` to unmount the volume and then use `drycc volumes:delete` to delete the volume from the application.
52+
Before deleting volume, the volume has to be unmounted.
53+
54+
$ drycc volumes:unmount myvolumes web
55+
Unmounting volume... done
56+
57+
$ drycc volumes:delete myvolumes
58+
Deleting myvolumes from scenic-icehouse... done

0 commit comments

Comments
 (0)