Difference between pages "Keystone" and "Welcome"

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
 
 
Line 1: Line 1:
[[Category:OpenStack]]
<div class="container" style="font-family: Open Sans; font-size: 14px; line-height: 20px;"><div class="row"><div class="col-xs-12 col-md-8 col-lg-8">
{{Slideshow}}
</div><div class="col-xs-12 col-md-4 col-lg-4">
'''Funtoo Linux''' is a Linux-based operating system that is a variant of [http://en.wikipedia.org/wiki/Gentoo_Linux Gentoo Linux], led by [[User:Drobbins|Daniel Robbins]] (the creator and former Chief Architect of Gentoo) who serves as benevolent dictator for life (BDFL) of the project. ''Funtoo Linux is optimized for the best possible performance, supporting Intel Core i7, AMD FX Processors, and others.''  [[Subarches|See what we support.]] See [[#Distinctives|Distinctives]], below, for more information about what makes us special.


Keystone is the OpenStack identity service, and is the most foundational Python-based component of OpenStack (that is, ignoring RabbitMQ and any SQL databases you might need). There is a server and client part of Keystone. Typically, Keystone is installed on a server, and the client can be installed anywhere (including the server) and is used to interact with Keystone using the OpenStack Identity API, which uses Web-based protocols as a means of client-server communication. The various components of OpenStack can be configured to connect to Keystone using ''service users'' so that they in turn can authenticate and authorize requests.
'''Other Funtoo Projects include''':
*  '''[[Keychain]]''', an SSH/GPG agent front-end.
* '''[[Metro]]''', automated Funtoo build engine.
* '''[[Linux_Fundamentals,_Part_1|Learn Linux]]'''! [[Awk_by_Example,_Part_1|Awk]], [[Bash_by_Example,_Part_1|Bash]], [[Sed_by_Example,_Part_1|Sed]]  and more.


== Definitions ==


This section describes the various concepts and definitions that are part of Keystone.
'''Ebuild pages recently updated:''' {{#ask: [[Category:Ebuilds]]
| order=descending
| sort=Modification date
| format=list
| limit=10
| searchlabel=
}} [[Ebuilds|more...]]


;Tenants: In Keystone, "tenants" represent logical groups of users to which resources are assigned. Virtual machines ([[Nova]]) and containers ([[Swift]]) are assigned to tenants, not to users directly. Keystone users can be part of more than one tenant, and can have different types of roles defined for each tenant that they're a part of. Think of tenants as a logical way to organize computing and storage resources without assigning them to user accounts directly. Keystone allows you to create and delete tenants, and also enable and disable them.
'''Want to submit a screenshot? [http://forums.funtoo.org/index.php?/topic/180-screenshots/ See here.]'''
</div></div><div class="row"><div class="col-xs-12">
{{Announce|[[Support Funtoo]] and help us grow! '''Donate $15 per month and get a free SSD-based [[Funtoo Hosting|Funtoo Virtual Container]].'''}}
</div></div><div class="row"><div class="col-xs-12 col-md-4 col-lg-4">
=== News ===
{{NewsList|3}}
[[News|View More News...]]


;Roles: A role is a common security concept, where a user is assigned a certain set of privileges. This set of privileges is called a role, has a name, and can be managed independently of the specific user account(s) that are part of the role. Keystone allows you to create and delete roles, add a user to a role for a specific tenant, remove a user from a role for a specific tenant, and of course list all the roles that have been defined.
=== Expand the wiki! ===


;Users: Keystone is used to define users. Users are accounts for specific individuals, and typically have a password and email associated with them. Keystone allows you to list, create, delete, enable/disable, update email addresses, and change passwords of Users.
The [[:Help:Funtoo_Editing_Guidelines | How to 'wiki']] will help get you started on wiki editing. Have a look at [[Requested-Documents]] and [[:Category:Needs_Updates | pages that need to be updated.]]


;Service Users: A service User is a user account created specifically for a component of OpenStack. Service users are typically added to the <tt>services</tt> tenant with the <tt>Admin</tt> role. For example, for [[Nova]], you would create a service User <tt>nova</tt>. Then you would configure Nova to use this Service User to connect to Keystone so that it can authenticate and authorize requests that it receives. See [http://keystone.openstack.org/configuringservices.html OpenStack Documentation on Configuring Services] for more information.
See [[:Category:Ebuilds|Ebuilds]] for a list of all ebuild pages, and [[Adding an Ebuild to the Wiki]] for information on how to add one.
</div><div class="col-sm-12 col-xs-12 col-md-4 col-lg-4">
=== Distinctives ===


;Services: Keystone allows you to define services, which are logical names for parts of OpenStack that provide internal or external capabilities, for things such as identity services, as well as compute and storage services.
Funtoo Linux is a meta-distribution, which means it is built (fully automatically) with the functionality and optimizations that ''you'' want, not what some distro maintainer thought was best for you. Packages are installed directly from source code, thanks to the [http://en.wikipedia.org/wiki/Portage_(software) Portage ports system], inspired by the FreeBSD ports system, written in Python and with full advanced package management functionality.  


;Service Endpoints: These are URLs that define where particular services can be accessed. Various parts of OpenStack will query Keystone for service endpoints that they require. Service endpoints can be created and deleted, and you can "get" a handle (URL) to a service that has been defined. You can also define region-specific service endpoints, so that different regions will be serviced differently.
''Benefits for desktops'': leaner, optimized, faster system. ''Additional benefits for servers'': enable only what you actually need to reduce attack surface, thus improving security.


;Service Catalog: Taken as a whole, all the service endpoints defined in Keystone are the ''service catalog'', defining all services available to OpenStack.
We use [http://en.wikipedia.org/wiki/Git_(software) Git] for all our development, and we also use Git to deliver our ports tree to you.


== First Steps ==
In contrast to Gentoo Linux, we offer a number of innovations, including our extensive use of git, [[Funtoo 1.0 Profile|our profile system]], [[Package:Boot-Update|boot-update]] boot management tool, our incredibly flexible [[Funtoo Linux Networking|template-based networking scripts]], [[Metro Quick Start Tutorial|Metro]] distribution build system, support of Debian, RHEL and other kernels, [[Creating_Python-related_Ebuilds|enhanced Python support]], Portage mini-manifests, user-centric distribution model, and a large number of community infrastructure improvements.
</div><div class="col-sm-12 col-xs-12 col-md-4 col-lg-4">
=== Getting Started ===


In Funtoo Linux, Keystone can be merged by typing:
'''[[Funtoo Linux Installation|Install Funtoo Linux]]''' and get involved in our user community. Get to know fellow users on our '''[http://forums.funtoo.org forums]'''. Funtoo Linux has a very active [http://en.wikipedia.org/wiki/IRC IRC] community on [http://freenode.net Freenode] (in the <code>#funtoo</code> channel) and you are encouraged to hang out with us.


<console>
'''[[Reporting Bugs|We welcome bug reports and suggestions]]'''.  Please report bugs to our '''[http://bugs.funtoo.org bug tracker]'''. We take all bugs seriously, and all work performed is tracked on our bug tracker, for purposes of transparency.
# ##i##emerge sys-auth/keystone
</console>


Emerging Keystone will also pull in <tt>sys-auth/keystone-client</tt> as a runtime dependency. <tt>keystone-client</tt> (which provides the <tt>keystone</tt> executable) is now maintained in a separate GitHub repository, and connects to Keystone using the OpenStack identity API. Once setting up <tt>/etc/keystone/keystone.conf</tt> and starting the Keystone service, you will use the <tt>keystone</tt> command to define tenants, users, roles, services and service endpoints.
'''{{CreateAccount}}''', which allows you to log in to the wiki, [http://forums.funtoo.org forums] and [https://bugs.funtoo.org bug tracker]. See the [[Funtoo Authentication FAQ|Auth FAQ]] for more info about account creation.


=== Configuration File ===
'''See our [[Funtoo Linux FAQ|FAQ]] for answers to common questions.'''


The configuration file for the Keystone service is located at <tt>/etc/keystone/keystone.conf</tt>. In this section, we will review important configuration file lines, some of which you will need to modify.
Other resources include [http://larrythecow.org larrythecow.org], the Gentoo blog aggregator, [http://kernel-seeds.org kernel-seeds.org], and [http://git.funtoo.org git.funtoo.org], our cgit repository browser.
</div></div></div>


==== DEFAULT Section ====
__NOTITLE__
__NOEDITSECTION__
{{#subobject:|slideIndex=0|slideCaption=
<h4>h3nnn4n</h4>


;<tt>public_port</tt>: This is the TCP port that non-administrators should access, and defaults to 5000. A number of Keystone commands will be disabled by default on this port, including those related to roles, services and endpoints.
Awesome WM / Conky / screenfetch
;<tt>admin_port</tt>: This is the TCP port that administrators will connect to perform regular (identical to public port) as well as administration tasks. All functionality is enabled on this port, and you can access this port without a user, by using the admin token.
|slideImage=File:H3nnn4n.jpg}}
;<tt>admin_token</tt>: This setting is a literal string that serves as the master password when connecting to the administration port.
{{#subobject:|slideIndex=1|slideCaption=
<h4>Help us document the Gentoo Ecosystem!</h4>
From Enoch to Gentoo to Funtoo to ChromeOS, and beyond...
|slideImage=File:Ecosystem-snapshot.jpg|slideLink=Gentoo Ecosystem}}
{{#subobject:|slideIndex=2|slideCaption=
<h4>brushdemon</h4>


=== sql Section ===
OpenBox / screenfetch
|slideImage=File:brushdemon.jpg}}
{{#subobject:|slideIndex=3|slideCaption=
<h4>drobbins</h4>


;<tt>connection</tt>: This is an SQLAlchemy connection string specifying what back-end SQL database to use for the Keystone database. A reasonable initial default is <tt>sqlite:////etc/keystone/keystone.db</tt>.
[[GNOME First Steps|GNOME 3.14]]  / [[Funtoo_Linux_FAQ#Do_you_support_systemd.3F|without systemd]] / Badgers optional
|slideImage=File:gnome3122.jpg|slideLink=GNOME First Steps}}


{{#subobject:|slideIndex=4|slideCaption=
<h4>spectromas</h4>


=== Initial Server Configuration ===
[[Package:Awesome_(Window_Manager)|Awesome WM]]
|slideImage=File:awesome.jpg|slideLink=Package:Awesome (Window Manager)}}


Here are the steps you can use to get the Keystone service up and running:
{{#seo:
 
|title=Funtoo Linux
# Copy <tt>/etc/keystone/keystone.conf.sample</tt> to <tt>/etc/keystone/keystone.conf</tt>.
|keywords=funtoo,linux,gentoo,Daniel Robbins
# Change the config line <tt>connection =</tt> to read <tt>sqlite:////etc/keystone/keystone.db</tt> (four slashes after the colon)
|description=Funtoo Linux is a Gentoo-based OS that uses a git-based Portage tree. Run by Daniel Robbins, creator of Gentoo.
# If desired, change the <tt>admin_token</tt> so that it is difficult to guess (especially important for production deployments). The examples below will use the default of '<tt>ADMIN</tt>'.
}}
# Type <tt>rc-update add keystone default</tt> to add Keystone to the default runlevel, if desired.
# Type <tt>/etc/init.d/keystone start</tt> to start the Keystone service so that you can perform further configuration.
 
Using SQLite as the database back-end like this is not a great idea for production deployment, but for learning about Keystone it works just fine.
 
Now, initialize the Keystone database:
 
<console>
# ##i##keystone-manage db_sync
</console>
 
The command above will initialize all necessary tables so that they are ready to store data.
 
=== Initial Authentication ===
 
To perform further configuration of the Keystone service, as well as to query Keystone, we will need to connect to the Keystone service using the keystone client, called <tt>keystone</tt>. Initially, you won't have any users, tenants, roles, or anything else set up, and this creates a chicken-and-egg authentication problem. How do you authenticate with Keystone before you have your own user account?
 
We get around this problem by having the <tt>admin_token = ADMIN</tt> (or other string you specified) setting in <tt>/etc/keystone/keystone.conf</tt> configuration file. This defines a special administration token that is the literal string '<tt>ADMIN</tt>', which can be used like a master password to get full remote control of Keystone so that you can configure it, when you are connecting to the admin port. As long as you know the <tt>admin_token</tt>, you will be able to administrate Keystone from any system that can connect to Keystone's admin port (which defaults to 35357).
 
{{fancyimportant|It is not a good idea to have an <tt>admin_token</tt> defined on a production Keystone installation. Use it for initial setup, and then disable it, and restart Keystone. Then use a user in the 'admin' role for administration via the admin port.}}
 
Let's see how this works in practice. First, we will want to define these environment variables in our shell:
 
<console>
$ ##i##export SERVICE_ENDPOINT=http://127.0.0.1:35357/v2.0/
$ ##i##export SERVICE_TOKEN=ADMIN
</console>
 
Above, we are authenticating against the admin port (35357) using the admin token we defined in <tt>/etc/keystone/keystone.conf</tt>. This grants us full access to the Keystone API so we can perform initial configuration. Let's run a sample command:
 
<console>
$ ##i##keystone tenant-list
+----+------+---------+
| id | name | enabled |
+----+------+---------+
+----+------+---------+
</console>
 
Above, we ran the <tt>keystone tenant-list</tt> command, at which point our client used both environment variables to connect to the Keystone service, query for all tenants, and successfully returned an empty list, because we haven't created any tenants yet.
If you see this output, then <tt>keystone</tt> used <tt>SERVICE_ENDPOINT</tt> and <tt>SERVICE_TOKEN</tt> environment variables to connect and successfully query Keystone for tenants. This means that Keystone is working properly and ready to be configured further.
 
'''Note:''' To debug authentication issues, type <tt>export KEYSTONECLIENT_DEBUG=1</tt> and retry your attempt.
 
=== User-Based Authentication ===
 
BETA user creation steps:
 
<console>
$ ##i##keystone role-create --name admin
$ ##i##kestone tenant-create --name admin
$ ##i##keystone user-create --name admin --pass 'mySekr1t' --email 'drobbins@funtoo.org' --tenant_id admin
$ ##i##keystone user-role-add --user 0c4a78317f234333a9a1116be1c7b022 --role 805d60f51e03478bbc2cf79ef2d42135 --tenant_id f988b76e5fe546f1a18c08c4d26bcb89
</console>
 
I need to expand on the above commands, but basically what we are doing is creating a role named <tt>admin</tt>, a tenant named <tt>admin</tt>, a user named <tt>admin</tt> (with a password), and then we are adding the <tt>admin</tt> user to the <tt>admin</tt> role for the <tt>admin</tt> tenant. The last command references the user, role and tenant by ID rather than name. This is one of the tricky aspects of the Keystone API -- sometimes you will need to use numeric IDs rather than logical names for some API commands. You can grab the proper ID by issuing <tt>user-list</tt>, <tt>tenant-list</tt>, or <tt>role-list</tt> <tt>keystone</tt> commands.
 
Once you have a user named <tt>admin</tt> created, here is how you will use <tt>keystone</tt> to connect to the Keystone service. First, we will want to define these environment variables, and it's a good idea to put these in <tt>~/.bashrc</tt> or <tt>~/.bash_profile</tt>:
 
{{fancynote|<tt>SERVICE_ENDPOINT</tt> and <tt>SERVICE_TOKEN</tt> must be unset in order to force the client to use user-based authentication. Otherwise it will assume that you are attempting to perform token-based authentication.}}
 
<console>
$ ##i##unset SERVICE_ENDPOINT
$ ##i##unset SERVICE_TOKEN
$ ##i##export OS_AUTH_URL=http://127.0.0.1:35357/v2.0/
</console>
 
{{fancynote|If you specify port 5000 instead of 35357 in the OS_AUTH_URL above, you will be connecting to the public port, and some administration functions will be unavailable. Using port 35357 will allow you to access the full functionality of the API.}}
 
Note that we no longer need to define <tt>SERVICE_TOKEN</tt>, because we're not using it anymore. Now, here's how we run a Keystone-related query:
 
<console>
$ ##i##keystone --os_username='admin' --os_password 'mySekr1t' user-list
+----------------------------------+---------+---------------------+-------+
|                id                | enabled |        email        |  name |
+----------------------------------+---------+---------------------+-------+
| 0c4a78317f234333a9a1116be1c7b022 | True    | drobbins@funtoo.org | admin |
+----------------------------------+---------+---------------------+-------+
</console>
 
If you get tired of specifying the two extra command-line arguments above, you can export the environment variables <tt>OS_USERNAME</tt> and <tt>OS_PASSWORD</tt> and Keystone will use them if defined. Note that it is not a good idea to store your plain-text password in any file.
 
Also note that when calling <tt>keystone</tt>, specify <tt>--os_username</tt> and <tt>--os_password</tt> first, before the command you are calling, such as <tt>service-create</tt>. Then, after <tt>service-create</tt>, you would specify any options related to service creation, such as <tt>--region</tt>.
 
== Service Catalog ==
 
The service catalog is an important concept for Keystone and OpenStack, because this is where you knit all of the various parts of your OpenStack deployment into a coherent whole that works together. So we are going to explore service catalog configuration in detail. There are two ways to set up a service catalog. One is to use a plain-text configuration file, and the other is to store your service catalog in a SQL back-end by using <tt>keystone service-create</tt> commands. The latter is recommended, but we will cover both approaches:
 
=== Plain-Text Catalog ===
 
In older versions of OpenStack, the service catalog was defined using a plain-text catalog file. This method is still supported by OpenStack, but I think it's a bit confusing and using the SQL method documented in the next section is recommended. However, I am including documentation on the plain-text catalog because it shows up in a lot of OpenStack documentation so it's helpful to be familiar with how it works.
 
To enable the plain-text catalog, you would add the following settings to <tt>/etc/keystone/keystone.conf</tt>:
 
<pre>
[catalog]
driver = keystone.catalog.backends.templated.TemplatedCatalog
template_file = /etc/keystone/service_catalog
</pre>
 
You would then define a plain-text catalog at <tt>/etc/keystone/service_catalog</tt>. An example service catalog is installed at <tt>/usr/share/doc/keystone-9999/etc/default_catalog.templates.bz2</tt>
 
Once this is enabled in your configuration, and keystone is restarted, then the service catalog will be defined in Keystone. At this point, it will not be possible to define any services using the SQL method, via <tt>keystone service-create</tt>.
 
=== SQL-based Catalog ===
 
The SQL-based service catalog does not require any additional configuration besides ensuring that a SQL backend is configured for Keystone, which is a typical part of the install process.
 
To create a service endpoint, you would first define the service, using a command like this:
 
<console>
$ ##i##keystone service-create --name=nova --type=compute --description="Nova Compute Service"
+-------------+----------------------------------+
|  Property  |              Value              |
+-------------+----------------------------------+
| description | Nova Compute Service            |
| id          | c3600f9e26be495f9b0ed1328c33a436 |
| name        | nova                            |
| type        | compute                          |
+-------------+----------------------------------+
</console>
 
Now that the service is defined, we can define an endpoint for this service, for region <tt>RegionOne</tt>:
 
<console>
$ ##i##keystone endpoint-create --region RegionOne --service_id c3600f9e26be495f9b0ed1328c33a436 \
##i##--publicurl 'http://127.0.0.1:$(compute_port)s/v1.1/$(tenant_id)s' \
##i##--adminurl 'http://127.0.0.1:$(compute_port)s/v1.1/$(tenant_id)s' \
##i##--internalurl 'http://127.0.0.1:$(compute_port)s/v1.1/$(tenant_id)s'
</console>
 
== Resources ==
 
OpenStack Identity Service:
 
* http://docs.openstack.org/api/openstack-identity-service/2.0/content/
* https://github.com/openstack/identity-api

Revision as of 04:54, January 2, 2015

Funtoo Linux is a Linux-based operating system that is a variant of Gentoo Linux, led by Daniel Robbins (the creator and former Chief Architect of Gentoo) who serves as benevolent dictator for life (BDFL) of the project. Funtoo Linux is optimized for the best possible performance, supporting Intel Core i7, AMD FX Processors, and others. See what we support. See Distinctives, below, for more information about what makes us special.

Other Funtoo Projects include:


Ebuild pages recently updated: {{#ask: | order=descending | sort=Modification date | format=list | limit=10 | searchlabel= }} more...

Want to submit a screenshot? See here.

   {{{title}}}
{{{body}}}

News

Ego-2.2.0 Released

User:Drobbins
2017-10-18 by
Drobbins

Latest Innovations

This news item documents the latest innovations now available under Funtoo Linux.
2017-09-07 by Drobbins
More... View More News...

Expand the wiki!

The How to 'wiki' will help get you started on wiki editing. Have a look at Requested-Documents and pages that need to be updated.

See Ebuilds for a list of all ebuild pages, and Adding an Ebuild to the Wiki for information on how to add one.

Distinctives

Funtoo Linux is a meta-distribution, which means it is built (fully automatically) with the functionality and optimizations that you want, not what some distro maintainer thought was best for you. Packages are installed directly from source code, thanks to the Portage ports system, inspired by the FreeBSD ports system, written in Python and with full advanced package management functionality.

Benefits for desktops: leaner, optimized, faster system. Additional benefits for servers: enable only what you actually need to reduce attack surface, thus improving security.

We use Git for all our development, and we also use Git to deliver our ports tree to you.

In contrast to Gentoo Linux, we offer a number of innovations, including our extensive use of git, our profile system, boot-update boot management tool, our incredibly flexible template-based networking scripts, Metro distribution build system, support of Debian, RHEL and other kernels, enhanced Python support, Portage mini-manifests, user-centric distribution model, and a large number of community infrastructure improvements.

Getting Started

Install Funtoo Linux and get involved in our user community. Get to know fellow users on our forums. Funtoo Linux has a very active IRC community on Freenode (in the #funtoo channel) and you are encouraged to hang out with us.

We welcome bug reports and suggestions. Please report bugs to our bug tracker. We take all bugs seriously, and all work performed is tracked on our bug tracker, for purposes of transparency.

Create a Funtoo account, which allows you to log in to the wiki, forums and bug tracker. See the Auth FAQ for more info about account creation.

See our FAQ for answers to common questions.

Other resources include larrythecow.org, the Gentoo blog aggregator, kernel-seeds.org, and git.funtoo.org, our cgit repository browser.


{{#subobject:|slideIndex=0|slideCaption=

h3nnn4n

Awesome WM / Conky / screenfetch |slideImage=File:H3nnn4n.jpg}} {{#subobject:|slideIndex=1|slideCaption=

Help us document the Gentoo Ecosystem!

From Enoch to Gentoo to Funtoo to ChromeOS, and beyond... |slideImage=File:Ecosystem-snapshot.jpg|slideLink=Gentoo Ecosystem}} {{#subobject:|slideIndex=2|slideCaption=

brushdemon

OpenBox / screenfetch |slideImage=File:brushdemon.jpg}} {{#subobject:|slideIndex=3|slideCaption=

drobbins

GNOME 3.14 / without systemd / Badgers optional |slideImage=File:gnome3122.jpg|slideLink=GNOME First Steps}}

{{#subobject:|slideIndex=4|slideCaption=

spectromas

Awesome WM |slideImage=File:awesome.jpg|slideLink=Package:Awesome (Window Manager)}}

{{#seo: |title=Funtoo Linux |keywords=funtoo,linux,gentoo,Daniel Robbins |description=Funtoo Linux is a Gentoo-based OS that uses a git-based Portage tree. Run by Daniel Robbins, creator of Gentoo. }}