Skip to content

Commit bda1c9c

Browse files
author
Gabriel Monroy
committed
ref(*): deprecate cluster domain object
1 parent 121ae2e commit bda1c9c

59 files changed

Lines changed: 522 additions & 946 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,26 @@ $ deisctl install platform
7171
$ deisctl start platform
7272
```
7373

74-
This can take some time - the **builder** and **registry** components must download and install the beefy Heroku cedar stack. Grab some more coffee!
74+
This can take some time - the **builder** must download and install the beefy Heroku cedar stack. Grab some more coffee!
7575

7676
Your Deis platform should be accessible at `deis.local3.deisapp.com`. For clusters on other platforms see our guide to [Configuring DNS](http://docs.deis.io/en/latest/installing_deis/configure-dns/).
7777

78+
## Configure Deis
79+
80+
Now that Deis is running there are a few administrative settings we need to provide.
81+
82+
Set the default domain used to anchor your applications. For a Vagrant environment, use `local3.deisapp.com` as it will resolve to your local routers:
83+
84+
```console
85+
$ deisctl config platform set domain=local3.deisapp.com
86+
```
87+
88+
If you want to allow `deis run` for one-off admin commands, you must provide an SSH private key that allows Deis to gather container logs on CoreOS hosts:
89+
90+
```console
91+
$ deisctl config platform set sshPrivateKey=~/.vagrant.d/insecure_private_key
92+
```
93+
7894
## Install the Deis Client
7995

8096
If you're using the latest Deis release, use `pip install --upgrade deis` to install the latest [Deis Client](https://pypi.python.org/pypi/deis/) or download [pre-compiled binaries](https://github.com/deis/deis/tree/master/client#get-started).
@@ -100,22 +116,6 @@ $ deis keys:add
100116

101117
Use `deis keys:add` to add your SSH public key for `git push` access -- normally `$HOME/.ssh/id_rsa.pub`.
102118

103-
## Initialize a Cluster
104-
105-
Initialize a `dev` cluster with a list of CoreOS hosts and your CoreOS private key.
106-
107-
```console
108-
$ deis clusters:create dev local3.deisapp.com --hosts=172.17.8.100 --auth=~/.vagrant.d/insecure_private_key
109-
```
110-
111-
The parameters to `deis clusters:create` are:
112-
* cluster name (`dev`) - the name used by Deis to reference the cluster
113-
* cluster hostname (`local.3deisapp.com`) - the hostname under which apps are created, like `balancing-giraffe.local3.deisapp.com`
114-
* cluster members (`--hosts`) - a comma-separated list of cluster members -- not necessarily all members, but at least one (for cloud providers, this is a list of the IPs like `--hosts=10.21.12.1,10.21.12.2,10.21.12.3`)
115-
* auth SSH key (`--auth`) - the SSH private key used to provision servers -- cannot have a password (for cloud providers, this key is likely `~/.ssh/deis`)
116-
117-
The `dev` cluster will be used as the default cluster for future `deis` commands.
118-
119119
# Usage
120120

121121
Deis supports 3 deployment workflows:

client/deis.py

Lines changed: 2 additions & 205 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
Subcommands, use ``deis help [subcommand]`` to learn more::
1414
1515
apps manage applications used to provide services
16-
clusters manage clusters used to host applications
1716
ps manage processes inside an app container
1817
config manage environment variables that define app config
1918
domains manage and assign domain names to your applications
@@ -23,7 +22,7 @@
2322
releases manage releases of an application
2423
2524
keys manage ssh keys used for `git push` deployments
26-
perms manage permissions for shared apps and clusters
25+
perms manage permissions for applications
2726
2827
Developer shortcut commands::
2928
@@ -431,7 +430,6 @@ def apps_create(self, args):
431430
Creates a new application.
432431
433432
- if no <id> is provided, one will be generated automatically.
434-
- if no <cluster> is provided, a <cluster> named "dev" will be used.
435433
436434
Usage: deis apps:create [<id>] [options]
437435
@@ -441,8 +439,6 @@ def apps_create(self, args):
441439
exist with this name.
442440
443441
Options:
444-
--cluster=<cluster>
445-
target cluster to host application [default: dev].
446442
--no-remote
447443
do not create a `deis` git remote.
448444
"""
@@ -455,9 +451,6 @@ def apps_create(self, args):
455451
app_name = args.get('<id>')
456452
if app_name:
457453
body.update({'id': app_name})
458-
cluster = args.get('--cluster')
459-
if cluster:
460-
body.update({'cluster': cluster})
461454
sys.stdout.write('Creating application... ')
462455
sys.stdout.flush()
463456
try:
@@ -911,200 +904,6 @@ def builds_list(self, args):
911904
else:
912905
raise ResponseError(response)
913906

914-
def clusters(self, args):
915-
"""
916-
Valid commands for clusters:
917-
918-
clusters:create create a new cluster
919-
clusters:list list accessible clusters
920-
clusters:update update cluster fields
921-
clusters:info print a represenation of the cluster
922-
clusters:destroy destroy a cluster
923-
924-
Use `deis help [command]` to learn more.
925-
"""
926-
return self.clusters_list(args)
927-
928-
def clusters_create(self, args):
929-
"""
930-
Creates a new cluster.
931-
932-
Usage: deis clusters:create <id> <domain> --hosts=<hosts> --auth=<auth> [options]
933-
934-
Arguments:
935-
<id>
936-
a uniquely identifiable name for the cluster, such as 'dev' or 'prod'.
937-
938-
<domain>
939-
a domain under which app hostnames will live. This must be provided to support
940-
multiple applications hosted on the cluster.
941-
NOTE: this requires wildcard DNS configuration on the domain. For example, a
942-
<domain> of `deisapp.com` requires that `*.deisapp.com` resolves to one of the
943-
cluster's router endpoints or the load balancer in front of the routers.
944-
945-
--hosts=<hosts>
946-
a comma-separated list of the cluster members' private IP addresses.
947-
948-
--auth=<auth>
949-
a local file path to an SSH private key. This is the key used to provision and
950-
connect to the cluster members. This key must not have a password.
951-
NOTE: for EC2 and Rackspace, this key is likely `~/.ssh/deis`.
952-
953-
Options:
954-
--type=<type>
955-
cluster type [default: coreos].
956-
"""
957-
body = {'id': args['<id>'], 'domain': args['<domain>'],
958-
'hosts': args['--hosts'], 'type': args['--type']}
959-
auth_path = os.path.expanduser(args['--auth'])
960-
if not os.path.exists(auth_path):
961-
self._logger.error('Path to authentication credentials does not exist: {}'.format(auth_path))
962-
sys.exit(1)
963-
with open(auth_path) as f:
964-
data = f.read()
965-
body.update({'auth': base64.b64encode(data)})
966-
sys.stdout.write('Creating cluster... ')
967-
sys.stdout.flush()
968-
try:
969-
progress = TextProgress()
970-
progress.start()
971-
response = self._dispatch('post', '/api/clusters', json.dumps(body))
972-
finally:
973-
progress.cancel()
974-
progress.join()
975-
if response.status_code == requests.codes.created: # @UndefinedVariable
976-
data = response.json()
977-
cluster = data['id']
978-
self._logger.info("done, created {}".format(cluster))
979-
else:
980-
raise ResponseError(response)
981-
982-
def clusters_info(self, args):
983-
"""
984-
Prints information about a cluster.
985-
986-
Usage: deis clusters:info <id>
987-
988-
Arguments:
989-
<id>
990-
the uniquely identifiable name for the cluster.
991-
"""
992-
cluster = args.get('<id>')
993-
response = self._dispatch('get', "/api/clusters/{}".format(cluster))
994-
if response.status_code == requests.codes.ok: # @UndefinedVariable
995-
self._logger.info("=== {} Cluster".format(cluster))
996-
self._logger.info(json.dumps(response.json(), indent=2) + '\n')
997-
else:
998-
raise ResponseError(response)
999-
1000-
def clusters_list(self, args):
1001-
"""
1002-
Lists available clusters.
1003-
1004-
Usage: deis clusters:list
1005-
"""
1006-
response = self._dispatch('get', '/api/clusters')
1007-
if response.status_code == requests.codes.ok: # @UndefinedVariable
1008-
data = response.json()
1009-
self._logger.info("=== Clusters")
1010-
for item in data['results']:
1011-
self._logger.info("{id}".format(**item))
1012-
else:
1013-
raise ResponseError(response)
1014-
1015-
def clusters_destroy(self, args):
1016-
"""
1017-
Destroys a cluster.
1018-
1019-
Usage: deis clusters:destroy <id> [options]
1020-
1021-
Arguments:
1022-
<id>
1023-
the uniquely identifiable name for the cluster.
1024-
1025-
Options:
1026-
--confirm=<id>
1027-
skips the prompt for the cluster name. <id> is the uniquely identifiable name
1028-
for the cluster.
1029-
"""
1030-
cluster = args.get('<id>')
1031-
confirm = args.get('--confirm')
1032-
if confirm == cluster:
1033-
pass
1034-
else:
1035-
self._logger.warning("""
1036-
! WARNING: Potentially Destructive Action
1037-
! This command will destroy the cluster: {cluster}
1038-
! To proceed, type "{cluster}" or re-run this command with --confirm={cluster}
1039-
""".format(**locals()))
1040-
confirm = raw_input('> ').strip('\n')
1041-
if confirm != cluster:
1042-
self._logger.info('Destroy aborted')
1043-
return
1044-
sys.stdout.write("Destroying cluster... ".format(cluster))
1045-
sys.stdout.flush()
1046-
try:
1047-
progress = TextProgress()
1048-
progress.start()
1049-
before = time.time()
1050-
response = self._dispatch('delete', "/api/clusters/{}".format(cluster))
1051-
finally:
1052-
progress.cancel()
1053-
progress.join()
1054-
if response.status_code in (requests.codes.no_content, # @UndefinedVariable
1055-
requests.codes.not_found): # @UndefinedVariable
1056-
self._logger.info('done in {}s'.format(int(time.time() - before)))
1057-
else:
1058-
raise ResponseError(response)
1059-
1060-
def clusters_update(self, args):
1061-
"""
1062-
Updates cluster fields.
1063-
1064-
Usage: deis clusters:update <id> [options]
1065-
1066-
Arguments:
1067-
<id>
1068-
the uniquely identifiable name for the cluster.
1069-
1070-
Options:
1071-
--domain=<domain>
1072-
a domain under which app hostnames will live. See `deis help clusters:create`
1073-
for more information.
1074-
--hosts=<hosts>
1075-
a comma-separated list of the cluster members' private IP addresses.
1076-
--auth=<auth>
1077-
a local file path to an SSH private key. This is the key used to provision and
1078-
connect to the cluster members. This key must not have a password.
1079-
--type=<type>
1080-
cluster type (default: coreos).
1081-
--id=<id>
1082-
the (new) uniquely identifiable name for the cluster.
1083-
"""
1084-
cluster = args['<id>']
1085-
body = {}
1086-
for k, arg in (('domain', '--domain'), ('hosts', '--hosts'),
1087-
('auth', '--auth'), ('type', '--type'), ('id', '--id')):
1088-
if k == 'auth' and args.get('--auth') is not None:
1089-
auth_path = os.path.expanduser(args['--auth'])
1090-
if not os.path.exists(auth_path):
1091-
self._logger.error(
1092-
"Path to authentication credentials does not exist: {}".format(auth_path))
1093-
sys.exit(1)
1094-
with open(auth_path) as f:
1095-
data = f.read()
1096-
body.update({'auth': base64.b64encode(data)})
1097-
else:
1098-
v = args.get(arg)
1099-
if v:
1100-
body.update({k: v})
1101-
response = self._dispatch('patch', '/api/clusters/{}'.format(cluster),
1102-
json.dumps(body))
1103-
if response.status_code == requests.codes.ok: # @UndefinedVariable
1104-
self._logger.info(json.dumps(response.json(), indent=2))
1105-
else:
1106-
raise ResponseError(response)
1107-
1108907
def config(self, args):
1109908
"""
1110909
Valid commands for config:
@@ -1899,13 +1698,12 @@ def perms(self, args):
18991698
"""
19001699
Valid commands for perms:
19011700
1902-
perms:list list permissions granted on an app or cluster
1701+
perms:list list permissions granted on an app
19031702
perms:create create a new permission for a user
19041703
perms:delete delete a permission for a user
19051704
19061705
Use `deis help perms:[command]` to learn more.
19071706
"""
1908-
# perms:transfer transfer ownership of an app or cluster
19091707
sys.argv[1] = 'perms:list'
19101708
args = docopt(self.perms_list.__doc__)
19111709
return self.perms_list(args)
@@ -2132,7 +1930,6 @@ def shortcuts(self, args):
21321930
('create', 'apps:create'),
21331931
('destroy', 'apps:destroy'),
21341932
('info', 'apps:info'),
2135-
('init', 'clusters:create'),
21361933
('login', 'auth:login'),
21371934
('logout', 'auth:logout'),
21381935
('logs', 'apps:logs'),

contrib/bare-metal/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,21 @@ $ export DEISCTL_TUNNEL=your.server.name.here
6262
$ deisctl install platform && deisctl start platform
6363
```
6464

