~clint-fewbar/pyjuju/charm-tests-spec

« back to all changes in this revision

Viewing changes to source/expose-services.rst

  • Committer: kapil.thangavelu at canonical
  • Date: 2011-12-09 13:32:33 UTC
  • Revision ID: kapil.thangavelu@canonical.com-20111209133233-j94pow3zhn1y3uc1
moveĀ docsĀ over

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Exposing a service
 
2
==================
 
3
 
 
4
In juju, making a service public -- its ports available for public
 
5
use -- requires that it be explicitly *exposed*. Note that this
 
6
exposing does not yet involve DNS or other directory information. For
 
7
now, it simply makes the service public.
 
8
 
 
9
Service exposing works by opening appropriate ports in the firewall of
 
10
the cloud provider. Because service exposing is necessarily tied to
 
11
the underlying provider, juju manages all aspects of
 
12
exposing. Such management ensures that a charm can work with other
 
13
cloud providers besides EC2, once support for them is implemented.
 
14
 
 
15
juju provides the ``juju expose`` command to expose a service.
 
16
For example, you might have deployed a ``my-wordpress`` service, which
 
17
is defined by a ``wordpress`` charm. To expose this service, simply
 
18
execute the following command::
 
19
 
 
20
    juju expose my-wordpress
 
21
 
 
22
To stop exposing this service, and make any corresponding firewall
 
23
changes immediately, you can run this command::
 
24
 
 
25
    juju unexpose my-wordpress
 
26
 
 
27
You can see the status of your exposed ports by running the ``juju
 
28
status`` command. If ports have been opened by the service and you
 
29
have exposed the service, then you will see something like the
 
30
following output for the deployed services::
 
31
 
 
32
  services:
 
33
    wordpress:
 
34
      exposed: true
 
35
      charm: local:oneiric/wordpress-42
 
36
      relations: {db: mysql}
 
37
      units:
 
38
        wordpress/0:
 
39
          machine: 2
 
40
          open-ports: [80/tcp]
 
41
          relations:
 
42
            db: {state: up}
 
43
          state: started