Skip to content

Commit f6286cb

Browse files
committed
Drop keystone dedicated ports
Those historic references to port 5000 and 35357 aren't being used anymore for some time, so let us drop them. Clean up some python2/3 wording along the way. No longer mention Identity API v2, which is also a thing of the past. Change-Id: Iafff097eee082f24ea2ae27ad038ad115aa36c61
1 parent 32c0089 commit f6286cb

File tree

6 files changed

+12
-137
lines changed

6 files changed

+12
-137
lines changed

doc/source/configuration.rst

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ OS\_AUTH\_URL
137137

138138
::
139139

140-
OS_AUTH_URL=http://$SERVICE_HOST:5000/v3.0
140+
OS_AUTH_URL=http://$SERVICE_HOST/identity/v3.0
141141

142142
KEYSTONECLIENT\_DEBUG, NOVACLIENT\_DEBUG
143143
Set command-line client log level to ``DEBUG``. These are commented
@@ -430,16 +430,16 @@ Python bindings added when they are enabled.
430430

431431
ADDITIONAL_VENV_PACKAGES="python-foo, python-bar"
432432

433-
Use python3
433+
Use python2
434434
------------
435435

436-
By default ``stack.sh`` uses python2 (the exact version set by the
437-
``PYTHON2_VERSION``). This can be overriden so devstack will run
438-
python3 (the exact version set by ``PYTHON3_VERSION``).
436+
By default ``stack.sh`` uses python3 (the exact version set by the
437+
``PYTHON3_VERSION``). This can be overriden so devstack will run
438+
python2 (the exact version set by ``PYTHON2_VERSION``).
439439

440440
::
441441

442-
USE_PYTHON3=True
442+
USE_PYTHON3=False
443443

444444
A clean install every time
445445
--------------------------
@@ -696,16 +696,6 @@ KEYSTONE_REGION_NAME to specify the region of Keystone service.
696696
KEYSTONE_REGION_NAME has a default value the same as REGION_NAME thus we omit
697697
it in the configuration of RegionOne.
698698

699-
Disabling Identity API v2
700-
+++++++++++++++++++++++++
701-
702-
The Identity API v2 is deprecated as of Mitaka and it is recommended to only
703-
use the v3 API. It is possible to setup keystone without v2 API, by doing:
704-
705-
::
706-
707-
ENABLE_IDENTITY_V2=False
708-
709699
.. _arch-configuration:
710700

711701
Architectures

files/apache-keystone.template

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,9 @@
1-
Listen %PUBLICPORT%
2-
Listen %ADMINPORT%
31
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" %D(us)" keystone_combined
42

53
<Directory %KEYSTONE_BIN%>
64
Require all granted
75
</Directory>
86

9-
<VirtualHost *:%PUBLICPORT%>
10-
WSGIDaemonProcess keystone-public processes=3 threads=1 user=%USER% display-name=%{GROUP} %VIRTUALENV%
11-
WSGIProcessGroup keystone-public
12-
WSGIScriptAlias / %KEYSTONE_BIN%/keystone-wsgi-public
13-
WSGIApplicationGroup %{GLOBAL}
14-
WSGIPassAuthorization On
15-
ErrorLogFormat "%M"
16-
ErrorLog /var/log/%APACHE_NAME%/keystone.log
17-
CustomLog /var/log/%APACHE_NAME%/keystone_access.log keystone_combined
18-
%SSLENGINE%
19-
%SSLCERTFILE%
20-
%SSLKEYFILE%
21-
</VirtualHost>
22-
23-
<VirtualHost *:%ADMINPORT%>
24-
WSGIDaemonProcess keystone-admin processes=3 threads=1 user=%USER% display-name=%{GROUP} %VIRTUALENV%
25-
WSGIProcessGroup keystone-admin
26-
WSGIScriptAlias / %KEYSTONE_BIN%/keystone-wsgi-admin
27-
WSGIApplicationGroup %{GLOBAL}
28-
WSGIPassAuthorization On
29-
ErrorLogFormat "%M"
30-
ErrorLog /var/log/%APACHE_NAME%/keystone.log
31-
CustomLog /var/log/%APACHE_NAME%/keystone_access.log keystone_combined
32-
%SSLENGINE%
33-
%SSLCERTFILE%
34-
%SSLKEYFILE%
35-
</VirtualHost>
36-
377
%SSLLISTEN%<VirtualHost *:443>
388
%SSLLISTEN% %SSLENGINE%
399
%SSLLISTEN% %SSLCERTFILE%