65+
## Configure Deis
66+
Set the default domain used to anchor your applications:
67+
68+
```console
69+
$ deisctl config platform set domain=mycluster.local
70+
```
71+
72+
For this to work, you'll need to configure DNS records so you can access applications hosted on Deis. See [Configuring DNS](http://docs.deis.io/en/latest/installing_deis/configure-dns/) for details.
73+
74+
If you want to allow `deis run` for one-off admin commands, you must provide an SSH private key that allows Deis to gather container logs on CoreOS hosts:
75+
76+
```console
77+
$ deisctl config platform set sshPrivateKey=<path-to-private-key>
78+
```
79+
6580
## Use Deis!
6681
After that, register with Deis!
6782
```console

contrib/digitalocean/README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,20 @@ $ deisctl install platform && deisctl start platform
6969
```
7070
Deisctl will deploy Deis and make sure the services are started properly. Grab a coffee.
7171

72-
### Configure DNS
73-
You'll need to configure DNS records so you can access applications hosted on Deis. See [Configuring DNS](http://docs.deis.io/en/latest/installing_deis/configure-dns/) for details.
72+
## Configure Deis
73+
Set the default domain used to anchor your applications:
74+
75+
```console
76+
$ deisctl config platform set domain=mycluster.local
77+
```
78+
79+
For this to work, you'll need to configure DNS records so you can access applications hosted on Deis. See [Configuring DNS](http://docs.deis.io/en/latest/installing_deis/configure-dns/) for details.
80+
81+
If you want to allow `deis run` for one-off admin commands, you must provide an SSH private key that allows Deis to gather container logs on CoreOS hosts:
82+
83+
```console
84+
$ deisctl config platform set sshPrivateKey=<path-to-private-key>
85+
```
7486

7587
### Use Deis!
7688
After that, register with Deis!

contrib/ec2/README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,19 @@ $ deisctl install platform && deisctl start platform
122122
```
123123
Deisctl will deploy Deis and make sure the services start properly.
124124

125-
## Choose number of routers
126-
By default, deisctl will provision 1 router. You can override this by scaling up:
125+
## Configure Deis
126+
Set the default domain used to anchor your applications:
127+
128+
```console
129+
$ deisctl config platform set domain=mycluster.local
130+
```
131+
132+
For this to work, you'll need to configure DNS records so you can access applications hosted on Deis. See [Configuring DNS](http://docs.deis.io/en/latest/installing_deis/configure-dns/) for details.
133+
134+
If you want to allow `deis run` for one-off admin commands, you must provide an SSH private key that allows Deis to gather container logs on CoreOS hosts:
135+
127136
```console
128-
$ deisctl scale router=3
137+
$ deisctl config platform set sshPrivateKey=<path-to-private-key>
129138
```
130139

131140
## Configure load balancer

0 commit comments

Comments
 (0)