github.com/chasestarr/deis@v1.13.5-0.20170519182049-1d9e59fbdbfc/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@1.service: loaded
    43  Control plane...
    44  deis-database.service: loaded
    45  deis-registry@1.service: loaded
    46  deis-controller.service: loaded
    47  deis-builder.service: loaded
    48  Data plane...
    49  Routing mesh...
    50  deis-router@1.service: loaded
    51  deis-router@2.service: loaded
    52  deis-router@3.service: loaded
    53  Done.
    54  Deis installed.
    55  Please run `deisctl start platform` to boot up Deis.
    56  
    57  $ deisctl start platform
    58  ● ▴ ■
    59  ■ ● ▴ Starting Deis...
    60  ▴ ■ ●
    61  
    62  Logging subsystem...
    63  deis-logger.service: running
    64  deis-logspout.service: running
    65  Storage subsystem...
    66  deis-store-daemon.service: running
    67  deis-store-monitor.service: running
    68  deis-store-gateway@1.service: running
    69  Control plane...
    70  deis-database.service: running
    71  deis-registry@1.service: running
    72  deis-controller.service: running
    73  deis-builder.service: running
    74  Data plane...
    75  deis-publisher.service: running
    76  Routing mesh...
    77  deis-router@1.service: running
    78  deis-router@2.service: running
    79  deis-router@3.service: running
    80  Done.
    81  ```
    82  
    83  Note that the default start command activates 1 of each component.
    84  You can scale components with `deisctl scale router=3`, for example.
    85  The router, the registry and the store gateway are the only component that _currently_ scales beyond 1 unit.
    86  
    87  You can also use the `deisctl uninstall` command to destroy platform units:
    88  
    89  ```console
    90  ● ▴ ■
    91  ■ ● ▴ Uninstalling Deis...
    92  ▴ ■ ●
    93  
    94  Routing mesh...
    95  deis-router@1.service: inactive
    96  deis-router@2.service: inactive
    97  deis-router@3.service: inactive
    98  Data plane...
    99  Control plane...
   100  deis-controller.service: inactive
   101  deis-builder.service: inactive
   102  deis-database.service: inactive
   103  deis-registry@1.service: inactive
   104  Storage subsystem...
   105  deis-store-gateway@1.service: inactive
   106  Logging subsystem...
   107  deis-logger.service: inactive
   108  Done.
   109  ```
   110  
   111  To uninstall a specific component, use `deisctl uninstall router`.
   112  
   113  Note that uninstalling platform units will _not_ remove the data units or underlying
   114  data containers.  Data must be destroyed manually.
   115  
   116  ## Usage
   117  
   118  The `deisctl` tool provides a number of other commands, including:
   119  
   120   * `deisctl list` - list Deis platform components
   121   * `deisctl status <component>` - retrieve Systemd status of a component
   122   * `deisctl journal <component>` - retrieve Systemd journal output
   123   * `deisctl start <component>` - start a platform component
   124   * `deisctl stop <component>` - stop a platform component
   125   * `deisctl install <component>` - install a single platform component
   126   * `deisctl uninstall <component>` - uninstall a single platform component
   127   * `deisctl scale <component>=<num>` - scale a component to the target number of units
   128   * `deisctl refresh-units` - download latest unit files
   129  
   130  ## Usage Examples
   131  
   132  ```console
   133  $ deisctl list
   134  UNIT				MACHINE				LOAD	ACTIVE	SUB
   135  deis-builder.service		f936b7a5.../172.17.8.100	loaded	active	running
   136  deis-controller.service	    f936b7a5.../172.17.8.100	loaded	active	running
   137  deis-database.service		f936b7a5.../172.17.8.100	loaded	active	running
   138  deis-logger.service	    	f936b7a5.../172.17.8.100	loaded	active	running
   139  deis-registry@1.service		f936b7a5.../172.17.8.100	loaded	active	running
   140  deis-router@1.service		f936b7a5.../172.17.8.100	loaded	active	running
   141  ```
   142  
   143  ```console
   144  $ deisctl status controller
   145  ● deis-controller.service - deis-controller
   146     Loaded: loaded (/run/fleet/units/deis-controller.service; linked-runtime)
   147     Active: active (running) since Mon 2014-08-25 22:56:50 UTC; 15min ago
   148    Process: 22969 ExecStartPre=/bin/sh -c docker inspect deis-controller >/dev/null 2>&1 && docker rm -f deis-controller || true (code=exited, status=0/SUCCESS)
   149    Process: 22945 ExecStartPre=/bin/sh -c IMAGE=`/run/deis/bin/get_image /deis/controller`; docker history $IMAGE >/dev/null 2>&1 || docker pull $IMAGE (code=exited, status=0/SUCCESS)
   150   Main PID: 22979 (sh)
   151     CGroup: /system.slice/system-deis\x2dcontroller.slice/deis-controller.service
   152             ├─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
   153             └─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
   154  
   155  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
   156  Aug 25 22:57:07 deis-1 sh[22979]: 2014-08-25 16:57:07 [121] [INFO] Booting worker with pid: 121
   157  Aug 25 22:57:07 deis-1 sh[22979]: [2014-08-25 16:57:07,968: INFO/MainProcess] mingle: searching for neighbors
   158  Aug 25 22:57:08 deis-1 sh[22979]: 2014-08-25 16:57:08 [122] [INFO] Booting worker with pid: 122
   159  Aug 25 22:57:08 deis-1 sh[22979]: 2014-08-25 16:57:08 [123] [INFO] Booting worker with pid: 123
   160  Aug 25 22:57:08 deis-1 sh[22979]: 2014-08-25 16:57:08 [124] [INFO] Booting worker with pid: 124
   161  Aug 25 22:57:08 deis-1 sh[22979]: 2014-08-25 16:57:08 [125] [INFO] Booting worker with pid: 125
   162  Aug 25 22:57:08 deis-1 sh[22979]: 2014-08-25 16:57:08 [126] [INFO] Booting worker with pid: 126
   163  Aug 25 22:57:08 deis-1 sh[22979]: [2014-08-25 16:57:08,979: INFO/MainProcess] mingle: all alone
   164  Aug 25 22:57:08 deis-1 sh[22979]: [2014-08-25 16:57:08,997: WARNING/MainProcess] celery@4378062f17a5 ready.
   165  ```
   166  
   167  ```console
   168  $ deisctl journal controller
   169  ...
   170  Aug 25 22:57:08 deis-1 sh[22979]: 2014-08-25 16:57:08 [125] [INFO] Booting worker with pid: 125
   171  Aug 25 22:57:08 deis-1 sh[22979]: 2014-08-25 16:57:08 [126] [INFO] Booting worker with pid: 126
   172  Aug 25 22:57:08 deis-1 sh[22979]: [2014-08-25 16:57:08,979: INFO/MainProcess] mingle: all alone
   173  Aug 25 22:57:08 deis-1 sh[22979]: [2014-08-25 16:57:08,997: WARNING/MainProcess] celery@4378062f17a5 ready.
   174  ```
   175  
   176  ```console
   177  $ deisctl stop controller
   178  deis-controller.service: loaded
   179  ```
   180  
   181  ```console
   182  $ deisctl start controller
   183  deis-controller.service: launched
   184  ```
   185  
   186  ```console
   187  $ deisctl scale router=3
   188  deis-router@1.service: loaded
   189  deis-router@2.service: loaded
   190  deis-router@3.service: loaded
   191  
   192  $ deisctl start router
   193  deis-router@1.service: launched
   194  deis-router@2.service: launched
   195  deis-router@3.service: launched
   196  ```
   197  
   198  ## Unit Search Paths
   199  
   200  deisctl looks for unit files in these directories, in this order:
   201  - the $DEISCTL_UNITS environment variable, if set
   202  - $HOME/.deis/units
   203  - /var/lib/deis/units
   204  
   205  ## License
   206  
   207  Copyright 2014, Engine Yard, Inc.
   208  
   209  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>
   210  
   211  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.