Browse code

Merge "Drop keystone dedicated ports"

Zuul authored on 2020/06/30 03:24:40
Showing 6 changed files
... ...
@@ -137,7 +137,7 @@ OS\_AUTH\_URL
137 137
 
138 138
     ::
139 139
 
140
-        OS_AUTH_URL=http://$SERVICE_HOST:5000/v3.0
140
+        OS_AUTH_URL=http://$SERVICE_HOST/identity/v3.0
141 141
 
142 142
 KEYSTONECLIENT\_DEBUG, NOVACLIENT\_DEBUG
143 143
     Set command-line client log level to ``DEBUG``. These are commented
... ...
@@ -430,16 +430,16 @@ Python bindings added when they are enabled.
430 430
 
431 431
   ADDITIONAL_VENV_PACKAGES="python-foo, python-bar"
432 432
 
433
-Use python3
433
+Use python2
434 434
 ------------
435 435
 
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``).
439 439
 
440 440
 ::
441 441
 
442
-  USE_PYTHON3=True
442
+  USE_PYTHON3=False
443 443
 
444 444
 A clean install every time
445 445
 --------------------------
... ...
@@ -696,16 +696,6 @@ KEYSTONE_REGION_NAME to specify the region of Keystone service.
696 696
 KEYSTONE_REGION_NAME has a default value the same as REGION_NAME thus we omit
697 697
 it in the configuration of RegionOne.
698 698
 
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
-
709 699
 .. _arch-configuration:
710 700
 
711 701
 Architectures
... ...
@@ -1,39 +1,9 @@
1
-Listen %PUBLICPORT%
2
-Listen %ADMINPORT%
3 1
 LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" %D(us)" keystone_combined
4 2
 
5 3
 <Directory %KEYSTONE_BIN%>
6 4
     Require all granted
7 5
 </Directory>
8 6
 
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
-
37 7
 %SSLLISTEN%<VirtualHost *:443>
38 8
 %SSLLISTEN%    %SSLENGINE%
39 9
 %SSLLISTEN%    %SSLCERTFILE%
... ...
@@ -83,14 +83,10 @@ KEYSTONE_TOKEN_FORMAT=$(echo ${KEYSTONE_TOKEN_FORMAT} | tr '[:upper:]' '[:lower:
83 83
 
84 84
 # Set Keystone interface configuration
85 85
 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}
88 86
 KEYSTONE_AUTH_PROTOCOL=${KEYSTONE_AUTH_PROTOCOL:-$SERVICE_PROTOCOL}
89 87
 
90 88
 # Public facing bits
91 89
 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}
