github.com/mhilton/juju-juju@v0.0.0-20150901100907-a94dd2c73455/cmd/juju/helptopics/providers.go (about)

     1  // Copyright 2015 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package helptopics
     5  
     6  const (
     7  	LocalProvider     = helpProviderStart + helpLocalProvider + helpProviderEnd
     8  	OpenstackProvider = helpProviderStart + helpOpenstackProvider + helpProviderEnd
     9  	EC2Provider       = helpProviderStart + helpEC2Provider + helpProviderEnd
    10  	HPCloud           = helpProviderStart + helpHPCloud + helpProviderEnd
    11  	AzureProvider     = helpProviderStart + helpAzureProvider + helpProviderEnd
    12  	MAASProvider      = helpProviderStart + helpMAASProvider + helpProviderEnd
    13  )
    14  
    15  const helpProviderStart = `
    16  Start by generating a generic configuration file for Juju, using the command:
    17  
    18    juju init
    19  
    20  This will create the '~/.juju/' directory (or $JUJU_HOME, if set) if it doesn't
    21  already exist and generate a file, 'environments.yaml' in that directory.
    22  `
    23  const helpProviderEnd = `
    24  See Also:
    25  
    26    juju help init
    27    juju help bootstrap
    28  
    29  `
    30  
    31  const helpLocalProvider = `
    32  The local provider is a Linux-only Juju environment that uses LXC containers as
    33  a virtual cloud on the local machine.  Because of this, lxc and mongodb are
    34  required for the local provider to work. All of these dependencies are tracked
    35  in the 'juju-local' package. You can install that with:
    36  
    37    sudo apt-get update
    38    sudo apt-get install juju-local
    39  
    40  After that you might get error for SSH authorised/public key not found. ERROR
    41  SSH authorised/public key not found.
    42  
    43    ssh-keygen -t rsa
    44  
    45  Now you need to tell Juju to use the local provider and then bootstrap:
    46  
    47    juju switch local
    48    juju bootstrap
    49  
    50  The first time this runs it might take a bit, as it's doing a netinstall for
    51  the container, it's around a 300 megabyte download. Subsequent bootstraps
    52  should be much quicker. You'll be asked for your 'sudo' password, which is
    53  needed because only root can create LXC containers. When you need to destroy
    54  the environment, do 'juju destroy-environment local' and you could be asked
    55  for your 'sudo' password again.
    56  
    57  You deploy charms from the charm store using the following commands:
    58  
    59    juju deploy mysql
    60    juju deploy wordpress
    61    juju add-relation wordpress mysql
    62  
    63  For Ubuntu deployments, the local provider will prefer to use lxc-clone to create
    64  the machines for the trusty OS series and later.
    65  A 'template' container is created with the name
    66    juju-<series>-template
    67  where <series> is the OS series, for example 'juju-trusty-template'.
    68  You can override the use of clone by specifying
    69    lxc-clone: true
    70  or
    71    lxc-clone: false
    72  in the configuration for your local provider.  If you have the main container
    73  directory mounted on a btrfs partition, then the clone will be using btrfs
    74  snapshots to create the containers. This means that clones use up much
    75  less disk space.  If you do not have btrfs, lxc will attempt to use aufs
    76  (an overlay type filesystem). You can explicitly ask Juju to create
    77  full containers and not overlays by specifying the following in the provider
    78  configuration:
    79    lxc-clone-aufs: false
    80  
    81  
    82  References:
    83  
    84    http://askubuntu.com/questions/65359/how-do-i-configure-juju-for-local-usage
    85    https://juju.ubuntu.com/docs/getting-started.html
    86  `
    87  
    88  const helpOpenstackProvider = `
    89  Here's an example OpenStack configuration:
    90  
    91    sample_openstack:
    92      type: openstack
    93  
    94      # Specifies whether the use of a floating IP address is required to
    95      # give the nodes a public IP address. Some installations assign public
    96      # IP addresses by default without requiring a floating IP address.
    97      # use-floating-ip: false
    98  
    99      # Specifies whether new machine instances should have the "default"
   100      # Openstack security group assigned.
   101      # use-default-secgroup: false
   102  
   103      # Usually set via the env variable OS_AUTH_URL, but can be specified here
   104      # auth-url: https://yourkeystoneurl:443/v2.0/
   105  
   106      # The following are used for userpass authentication (the default)
   107      # auth-mode: userpass
   108  
   109      # Usually set via the env variable OS_USERNAME, but can be specified here
   110      # username: <your username>
   111  
   112      # Usually set via the env variable OS_PASSWORD, but can be specified here
   113      # password: <secret>
   114  
   115      # Usually set via the env variable OS_TENANT_NAME, but can be specified here
   116      # tenant-name: <your tenant name>
   117  
   118      # Usually set via the env variable OS_REGION_NAME, but can be specified here
   119      # region: <your region>
   120  
   121  If you have set the described OS_* environment variables, you only need "type:".
   122  References:
   123  
   124    http://juju.ubuntu.com/docs/provider-configuration-openstack.html
   125    http://askubuntu.com/questions/132411/how-can-i-configure-juju-for-deployment-on-openstack
   126  
   127  Placement directives:
   128  
   129    OpenStack environments support the following placement directives for use
   130    with "juju bootstrap" and "juju add-machine":
   131  
   132      zone=<availability-zone-name>
   133        The "zone" placement directive instructs the OpenStack provider to
   134        allocate a machine in the specified availability zone. If the zone
   135        does not exist, or a machine cannot be allocated within it, then
   136        the machine addition will fail.
   137  
   138  Other OpenStack Based Clouds:
   139  
   140  This answer is for generic OpenStack support, if you're using an OpenStack-based
   141  provider check these questions out for provider-specific information:
   142  
   143    https://juju.ubuntu.com/docs/config-hpcloud.html
   144  
   145  `
   146  
   147  const helpEC2Provider = `
   148  Configuring the EC2 environment requires telling Juju about your AWS access key
   149  and secret key. To do this, you can either set the 'AWS_ACCESS_KEY_ID' and
   150  'AWS_SECRET_ACCESS_KEY' environment variables[1] (as usual for other EC2 tools)
   151  or you can add access-key and secret-key options to your environments.yaml.
   152  These are already in place in the generated config, you just need to uncomment
   153  them out. For example:
   154  
   155    sample_ec2:
   156      type: ec2
   157      # access-key: YOUR-ACCESS-KEY-GOES-HERE
   158      # secret-key: YOUR-SECRET-KEY-GOES-HERE
   159  
   160  See the EC2 provider documentation[2] for more options.
   161  
   162  Note If you already have an AWS account, you can determine your access key by
   163  visiting your account page[3], clicking "Security Credentials" and then clicking
   164  "Access Credentials". You'll be taken to a table that lists your access keys and
   165  has a "show" link for each access key that will reveal the associated secret
   166  key.
   167  
   168  And that's it, you're ready to go!
   169  
   170  Placement directives:
   171  
   172    EC2 environments support the following placement directives for use with
   173    "juju bootstrap" and "juju add-machine":
   174  
   175      zone=<availability-zone-name>
   176        The "zone" placement directive instructs the EC2 provider to
   177        allocate a machine in the specified availability zone. If the zone
   178        does not exist, or a machine cannot be allocated within it, then
   179        the machine addition will fail.
   180  
   181  References:
   182  
   183    [1]: http://askubuntu.com/questions/730/how-do-i-set-environment-variables
   184    [2]: https://juju.ubuntu.com/docs/provider-configuration-ec2.html
   185    [3]: http://aws.amazon.com/account
   186  
   187  More information:
   188  
   189    https://juju.ubuntu.com/docs/getting-started.html
   190    https://juju.ubuntu.com/docs/provider-configuration-ec2.html
   191    http://askubuntu.com/questions/225513/how-do-i-configure-juju-to-use-amazon-web-services-aws
   192  `
   193  
   194  const helpHPCloud = `
   195  HP Cloud is an Openstack cloud provider.  To deploy to it, use an openstack
   196  environment type for Juju, which would look something like this:
   197  
   198    sample_hpcloud:
   199      type: openstack
   200      tenant-name: "juju-project1"
   201      auth-url: https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/
   202      auth-mode: userpass
   203      username: "xxxyour-hpcloud-usernamexxx"
   204      password: "xxxpasswordxxx"
   205      region: az-1.region-a.geo-1
   206  
   207  See the online help for more information:
   208  
   209    https://juju.ubuntu.com/docs/config-hpcloud.html
   210  `
   211  
   212  const helpAzureProvider = `
   213  A generic Windows Azure environment looks like this:
   214  
   215    sample_azure:
   216      type: azure
   217  
   218      # Location for instances, e.g. West US, North Europe.
   219      location: West US
   220  
   221      # http://msdn.microsoft.com/en-us/library/windowsazure
   222      # Windows Azure Management info.
   223      management-subscription-id: 886413e1-3b8a-5382-9b90-0c9aee199e5d
   224      management-certificate-path: /home/me/azure.pem
   225  
   226      # Windows Azure Storage info.
   227      storage-account-name: juju0useast0
   228  
   229      # Override OS image selection with a fixed image for all deployments.
   230      # Most useful for developers.
   231      # force-image-name: b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-DEVELOPMENT-20130713-Juju_ALPHA-en-us-30GB
   232  
   233      # image-stream chooses a simplestreams stream from which to select
   234      # OS images, for example daily or released images (or any other stream
   235      # available on simplestreams).
   236      #
   237      # image-stream: "released"
   238  
   239      # agent-stream chooses a simplestreams stream from which to select tools,
   240      # for example released or proposed tools (or any other stream available
   241      # on simplestreams).
   242      #
   243      # agent-stream: "released"
   244  
   245  This is the environments.yaml configuration file needed to run on Windows Azure.
   246  You will need to set the management-subscription-id, management-certificate-
   247  path, and storage-account-name.
   248  
   249  Note: Other than location, the defaults are recommended, but can be updated to
   250  your preference.
   251  
   252  See the online help for more information:
   253  
   254    https://juju.ubuntu.com/docs/config-azure.html
   255  `
   256  
   257  const helpMAASProvider = `
   258  A generic MAAS environment looks like this:
   259  
   260    sample_maas:
   261      type: maas
   262      maas-server: 'http://<my-maas-server>:80/MAAS'
   263      maas-oauth: 'MAAS-API-KEY'
   264  
   265  The API key can be obtained from the preferences page in the MAAS web UI.
   266  
   267  Placement directives:
   268  
   269    MAAS environments support the following placement directives for use with
   270    "juju bootstrap" and "juju add-machine":
   271  
   272      zone=<physical-zone-name>
   273        The "zone" placement directive instructs the MAAS provider to
   274        allocate a machine in the specified availability zone. If the zone
   275        does not exist, or a machine cannot be allocated within it, then
   276        the machine addition will fail.
   277  
   278      <hostname>
   279        If the placement directive does not contain an "=" symbol, then
   280        it is assumed to be the hostname of a node in MAAS. MAAS will attempt
   281        to acquire that node and will fail if it cannot.
   282  
   283  See the online help for more information:
   284  
   285    https://juju.ubuntu.com/docs/config-maas.html
   286  `