github.com/mhilton/juju-juju@v0.0.0-20150901100907-a94dd2c73455/cmd/juju/helptopics/systems.go (about) 1 // Copyright 2015 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package helptopics 5 6 const JujuSystems = ` 7 8 In order to use the multiple environment features of JES, you need to enable 9 a development feature flag: 10 11 export JUJU_DEV_FEATURE_FLAGS=jes 12 13 This should be the default behaviour with Juju 1.26. 14 15 A Juju Environment System (JES), also sometimes shortened to 'juju system', 16 describes the environment that runs and manages the Juju API servers and the 17 underlying database. 18 19 This initial environment is also called the system environment, and is what is 20 created when the bootstrap command is called. This system environment is a 21 normal Juju environment that just happens to have machines that manage Juju. 22 23 In order to keep a clean separation of concerns, it is considered best 24 practice to create additional environments for real workload deployment. 25 26 Services can still be deployed to the system environment, but it is generally 27 expected that these services are more for management and monitoring purposes, 28 like landscape and nagios. 29 30 When creating a Juju system that is going to be used by more than one person, 31 it is good practice to create users for each individual that will be accessing 32 the environments. 33 34 Users are managed within the Juju system using the 'juju user' command. This 35 allows the creation, listing, and disabling of users. When a juju system is 36 initially bootstrapped, there is only one user. Additional users are created 37 as follows: 38 39 $ juju user add bob "Bob Brown" 40 user "Bob Brown (bob)" added 41 server file written to /current/working/directory/bob.server 42 43 This command will create a local file "bob.server". The name of the file is 44 customisable using the --output option on the command. This 'server file' 45 should then be sent to Bob. Bob can then use this file to login to the Juju 46 system. 47 48 The system file contains everything that Juju needs to connect to the API 49 server of the Juju system. It has the network address, server certificate, 50 username and a randomly generated password. 51 52 Juju needs to have a name for the system when Bob calls the login command. 53 This is used to identify the system by name for other commands, like switch. 54 55 When Bob logs in to the system, a different random password is generated and 56 cached locally. This does mean that this particular server file is not usable 57 a second time. If Bob does not want to change the password, he can use the 58 --keep-password flag. 59 60 $ juju system login --server=bob.server staging 61 cached connection details as system "staging" 62 -> staging (system) 63 64 Bob can then list all the environments within that system that he has access 65 to: 66 67 $ juju system environments 68 NAME OWNER LAST CONNECTION 69 70 The list could well be empty. Bob can create an environment to use: 71 72 $ juju system create-environment test 73 created environment "test" 74 staging (system) -> test 75 76 When the environment has been created, it becomes the current environment. A 77 new environment has no machines, and no services. 78 79 $ juju status 80 environment: test 81 machines: {} 82 services: {} 83 84 Bob wants to collaborate with Mary on this environment. A user for Mary needs 85 to exist in the system before Bob is able to share the environment with her. 86 87 $ juju environment share mary 88 ERROR could not share environment: user "mary" does not exist locally: user "mary" not found 89 90 Bob gets the system administrator to add a user for Mary, and then shares the 91 environment with Mary. 92 93 $ juju environment share mary 94 $ juju environment users 95 NAME DATE CREATED LAST CONNECTION 96 bob@local 5 minutes ago just now 97 mary@local 57 seconds ago never connected 98 99 When Mary has used her credentials to connect to the juju system, she can see 100 Bob's environment. 101 102 $ juju system environments 103 NAME OWNER LAST CONNECTION 104 test bob@local never connected 105 106 Mary can use this environment. 107 108 $ juju system use-environment test 109 mary-server (system) -> bob-test 110 111 The local name for the environment is by default 'owner-name', so since this 112 environment is owned by 'bob@local' and called test, for mary the environment 113 is called 'bob-test'. 114 115 `