94 90
 KEYSTONE_SERVICE_PROTOCOL=${KEYSTONE_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
95 91
 
96 92
 # Bind hosts
... ...
@@ -170,22 +166,14 @@ function _config_keystone_apache_wsgi {
170 170
     local keystone_ssl=""
171 171
     local keystone_certfile=""
172 172
     local keystone_keyfile=""
173
-    local keystone_service_port=$KEYSTONE_SERVICE_PORT
174
-    local keystone_auth_port=$KEYSTONE_AUTH_PORT
175 173
     local venv_path=""
176 174
 
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
181 175
     if [[ ${USE_VENV} = True ]]; then
182 176
         venv_path="python-path=${PROJECT_VENV["keystone"]}/lib/$(python_version)/site-packages"
183 177
     fi
184 178
 
185 179
     sudo cp $FILES/apache-keystone.template $keystone_apache_conf
186 180
     sudo sed -e "
187
-        s|%PUBLICPORT%|$keystone_service_port|g;
188
-        s|%ADMINPORT%|$keystone_auth_port|g;
189 181
         s|%APACHE_NAME%|$APACHE_NAME|g;
190 182
         s|%SSLLISTEN%|$keystone_ssl_listen|g;
191 183
         s|%SSLENGINE%|$keystone_ssl|g;
... ...
@@ -222,21 +210,8 @@ function configure_keystone {
222 222
 
223 223
     iniset_rpc_backend keystone $KEYSTONE_CONF oslo_messaging_notifications
224 224
 
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
-
234 225
     # 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).
226
+    # admin_endpoint) so that clients use the correct endpoint.
240 227
     iniset $KEYSTONE_CONF DEFAULT public_endpoint $KEYSTONE_SERVICE_URI
241 228
     iniset $KEYSTONE_CONF DEFAULT admin_endpoint $KEYSTONE_AUTH_URI
242 229
 
... ...
@@ -270,12 +245,6 @@ function configure_keystone {
270 270
 
271 271
     iniset $KEYSTONE_CONF credential key_repository "$KEYSTONE_CONF_DIR/credential-keys/"
272 272
 
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
-
279 273
     if [[ "$KEYSTONE_SECURITY_COMPLIANCE_ENABLED" = True ]]; then
280 274
         iniset $KEYSTONE_CONF security_compliance lockout_failure_attempts $KEYSTONE_LOCKOUT_FAILURE_ATTEMPTS
281 275
         iniset $KEYSTONE_CONF security_compliance lockout_duration $KEYSTONE_LOCKOUT_DURATION
... ...
@@ -510,14 +479,6 @@ function install_keystone {
510 510
 
511 511
 # start_keystone() - Start running processes
512 512
 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
-
521 513
     if [ "$KEYSTONE_DEPLOY" == "mod_wsgi" ]; then
522 514
         enable_apache_site keystone
523 515
         restart_apache_server
... ...
@@ -526,23 +487,13 @@ function start_keystone {
526 526
     fi
527 527
 
528 528
     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
-
529
+    # Check that the keystone service is running.
534 530
     local service_uri=$auth_protocol://$KEYSTONE_SERVICE_HOST/identity/v$IDENTITY_API_VERSION/
535 531
 
536 532
     if ! wait_for_service $SERVICE_TIMEOUT $service_uri; then
537 533
         die $LINENO "keystone did not start"
538 534
     fi
539 535
 
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
-
546 536
     # (re)start memcached to make sure we have a clean memcache.
547 537
     restart_service memcached
548 538
 }
... ...
@@ -561,11 +512,9 @@ function stop_keystone {
561 561
 # This function uses the following GLOBAL variables:
562 562
 # - ``KEYSTONE_BIN_DIR``
563 563
 # - ``ADMIN_PASSWORD``
564
-# - ``IDENTITY_API_VERSION``
564
+# - ``KEYSTONE_AUTH_URI``
565 565
 # - ``REGION_NAME``
566
-# - ``KEYSTONE_SERVICE_PROTOCOL``
567
-# - ``KEYSTONE_SERVICE_HOST``
568
-# - ``KEYSTONE_SERVICE_PORT``
566
+# - ``KEYSTONE_SERVICE_URI``
569 567
 function bootstrap_keystone {
570 568
     $KEYSTONE_BIN_DIR/keystone-manage bootstrap \
571 569
         --bootstrap-username admin \
... ...
@@ -86,7 +86,7 @@ export OS_AUTH_TYPE=password
86 86
 #
87 87
 
88 88
 # 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
90 90
 KEYSTONE_SERVICE_URI=${KEYSTONE_SERVICE_URI:-$KEYSTONE_BACKUP}
91 91
 
92 92
 export OS_AUTH_URL=${OS_AUTH_URL:-$KEYSTONE_SERVICE_URI}
... ...
@@ -152,7 +152,7 @@ if [ -z "$OS_USERNAME" ]; then
152 152
 fi
153 153
 
154 154
 if [ -z "$OS_AUTH_URL" ]; then
155
-    export OS_AUTH_URL=http://localhost:5000/v3/
155
+    export OS_AUTH_URL=http://localhost/identity/v3/
156 156
 fi
157 157
 
158 158
 if [ -z "$OS_USER_DOMAIN_ID" -a -z "$OS_USER_DOMAIN_NAME" ]; then
... ...
@@ -26,39 +26,6 @@ if [[ -z "$TOP_DIR" ]]; then
26 26
     FILES=$TOP_DIR/files
27 27
 fi
28 28
 
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
-
62 29
 # Ubuntu Repositories
63 30
 #--------------------
64 31
 # Enable universe for bionic since it is missing when installing from ISO.
... ...
@@ -208,7 +175,6 @@ function fixup_suse {
208 208
 }
209 209
 
210 210
 function fixup_all {
211
-    fixup_keystone
212 211
     fixup_ubuntu
213 212
     fixup_fedora
214 213
     fixup_suse