github.com/lorieri/deis@v1.3.1/deisctl/README.md (about) 1 # Deis Control Utility 2 3 `deisctl` is a command-line utility used to provision and operate a Deis cluster. 4 5 ## Installation 6 7 Please refer to the installation docs at 8 http://docs.deis.io/en/latest/installing_deis/install-deisctl/. 9 10 ## Remote Configuration 11 12 While `deisctl` can be used locally on a CoreOS host, it is extremely useful as a tool 13 for remote administration. This requires an SSH tunnel to one of your CoreOS hosts. 14 15 Test password-less SSH connectivity to a CoreOS host: 16 17 ```console 18 $ ssh core@172.17.8.100 hostname 19 deis-1 20 ``` 21 22 Export the `DEISCTL_TUNNEL` environment variable: 23 24 ```console 25 $ export DEISCTL_TUNNEL=172.17.8.100 26 ``` 27 28 ## Provision a Deis Platform 29 30 The `deisctl install platform` command will schedule all of the Deis platform 31 units. `deisctl start platform` activates these units. 32 33 ```console 34 $ deisctl install platform 35 ● ▴ ■ 36 ■ ● ▴ Installing Deis... 37 ▴ ■ ● 38 39 Logging subsystem... 40 deis-logger.service: loaded 41 Storage subsystem... 42 deis-store-gateway.service: loaded 43 Control plane... 44 deis-cache.service: loaded 45 deis-database.service: loaded 46 deis-registry@1.service: loaded 47 deis-controller.service: loaded 48 deis-builder.service: loaded 49 Data plane... 50 Routing mesh... 51 deis-router@1.service: loaded 52 deis-router@2.service: loaded 53 deis-router@3.service: loaded 54 Done. 55 Deis installed. 56 Please run `deisctl start platform` to boot up Deis. 57 58 $ deisctl start platform 59 ● ▴ ■ 60 ■ ● ▴ Starting Deis... 61 ▴ ■ ● 62 63 Logging subsystem... 64 deis-logger.service: running 65 deis-logspout.service: running 66 Storage subsystem... 67 deis-store-daemon.service: running 68 deis-store-monitor.service: running 69 deis-store-gateway.service: running 70 Control plane... 71 deis-cache.service: running 72 deis-database.service: running 73 deis-registry@1.service: running 74 deis-controller.service: running 75 deis-builder.service: running 76 Data plane... 77 deis-publisher.service: running 78 Routing mesh... 79 deis-router@1.service: running 80 deis-router@2.service: running 81 deis-router@3.service: running 82 Done. 83 ``` 84 85 Note that the default start command activates 1 of each component. 86 You can scale components with `deisctl scale router=3`, for example. 87 The router and the registry are the only component that _currently_ scales beyond 1 unit. 88 89 You can also use the `deisctl uninstall` command to destroy platform units: 90 91 ```console 92 ● ▴ ■ 93 ■ ● ▴ Uninstalling Deis... 94 ▴ ■ ● 95 96 Routing mesh... 97 deis-router@1.service: inactive 98 deis-router@2.service: inactive 99 deis-router@3.service: inactive 100 Data plane... 101 Control plane... 102 deis-controller.service: inactive 103 deis-builder.service: inactive 104 deis-cache.service: inactive 105 deis-database.service: inactive 106 deis-registry@1.service: inactive 107 Storage subsystem... 108 deis-store-gateway.service: inactive 109 Logging subsystem... 110 deis-logger.service: inactive 111 Done. 112 ``` 113 114 To uninstall a specific component, use `deisctl uninstall router`. 115 116 Note that uninstalling platform units will _not_ remove the data units or underlying 117 data containers. Data must be destroyed manually. 118 119 ## Usage 120 121 The `deisctl` tool provides a number of other commands, including: 122 123 * `deisctl list` - list Deis platform components 124 * `deisctl status <component>` - retrieve Systemd status of a component 125 * `deisctl journal <component>` - retrieve Systemd journal output 126 * `deisctl start <component>` - start a platform component 127 * `deisctl stop <component>` - stop a platform component 128 * `deisctl install <component>` - install a single platform component 129 * `deisctl uninstall <component>` - uninstall a single platform component 130 * `deisctl scale <component>=<num>` - scale a component to the target number of units 131 * `deisctl refresh-units` - download latest unit files 132 133 ## Usage Examples 134 135 ```console 136 $ deisctl list 137 UNIT MACHINE LOAD ACTIVE SUB 138 deis-builder.service f936b7a5.../172.17.8.100 loaded active running 139 deis-cache.service f936b7a5.../172.17.8.100 loaded active running 140 deis-controller.service f936b7a5.../172.17.8.100 loaded active running 141 deis-database.service f936b7a5.../172.17.8.100 loaded active running 142 deis-logger.service f936b7a5.../172.17.8.100 loaded active running 143 deis-registry@1.service f936b7a5.../172.17.8.100 loaded active running 144 deis-router@1.service f936b7a5.../172.17.8.100 loaded active running 145 ``` 146 147 ```console 148 $ deisctl status controller 149 ● deis-controller.service - deis-controller 150 Loaded: loaded (/run/fleet/units/deis-controller.service; linked-runtime) 151 Active: active (running) since Mon 2014-08-25 22:56:50 UTC; 15min ago 152 Process: 22969 ExecStartPre=/bin/sh -c docker inspect deis-controller >/dev/null && docker rm -f deis-controller || true (code=exited, status=0/SUCCESS) 153 Process: 22945 ExecStartPre=/bin/sh -c IMAGE=`/run/deis/bin/get_image /deis/controller`; docker history $IMAGE >/dev/null || docker pull $IMAGE (code=exited, status=0/SUCCESS) 154 Main PID: 22979 (sh) 155 CGroup: /system.slice/system-deis\x2dcontroller.slice/deis-controller.service 156 ├─22979 /bin/sh -c IMAGE=`/run/deis/bin/get_image /deis/controller` && docker run --name deis-controller --rm -p 8000:8000 -e PUBLISH=8000 -e HOST=$COREOS_PRIVATE_IPV4 --volumes-from=deis-logger $IMAGE 157 └─22999 docker run --name deis-controller --rm -p 8000:8000 -e PUBLISH=8000 -e HOST=172.17.8.100 --volumes-from=deis-logger deis/controller:latest 158 159 Aug 25 22:57:07 deis-1 sh[22979]: [2014-08-25 16:57:07,959: INFO/MainProcess] Connected to redis://172.17.8.100:6379/0 160 Aug 25 22:57:07 deis-1 sh[22979]: 2014-08-25 16:57:07 [121] [INFO] Booting worker with pid: 121 161 Aug 25 22:57:07 deis-1 sh[22979]: [2014-08-25 16:57:07,968: INFO/MainProcess] mingle: searching for neighbors 162 Aug 25 22:57:08 deis-1 sh[22979]: 2014-08-25 16:57:08 [122] [INFO] Booting worker with pid: 122 163 Aug 25 22:57:08 deis-1 sh[22979]: 2014-08-25 16:57:08 [123] [INFO] Booting worker with pid: 123 164 Aug 25 22:57:08 deis-1 sh[22979]: 2014-08-25 16:57:08 [124] [INFO] Booting worker with pid: 124 165 Aug 25 22:57:08 deis-1 sh[22979]: 2014-08-25 16:57:08 [125] [INFO] Booting worker with pid: 125 166 Aug 25 22:57:08 deis-1 sh[22979]: 2014-08-25 16:57:08 [126] [INFO] Booting worker with pid: 126 167 Aug 25 22:57:08 deis-1 sh[22979]: [2014-08-25 16:57:08,979: INFO/MainProcess] mingle: all alone 168 Aug 25 22:57:08 deis-1 sh[22979]: [2014-08-25 16:57:08,997: WARNING/MainProcess] celery@4378062f17a5 ready. 169 ``` 170 171 ```console 172 $ deisctl journal controller 173 ... 174 Aug 25 22:57:08 deis-1 sh[22979]: 2014-08-25 16:57:08 [125] [INFO] Booting worker with pid: 125 175 Aug 25 22:57:08 deis-1 sh[22979]: 2014-08-25 16:57:08 [126] [INFO] Booting worker with pid: 126 176 Aug 25 22:57:08 deis-1 sh[22979]: [2014-08-25 16:57:08,979: INFO/MainProcess] mingle: all alone 177 Aug 25 22:57:08 deis-1 sh[22979]: [2014-08-25 16:57:08,997: WARNING/MainProcess] celery@4378062f17a5 ready. 178 ``` 179 180 ```console 181 $ deisctl stop controller 182 deis-controller.service: loaded 183 ``` 184 185 ```console 186 $ deisctl start controller 187 deis-controller.service: launched 188 ``` 189 190 ```console 191 $ deisctl scale router=3 192 deis-router@1.service: loaded 193 deis-router@2.service: loaded 194 deis-router@3.service: loaded 195 196 $ deisctl start router 197 deis-router@1.service: launched 198 deis-router@2.service: launched 199 deis-router@3.service: launched 200 ``` 201 202 ## Unit Search Paths 203 204 deisctl looks for unit files in these directories, in this order: 205 - the $DEISCTL_UNITS environment variable, if set 206 - $HOME/.deis/units 207 - /var/lib/deis/units 208 209 ## License 210 211 Copyright 2014, OpDemand LLC 212 213 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at <http://www.apache.org/licenses/LICENSE-2.0> 214 215 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.