config/sysinv/sysinv/sysinv/sysinv/objects/kube_upgrade.py
Bart Wensley 535879dfd0 Provide infrastructure for kubernetes upgrades
This commit provides the CLI and REST API infrastructure for
kubernetes upgrades. It also includes support for:
- starting a kubernetes upgrade
- upgrading the kubernetes control plane components
- upgrading the kubelets

Note that these capabilities cannot be exercised in a standard
load - they require a new kubernetes version to be defined in
the load and patches created for the new kubernetes version.

Change-Id: I0c2755fca89e93583e43fc5ace93bef8fc181766
Story: 2006781
Task: 37306
Task: 37579
Task: 37580
Task: 37581
Depends-On: https://review.opendev.org/#/c/695542
Signed-off-by: Bart Wensley <barton.wensley@windriver.com>
2019-11-22 15:13:52 -06:00

44 lines
1.1 KiB
Python

#
# Copyright (c) 2019 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# coding=utf-8
#
from sysinv.db import api as db_api
from sysinv.objects import base
from sysinv.objects import utils
class KubeUpgrade(base.SysinvObject):
dbapi = db_api.get_instance()
fields = {
'id': int,
'uuid': utils.str_or_none,
'from_version': utils.str_or_none,
'to_version': utils.str_or_none,
'state': utils.str_or_none,
'reserved_1': utils.str_or_none,
'reserved_2': utils.str_or_none,
'reserved_3': utils.str_or_none,
'reserved_4': utils.str_or_none,
}
@base.remotable_classmethod
def get_by_uuid(cls, context, uuid):
return cls.dbapi.kube_upgrade_get(uuid)
@base.remotable_classmethod
def get_one(cls, context):
return cls.dbapi.kube_upgrade_get_one()
def save_changes(self, context, updates):
self.dbapi.kube_upgrade_update(self.uuid, # pylint: disable=no-member
updates)