Migrate nova accounts

Change-Id: I3be7f2bd9998ac342fdc40ebaf608fe2b646755d
This commit is contained in:
okozachenko 2020-08-27 18:07:28 +03:00
parent 2f9cf0e387
commit 7ed684e908
7 changed files with 65 additions and 9 deletions

View File

@ -67,12 +67,20 @@ function create_nova_conf {
# only on nodes which runs controller services # only on nodes which runs controller services
iniset $NOVA_CONF cache enabled $NOVA_ENABLE_CACHE iniset $NOVA_CONF cache enabled $NOVA_ENABLE_CACHE
iniset $NOVA_CONF cache backend $CACHE_BACKEND iniset $NOVA_CONF cache backend $CACHE_BACKEND
iniset $NOVA_CONF cache memcache_servers mcrouter-memcached-nova.openstack.svc.cluster.local iniset $NOVA_CONF cache memcache_servers mcrouter-memcached-nova.openstack.svc.cluster.local:11211
NOVA_ENABLED_APIS=$(echo $NOVA_ENABLED_APIS | sed "s/,metadata//") NOVA_ENABLED_APIS=$(echo $NOVA_ENABLED_APIS | sed "s/,metadata//")
iniset $NOVA_CONF DEFAULT enabled_apis "$NOVA_ENABLED_APIS" iniset $NOVA_CONF DEFAULT enabled_apis "$NOVA_ENABLED_APIS"
configure_keystone_authtoken_middleware $NOVA_CONF nova # Adop v3applicationcredential instead of password type
kubernetes_ensure_resource secret/nova-application-credential
NOVA_APPLICATION_CREDENTIAL_SECRET=$(get_data_from_secret nova-application-credential openstack secret)
NOVA_APPLICATION_CREDENTIAL_ID=$(get_data_from_secret nova-application-credential openstack id)
iniset $NOVA_CONF keystone_authtoken auth_url $KEYSTONE_AUTH_URI_V3
iniset $NOVA_CONF keystone_authtoken auth_type v3applicationcredential
iniset $NOVA_CONF keystone_authtoken application_credential_id $NOVA_APPLICATION_CREDENTIAL_ID
iniset $NOVA_CONF keystone_authtoken application_credential_secret $NOVA_APPLICATION_CREDENTIAL_SECRET
iniset $NOVA_CONF keystone_authtoken memcached_servers mcrouter-memcached-nova.openstack.svc.cluster.local:11211
if is_service_enabled cinder; then if is_service_enabled cinder; then
configure_cinder_access configure_cinder_access
@ -353,3 +361,21 @@ function start_nova {
start_nova_conductor start_nova_conductor
start_nova_compute start_nova_compute
} }
function create_nova_accounts {
# NOTE(Alex): Ignore ResellerAdmin
echo noop
}
function init_nova_service_user_conf {
kubernetes_ensure_resource secret/nova-application-credential
NOVA_APPLICATION_CREDENTIAL_SECRET=$(get_data_from_secret nova-application-credential openstack secret)
NOVA_APPLICATION_CREDENTIAL_ID=$(get_data_from_secret nova-application-credential openstack id)
iniset $NOVA_CONF service_user auth_url $KEYSTONE_SERVICE_URI
iniset $NOVA_CONF service_user auth_type v3applicationcredential
iniset $NOVA_CONF service_user application_credential_id $NOVA_APPLICATION_CREDENTIAL_ID
iniset $NOVA_CONF service_user application_credential_secret $NOVA_APPLICATION_CREDENTIAL_SECRET
iniset $NOVA_CONF service_user send_service_user_token True
iniset $NOVA_CONF service_user auth_strategy keystone
}

View File

@ -17,12 +17,17 @@
import pkg_resources import pkg_resources
import sentry_sdk import sentry_sdk
from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
from nova.api.openstack.compute.wsgi import init_application from nova.api.openstack.compute.wsgi import init_application
from sentry_sdk.integrations import wsgi from sentry_sdk.integrations import wsgi
VERSION = pkg_resources.get_distribution("nova").version VERSION = pkg_resources.get_distribution("nova").version
sentry_sdk.init(release="nova@%s" % VERSION)
sentry_sdk.init(
release="nova@%s" % VERSION,
integrations=[SqlalchemyIntegration()]
)
application = init_application() application = init_application()
application = wsgi.SentryWsgiMiddleware(application) application = wsgi.SentryWsgiMiddleware(application)

View File

@ -19,11 +19,16 @@ import re
import sys import sys
import sentry_sdk import sentry_sdk
from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
from nova.cmd.compute import main from nova.cmd.compute import main
VERSION = pkg_resources.get_distribution("nova").version VERSION = pkg_resources.get_distribution("nova").version
sentry_sdk.init(release="nova@%s" % VERSION)
sentry_sdk.init(
release="nova@%s" % VERSION,
integrations=[SqlalchemyIntegration()]
)
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main()) sys.exit(main())

View File

@ -19,11 +19,16 @@ import re
import sys import sys
import sentry_sdk import sentry_sdk
from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
from nova.cmd.conductor import main from nova.cmd.conductor import main
VERSION = pkg_resources.get_distribution("nova").version VERSION = pkg_resources.get_distribution("nova").version
sentry_sdk.init(release="nova@%s" % VERSION)
sentry_sdk.init(
release="nova@%s" % VERSION,
integrations=[SqlalchemyIntegration()]
)
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main()) sys.exit(main())

View File

@ -17,12 +17,17 @@
import pkg_resources import pkg_resources
import sentry_sdk import sentry_sdk
from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
from nova.api.metadata.wsgi import init_application from nova.api.metadata.wsgi import init_application
from sentry_sdk.integrations import wsgi from sentry_sdk.integrations import wsgi
VERSION = pkg_resources.get_distribution("nova").version VERSION = pkg_resources.get_distribution("nova").version
sentry_sdk.init(release="nova@%s" % VERSION)
sentry_sdk.init(
release="nova@%s" % VERSION,
integrations=[SqlalchemyIntegration()]
)
application = init_application() application = init_application()
application = wsgi.SentryWsgiMiddleware(application) application = wsgi.SentryWsgiMiddleware(application)

View File

@ -19,11 +19,16 @@ import re
import sys import sys
import sentry_sdk import sentry_sdk
from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
from nova.cmd.novncproxy import main from nova.cmd.novncproxy import main
VERSION = pkg_resources.get_distribution("nova").version VERSION = pkg_resources.get_distribution("nova").version
sentry_sdk.init(release="nova@%s" % VERSION)
sentry_sdk.init(
release="nova@%s" % VERSION,
integrations=[SqlalchemyIntegration()]
)
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main()) sys.exit(main())

View File

@ -19,11 +19,16 @@ import re
import sys import sys
import sentry_sdk import sentry_sdk
from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
from nova.cmd.scheduler import main from nova.cmd.scheduler import main
VERSION = pkg_resources.get_distribution("nova").version VERSION = pkg_resources.get_distribution("nova").version
sentry_sdk.init(release="nova@%s" % VERSION)
sentry_sdk.init(
release="nova@%s" % VERSION,
integrations=[SqlalchemyIntegration()]
)
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main()) sys.exit(main())