lib/keystone

Lines changed: 4 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,10 @@ KEYSTONE_TOKEN_FORMAT=$(echo ${KEYSTONE_TOKEN_FORMAT} | tr '[:upper:]' '[:lower:
8383

8484
# Set Keystone interface configuration
8585
KEYSTONE_AUTH_HOST=${KEYSTONE_AUTH_HOST:-$SERVICE_HOST}
86-
KEYSTONE_AUTH_PORT=${KEYSTONE_AUTH_PORT:-35357}
87-
KEYSTONE_AUTH_PORT_INT=${KEYSTONE_AUTH_PORT_INT:-35358}
8886
KEYSTONE_AUTH_PROTOCOL=${KEYSTONE_AUTH_PROTOCOL:-$SERVICE_PROTOCOL}
8987

9088
# Public facing bits
9189
KEYSTONE_SERVICE_HOST=${KEYSTONE_SERVICE_HOST:-$SERVICE_HOST}
92-
KEYSTONE_SERVICE_PORT=${KEYSTONE_SERVICE_PORT:-5000}
93-
KEYSTONE_SERVICE_PORT_INT=${KEYSTONE_SERVICE_PORT_INT:-5001}
9490
KEYSTONE_SERVICE_PROTOCOL=${KEYSTONE_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
9591

9692
# Bind hosts
@@ -170,22 +166,14 @@ function _config_keystone_apache_wsgi {
170166
local keystone_ssl=""
171167
local keystone_certfile=""
172168
local keystone_keyfile=""
173-
local keystone_service_port=$KEYSTONE_SERVICE_PORT
174-
local keystone_auth_port=$KEYSTONE_AUTH_PORT
175169
local venv_path=""
176170

177-
if is_service_enabled tls-proxy; then
178-
keystone_service_port=$KEYSTONE_SERVICE_PORT_INT
179-
keystone_auth_port=$KEYSTONE_AUTH_PORT_INT
180-
fi
181171
if [[ ${USE_VENV} = True ]]; then
182172
venv_path="python-path=${PROJECT_VENV["keystone"]}/lib/$(python_version)/site-packages"
183173
fi
184174

185175
sudo cp $FILES/apache-keystone.template $keystone_apache_conf
186176
sudo sed -e "
187-
s|%PUBLICPORT%|$keystone_service_port|g;
188-
s|%ADMINPORT%|$keystone_auth_port|g;
189177
s|%APACHE_NAME%|$APACHE_NAME|g;
190178
s|%SSLLISTEN%|$keystone_ssl_listen|g;
191179
s|%SSLENGINE%|$keystone_ssl|g;
@@ -222,21 +210,8 @@ function configure_keystone {
222210

223211
iniset_rpc_backend keystone $KEYSTONE_CONF oslo_messaging_notifications
224212

225-
local service_port=$KEYSTONE_SERVICE_PORT
226-
local auth_port=$KEYSTONE_AUTH_PORT
227-
228-
if is_service_enabled tls-proxy; then
229-
# Set the service ports for a proxy to take the originals
230-
service_port=$KEYSTONE_SERVICE_PORT_INT
231-
auth_port=$KEYSTONE_AUTH_PORT_INT
232-
fi
233-
234213
# Override the endpoints advertised by keystone (the public_endpoint and
235-
# admin_endpoint) so that clients use the correct endpoint. By default, the
236-
# keystone server uses the public_port and admin_port which isn't going to
237-
# work when you want to use a different port (in the case of proxy), or you
238-
# don't want the port (in the case of putting keystone on a path in
239-
# apache).
214+
# admin_endpoint) so that clients use the correct endpoint.
240215
iniset $KEYSTONE_CONF DEFAULT public_endpoint $KEYSTONE_SERVICE_URI
241216
iniset $KEYSTONE_CONF DEFAULT admin_endpoint $KEYSTONE_AUTH_URI
242217

@@ -270,12 +245,6 @@ function configure_keystone {
270245

271246
iniset $KEYSTONE_CONF credential key_repository "$KEYSTONE_CONF_DIR/credential-keys/"
272247

273-
# Configure the project created by the 'keystone-manage bootstrap' as the cloud-admin project.
274-
# The users from this project are globally admin as before, but it also
275-
# allows policy changes in order to clarify the adminess scope.
276-
#iniset $KEYSTONE_CONF resource admin_project_domain_name Default
277-
#iniset $KEYSTONE_CONF resource admin_project_name admin
278-
279248
if [[ "$KEYSTONE_SECURITY_COMPLIANCE_ENABLED" = True ]]; then
280249
iniset $KEYSTONE_CONF security_compliance lockout_failure_attempts $KEYSTONE_LOCKOUT_FAILURE_ATTEMPTS
281250
iniset $KEYSTONE_CONF security_compliance lockout_duration $KEYSTONE_LOCKOUT_DURATION
@@ -510,14 +479,6 @@ function install_keystone {
510479

511480
# start_keystone() - Start running processes
512481
function start_keystone {
513-
# Get right service port for testing
514-
local service_port=$KEYSTONE_SERVICE_PORT
515-
local auth_protocol=$KEYSTONE_AUTH_PROTOCOL
516-
if is_service_enabled tls-proxy; then
517-
service_port=$KEYSTONE_SERVICE_PORT_INT
518-
auth_protocol="http"
519-
fi
520-
521482
if [ "$KEYSTONE_DEPLOY" == "mod_wsgi" ]; then
522483
enable_apache_site keystone
523484
restart_apache_server
@@ -526,23 +487,13 @@ function start_keystone {
526487
fi
527488

528489
echo "Waiting for keystone to start..."
529-
# Check that the keystone service is running. Even if the tls tunnel
530-
# should be enabled, make sure the internal port is checked using
531-
# unencryted traffic at this point.
532-
# If running in Apache, use the path rather than port.
533-
490+
# Check that the keystone service is running.
534491
local service_uri=$auth_protocol://$KEYSTONE_SERVICE_HOST/identity/v$IDENTITY_API_VERSION/
535492

536493
if ! wait_for_service $SERVICE_TIMEOUT $service_uri; then
537494
die $LINENO "keystone did not start"
538495
fi
539496

540-
# Start proxies if enabled
541-
if is_service_enabled tls-proxy; then
542-
start_tls_proxy keystone-service '*' $KEYSTONE_SERVICE_PORT $KEYSTONE_SERVICE_HOST $KEYSTONE_SERVICE_PORT_INT
543-
start_tls_proxy keystone-auth '*' $KEYSTONE_AUTH_PORT $KEYSTONE_AUTH_HOST $KEYSTONE_AUTH_PORT_INT
544-
fi
545-
546497
# (re)start memcached to make sure we have a clean memcache.
547498
restart_service memcached
548499
}
@@ -561,11 +512,9 @@ function stop_keystone {
561512
# This function uses the following GLOBAL variables:
562513
# - ``KEYSTONE_BIN_DIR``
563514
# - ``ADMIN_PASSWORD``
564-
# - ``IDENTITY_API_VERSION``
515+
# - ``KEYSTONE_AUTH_URI``
565516
# - ``REGION_NAME``
566-
# - ``KEYSTONE_SERVICE_PROTOCOL``
567-
# - ``KEYSTONE_SERVICE_HOST``
568-
# - ``KEYSTONE_SERVICE_PORT``
517+
# - ``KEYSTONE_SERVICE_URI``
569518
function bootstrap_keystone {
570519
$KEYSTONE_BIN_DIR/keystone-manage bootstrap \
571520
--bootstrap-username admin \

openrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export OS_AUTH_TYPE=password
8686
#
8787

8888
# If you don't have a working .stackenv, this is the backup position
89-
KEYSTONE_BACKUP=$SERVICE_PROTOCOL://$SERVICE_HOST:5000
89+
KEYSTONE_BACKUP=$SERVICE_PROTOCOL://$SERVICE_HOST/identity
9090
KEYSTONE_SERVICE_URI=${KEYSTONE_SERVICE_URI:-$KEYSTONE_BACKUP}
9191

9292
export OS_AUTH_URL=${OS_AUTH_URL:-$KEYSTONE_SERVICE_URI}

tools/create_userrc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ if [ -z "$OS_USERNAME" ]; then
152152
fi
153153

154154
if [ -z "$OS_AUTH_URL" ]; then
155-
export OS_AUTH_URL=http://localhost:5000/v3/
155+
export OS_AUTH_URL=http://localhost/identity/v3/
156156
fi
157157

158158
if [ -z "$OS_USER_DOMAIN_ID" -a -z "$OS_USER_DOMAIN_NAME" ]; then

tools/fixup_stuff.sh

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,39 +26,6 @@ if [[ -z "$TOP_DIR" ]]; then
2626
FILES=$TOP_DIR/files
2727
fi
2828

29-
# Keystone Port Reservation
30-
# -------------------------
31-
# Reserve and prevent ``KEYSTONE_AUTH_PORT`` and ``KEYSTONE_AUTH_PORT_INT`` from
32-
# being used as ephemeral ports by the system. The default(s) are 35357 and
33-
# 35358 which are in the Linux defined ephemeral port range (in disagreement
34-
# with the IANA ephemeral port range). This is a workaround for bug #1253482
35-
# where Keystone will try and bind to the port and the port will already be
36-
# in use as an ephemeral port by another process. This places an explicit
37-
# exception into the Kernel for the Keystone AUTH ports.
38-
function fixup_keystone {
39-
keystone_ports=${KEYSTONE_AUTH_PORT:-35357},${KEYSTONE_AUTH_PORT_INT:-35358}
40-
41-
# Only do the reserved ports when available, on some system (like containers)
42-
# where it's not exposed we are almost pretty sure these ports would be
43-
# exclusive for our DevStack.
44-
if sysctl net.ipv4.ip_local_reserved_ports >/dev/null 2>&1; then
45-
# Get any currently reserved ports, strip off leading whitespace
46-
reserved_ports=$(sysctl net.ipv4.ip_local_reserved_ports | awk -F'=' '{print $2;}' | sed 's/^ //')
47-
48-
if [[ -z "${reserved_ports}" ]]; then
49-
# If there are no currently reserved ports, reserve the keystone ports
50-
sudo sysctl -w net.ipv4.ip_local_reserved_ports=${keystone_ports}
51-
else
52-
# If there are currently reserved ports, keep those and also reserve the
53-
# Keystone specific ports. Duplicate reservations are merged into a single
54-
# reservation (or range) automatically by the kernel.
55-
sudo sysctl -w net.ipv4.ip_local_reserved_ports=${keystone_ports},${reserved_ports}
56-
fi
57-
else
58-
echo_summary "WARNING: unable to reserve keystone ports"
59-
fi
60-
}
61-
6229
# Ubuntu Repositories
6330
#--------------------
6431
# Enable universe for bionic since it is missing when installing from ISO.
@@ -208,7 +175,6 @@ function fixup_suse {
208175
}
209176

210177
function fixup_all {
211-
fixup_keystone
212178
fixup_ubuntu
213179
fixup_fedora
214180
fixup_suse

0 commit comments

Comments
 (0)