diff --git a/cloud-deploy-pipeline.groovy b/cloud-deploy-pipeline.groovy
index de8d8fd..d59f313 100644
--- a/cloud-deploy-pipeline.groovy
+++ b/cloud-deploy-pipeline.groovy
@@ -467,7 +467,6 @@
                 }
 
                 stage('Install Kubernetes control for kdt') {
-                    salt.enforceStateWithTest([saltId: venvPepper, target: "I@kubernetes:master ${extra_tgt}", state: 'kubernetes.master.kube-addons'])
                     salt.enforceStateWithTest([saltId: venvPepper, target: "I@kubernetes:master ${extra_tgt}", state: 'kubernetes.pool.images'])
                     orchestrate.installKubernetesControl(venvPepper, extra_tgt)
 
@@ -572,7 +571,6 @@
                 stage('Install Cicd on kdt') {
                     extra_tgt_bckp = extra_tgt
                     extra_tgt = 'and kdt* ' + extra_tgt_bckp
-                    orchestrate.installInfra(venvPepper, extra_tgt)
                     orchestrate.installCicd(venvPepper, extra_tgt)
                     extra_tgt = extra_tgt_bckp
                 }
diff --git a/test-cookiecutter-reclass-chunk.groovy b/test-cookiecutter-reclass-chunk.groovy
index 8c804a1..de30e65 100644
--- a/test-cookiecutter-reclass-chunk.groovy
+++ b/test-cookiecutter-reclass-chunk.groovy
@@ -15,7 +15,7 @@
             extraVars = readYaml text: EXTRA_VARIABLES_YAML
             try {
                 currentBuild.description = extraVars.modelFile
-                sh(script:  'find . -mindepth 1 -delete || true', returnStatus: true)
+                sh(script: 'find . -mindepth 1 -delete || true', returnStatus: true)
                 sh(script: """
                     wget --progress=dot:mega --auth-no-challenge -O models.tar.gz ${extraVars.MODELS_TARGZ}
                     tar -xzf models.tar.gz
@@ -25,14 +25,14 @@
                 def content = readFile(file: extraVars.modelFile)
                 def templateContext = readYaml text: content
                 def config = [
-                    'dockerHostname': "cfg01",
-                    'domain': "${templateContext.default_context.cluster_domain}",
-                    'clusterName': templateContext.default_context.cluster_name,
-                    'reclassEnv': extraVars.testReclassEnv,
-                    'distribRevision': extraVars.DISTRIB_REVISION,
+                    'dockerHostname'     : "cfg01",
+                    'domain'             : "${templateContext.default_context.cluster_domain}",
+                    'clusterName'        : templateContext.default_context.cluster_name,
+                    'reclassEnv'         : extraVars.testReclassEnv,
+                    'distribRevision'    : extraVars.DISTRIB_REVISION,
                     'dockerContainerName': extraVars.DockerCName,
-                    'testContext': extraVars.modelFile,
-                    'dockerExtraOpts': [ '--memory=3g' ]
+                    'testContext'        : extraVars.modelFile,
+                    'dockerExtraOpts'    : ['--memory=3g']
                 ]
                 if (extraVars.DISTRIB_REVISION == 'nightly') {
                     config['nodegenerator'] = true
@@ -50,9 +50,9 @@
             } finally {
                 stage('Save artifacts to Artifactory') {
                     def artifactory = new com.mirantis.mcp.MCPArtifactory()
-                    def envGerritVars = [ "GERRIT_PROJECT=${extraVars.get('GERRIT_PROJECT', '')}", "GERRIT_CHANGE_NUMBER=${extraVars.get('GERRIT_CHANGE_NUMBER', '')}",
-                                          "GERRIT_PATCHSET_NUMBER=${extraVars.get('GERRIT_PATCHSET_NUMBER', '')}", "GERRIT_CHANGE_ID=${extraVars.get('GERRIT_CHANGE_ID', '')}",
-                                          "GERRIT_PATCHSET_REVISION=${extraVars.get('GERRIT_PATCHSET_REVISION', '')}" ]
+                    def envGerritVars = ["GERRIT_PROJECT=${extraVars.get('GERRIT_PROJECT', '')}", "GERRIT_CHANGE_NUMBER=${extraVars.get('GERRIT_CHANGE_NUMBER', '')}",
+                                         "GERRIT_PATCHSET_NUMBER=${extraVars.get('GERRIT_PATCHSET_NUMBER', '')}", "GERRIT_CHANGE_ID=${extraVars.get('GERRIT_CHANGE_ID', '')}",
+                                         "GERRIT_PATCHSET_REVISION=${extraVars.get('GERRIT_PATCHSET_REVISION', '')}"]
                     withEnv(envGerritVars) {
                         def artifactoryLink = artifactory.uploadJobArtifactsToArtifactory(['artifactory': 'mcp-ci', 'artifactoryRepo': "drivetrain-local/${JOB_NAME}/${BUILD_NUMBER}"])
                         currentBuild.description += "<br/>${artifactoryLink}"
diff --git a/test-cookiecutter-reclass.groovy b/test-cookiecutter-reclass.groovy
index aa695f2..b7004f6 100644
--- a/test-cookiecutter-reclass.groovy
+++ b/test-cookiecutter-reclass.groovy
@@ -209,6 +209,12 @@
     gerritDataRSHEAD << gerritDataRS
     gerritDataRSHEAD['gerritRefSpec'] = null
     gerritDataRSHEAD['GERRIT_CHANGE_NUMBER'] = null
+    // check for test XXX vs RELEASE branch, to get correct formulas
+    if (gerritDataCC['gerritBranch'].contains('release/')) {
+        testDistribRevision = gerritDataCC['gerritBranch']
+    } else if (gerritDataRS['gerritBranch'].contains('release')) {
+        testDistribRevision = gerritDataRS['gerritBranch']
+    }
     // 'binary' branch logic w\o 'release/' prefix
     if (testDistribRevision.contains('/')) {
         testDistribRevision = testDistribRevision.split('/')[-1]
@@ -219,8 +225,8 @@
     if (!binTest.linux_system_repo_url || !binTest.linux_system_repo_ubuntu_url) {
         common.errorMsg("Binary release: ${testDistribRevision} not exist or not full. Fallback to 'proposed'! ")
         testDistribRevision = 'proposed'
-        messages.add("DISTRIB_REVISION => ${testDistribRevision}")
     }
+    messages.add("DISTRIB_REVISION => ${testDistribRevision}")
     def message = messages.join(newline) + newline
     currentBuild.description = currentBuild.description ? message + currentBuild.description : message
 }
@@ -390,7 +396,7 @@
                 result = '\n' + common.comparePillars(compareRoot, env.BUILD_URL, "-Ev \'infra/secrets.yml|\\.git\'")
                 currentBuild.description = currentBuild.description ? currentBuild.description + result : result
             }
-            stage("TestContexts Head/Patched") {
+            stage('TestContexts Head/Patched') {
                 def stepsForParallel = [:]
                 stepsForParallel.failFast = true
                 common.infoMsg("Found: ${contextFileListHead.size()} HEAD contexts to test.")
@@ -406,7 +412,7 @@
                 parallel stepsForParallel
                 common.infoMsg('All TestContexts tests done')
             }
-            stage("Compare NodesInfo Head/Patched") {
+            stage('Compare NodesInfo Head/Patched') {
                 // Download all artifacts
                 def stepsForParallel = [:]
                 stepsForParallel.failFast = true
@@ -480,3 +486,4 @@
         }
     }
 }
+
diff --git a/test-model-generator.groovy b/test-model-generator.groovy
index 39723c6..aff8b8a 100644
--- a/test-model-generator.groovy
+++ b/test-model-generator.groovy
@@ -158,6 +158,7 @@
                         export TEST_PASSWORD=default
                         export TEST_MODELD_URL=127.0.0.1
                         export TEST_MODELD_PORT=3000
+                        export TEST_TIMEOUT=30
                         cd /var/lib/trymcp-tests
                         pytest -m 'not trymcp' ${component}
                     """
@@ -188,11 +189,18 @@
                     }
                     sh "rm -rf ${env.WORKSPACE}/venv/"
                 }
-                if (apiImage && apiImage.id) {
-                    sh "docker rmi ${apiImage.id}"
-                }
-                if (uiImage && uiImage.id) {
-                    sh "docker rmi ${uiImage.id}"
+                try {
+                    // to avoid issue PROD-29393 "pipeline freezes in `docker rmi` action"
+                    timeout(time: 4, unit: 'MINUTES') {
+                        if (apiImage && apiImage.id) {
+                            sh "docker rmi ${apiImage.id}"
+                        }
+                        if (uiImage && uiImage.id) {
+                            sh "docker rmi ${uiImage.id}"
+                        }
+                    }
+                } catch (Exception e) {
+                    echo "Failed while cleaning docker images: ${e.toString()}"
                 }
                 // Remove everything what is owned by root
                 testImage.inside(testImageOptions) {
diff --git a/update-package.groovy b/update-package.groovy
index 9d36f38..df7655b 100644
--- a/update-package.groovy
+++ b/update-package.groovy
@@ -6,23 +6,12 @@
  *   SALT_MASTER_URL            Full Salt API address [https://10.10.10.1:8000].
  *   TARGET_SERVERS             Salt compound target to match nodes to be updated [*, G@osfamily:debian].
  *   TARGET_PACKAGES            Space delimited list of packages to be updates [package1=version package2=version], empty string means all updating all packages to the latest version.
- *   TARGET_SUBSET_TEST         Number of nodes to list package updates, empty string means all targetted nodes.
- *   TARGET_SUBSET_LIVE         Number of selected nodes to live apply selected package update.
- *   TARGET_BATCH_LIVE          Batch size for the complete live package update on all nodes, empty string means apply to all targetted nodes.
  *
 **/
+
 pepperEnv = "pepperEnv"
 salt = new com.mirantis.mk.Salt()
-def common = new com.mirantis.mk.Common()
-def python = new com.mirantis.mk.Python()
-def targetTestSubset
-def targetLiveSubset
-def targetLiveAll
-def minions
-def result
-def packages
-def command
-def commandKwargs
+common = new com.mirantis.mk.Common()
 
 def installSaltStack(target, pkgs, masterUpdate = false){
     salt.cmdRun(pepperEnv, "I@salt:master", "salt -C '${target}' --async pkg.install force_yes=True pkgs='$pkgs'")
@@ -31,131 +20,76 @@
         // in case of update Salt Master packages - check all minions are good
         minions_reachable = '*'
     }
-    salt.checkTargetMinionsReady(['saltId': venvPepper, 'target': target, 'target_reachable': minions_reachable])
+    salt.checkTargetMinionsReady(['saltId': pepperEnv, 'target': target, 'target_reachable': minions_reachable])
 }
 
 timeout(time: 12, unit: 'HOURS') {
     node() {
         try {
-
+            def python = new com.mirantis.mk.Python()
+            def command = 'pkg.upgrade'
+            def commandKwargs = null
+            def packages = null
             stage('Setup virtualenv for Pepper') {
                 python.setupPepperVirtualenv(pepperEnv, SALT_MASTER_URL, SALT_MASTER_CREDENTIALS)
             }
 
-            stage('List target servers') {
-                minions = salt.getMinions(pepperEnv, TARGET_SERVERS)
-
+            def targetLiveAll = ''
+            stage('Get target servers') {
+                def minions = salt.getMinions(pepperEnv, TARGET_SERVERS)
                 if (minions.isEmpty()) {
                     throw new Exception("No minion was targeted")
                 }
-
-                if (TARGET_SUBSET_TEST != "") {
-                    targetTestSubset = minions.subList(0, Integer.valueOf(TARGET_SUBSET_TEST)).join(' or ')
-                } else {
-                    targetTestSubset = minions.join(' or ')
-                }
-                targetLiveSubset = minions.subList(0, Integer.valueOf(TARGET_SUBSET_LIVE)).join(' or ')
-
                 targetLiveAll = minions.join(' or ')
                 common.infoMsg("Found nodes: ${targetLiveAll}")
-                common.infoMsg("Selected test nodes: ${targetTestSubset}")
-                common.infoMsg("Selected sample nodes: ${targetLiveSubset}")
             }
 
             stage("List package upgrades") {
-                common.infoMsg("Listing all the packages that have a new update available on test nodes: ${targetTestSubset}")
-                salt.runSaltProcessStep(pepperEnv, targetTestSubset, 'pkg.list_upgrades', [], null, true)
-                if(TARGET_PACKAGES != "" && TARGET_PACKAGES != "*"){
-                    common.infoMsg("Note that only the ${TARGET_PACKAGES} would be installed from the above list of available updates on the ${targetTestSubset}")
-                }
-            }
-
-            stage('Confirm live package upgrades on sample') {
-                if(TARGET_PACKAGES==""){
-                    timeout(time: 2, unit: 'HOURS') {
-                        def userInput = input(
-                         id: 'userInput', message: 'Insert package names for update', parameters: [
-                         [$class: 'TextParameterDefinition', defaultValue: '', description: 'Package names (or *)', name: 'packages']
-                        ])
-                        if(userInput!= "" && userInput!= "*"){
-                            TARGET_PACKAGES = userInput
-                        }
-                    }
-                }else{
-                    timeout(time: 2, unit: 'HOURS') {
-                       input message: "Approve live package upgrades on ${targetLiveSubset} nodes?"
-                    }
-                }
-            }
-
-            if (TARGET_PACKAGES != "") {
-                command = "pkg.install"
-                packages = TARGET_PACKAGES.tokenize(' ')
-                commandKwargs = ['only_upgrade': 'true']
-            }else {
-                command = "pkg.upgrade"
-                packages = null
-            }
-
-            stage('Apply package upgrades on sample') {
-                if(packages == null || packages.contains("salt-master") || packages.contains("salt-common") || packages.contains("salt-minion") || packages.contains("salt-api")){
-                    def saltTargets = (targetLiveSubset.split(' or ').collect{it as String})
-                    for(int i = 0; i < saltTargets.size(); i++ ){
-                        common.infoMsg("During salt-minion upgrade on cfg node, pipeline lose connectivy to salt-master for 2 min. If pipeline ended with error rerun pipeline again.")
-                        common.retry(10, 5) {
-                            if(salt.minionsReachable(pepperEnv, 'I@salt:master', "I@salt:master and ${saltTargets[i]}")){
-                                installSaltStack("I@salt:master and ${saltTargets[i]}", '["salt-master", "salt-common", "salt-api", "salt-minion"]', true)
-                            }
-                            if(salt.minionsReachable(pepperEnv, 'I@salt:master', "I@salt:minion and not I@salt:master and ${saltTargets[i]}")){
-                                installSaltStack("I@salt:minion and not I@salt:master and ${saltTargets[i]}", '["salt-minion"]')
-                            }
-                        }
-                    }
-                }
-                out = salt.runSaltCommand(pepperEnv, 'local', ['expression': targetLiveSubset, 'type': 'compound'], command, null, packages, commandKwargs)
-                salt.printSaltCommandResult(out)
-                for(value in out.get("return")[0].values()){
-                    if (value.containsKey('result') && value.result == false) {
-                        throw new Exception("The package upgrade on sample node has failed. Please check the Salt run result above for more information.")
-                    }
+                common.infoMsg("Listing all the packages that have a new update available on nodes: ${targetLiveAll}")
+                salt.runSaltProcessStep(pepperEnv, targetLiveAll, 'pkg.list_upgrades', [], null, true)
+                if (TARGET_PACKAGES != '' && TARGET_PACKAGES != '*') {
+                    common.warningMsg("Note that only the \"${TARGET_PACKAGES}\" would be installed from the above list of available updates on the ${targetLiveAll}")
+                    command = "pkg.install"
+                    packages = TARGET_PACKAGES.tokenize(' ')
+                    commandKwargs = ['only_upgrade': 'true']
                 }
             }
 
             stage('Confirm package upgrades on all nodes') {
                 timeout(time: 2, unit: 'HOURS') {
-                   input message: "Approve live package upgrades on ${targetLiveAll} nodes?"
+                   input message: "Approve package upgrades on ${targetLiveAll} nodes?"
                 }
             }
 
             stage('Apply package upgrades on all nodes') {
-
-                if(packages == null || packages.contains("salt-master") || packages.contains("salt-common") || packages.contains("salt-minion") || packages.contains("salt-api")){
-                    def saltTargets = (targetLiveAll.split(' or ').collect{it as String})
-                    for(int i = 0; i < saltTargets.size(); i++ ){
-                        common.infoMsg("During salt-minion upgrade on cfg node, pipeline lose connectivy to salt-master for 2 min. If pipeline ended with error rerun pipeline again.")
+                if (packages == null || packages.contains("salt-master") || packages.contains("salt-common") || packages.contains("salt-minion") || packages.contains("salt-api")) {
+                    common.warningMsg('Detected update for some Salt package (master or minion). Updating it first.')
+                    def saltTargets = (targetLiveAll.split(' or ').collect { it as String })
+                    for (int i = 0; i < saltTargets.size(); i++ ) {
                         common.retry(10, 5) {
-                            if(salt.minionsReachable(pepperEnv, 'I@salt:master', "I@salt:master and ${saltTargets[i]}")){
+                            if (salt.getMinions(pepperEnv, "I@salt:master and ${saltTargets[i]}")) {
                                 installSaltStack("I@salt:master and ${saltTargets[i]}", '["salt-master", "salt-common", "salt-api", "salt-minion"]', true)
-                            }
-                            if(salt.minionsReachable(pepperEnv, 'I@salt:master', "I@salt:minion and not I@salt:master and ${saltTargets[i]}")){
+                            } else if (salt.getMinions(pepperEnv, "I@salt:minion and not I@salt:master and ${saltTargets[i]}")) {
                                 installSaltStack("I@salt:minion and not I@salt:master and ${saltTargets[i]}", '["salt-minion"]')
+                            } else {
+                                error("Minion ${saltTargets[i]} is not reachable!")
                             }
                         }
                     }
                 }
-
+                common.infoMsg('Starting package upgrades...')
                 out = salt.runSaltCommand(pepperEnv, 'local', ['expression': targetLiveAll, 'type': 'compound'], command, null, packages, commandKwargs)
                 salt.printSaltCommandResult(out)
                 for(value in out.get("return")[0].values()){
                     if (value.containsKey('result') && value.result == false) {
-                        throw new Exception("The package upgrade on sample node has failed. Please check the Salt run result above for more information.")
+                        throw new Exception("The package upgrade on nodes has failed. Please check the Salt run result above for more information.")
                     }
                 }
-                common.warningMsg("Pipeline has finished successfully, but please, check if any packages have been kept back.")
             }
 
+            common.warningMsg("Pipeline has finished successfully, but please, check if any packages have been kept back.")
+
         } catch (Throwable e) {
-            // If there was an error or exception thrown, the build failed
             currentBuild.result = "FAILURE"
             currentBuild.description = currentBuild.description ? e.message + " " + currentBuild.description : e.message
             throw e
diff --git a/upgrade-mcp-release.groovy b/upgrade-mcp-release.groovy
index 02e9270..08d4783 100644
--- a/upgrade-mcp-release.groovy
+++ b/upgrade-mcp-release.groovy
@@ -88,9 +88,9 @@
             sh "diff -u ${workspace}/${oldSuffix}/${minion} ${workspace}/${newSuffix}/${minion} > ${fileName} || true"
         }
     }
-    archiveArtifacts artifacts: "${workspace}/${oldSuffix}"
-    archiveArtifacts artifacts: "${workspace}/${newSuffix}"
-    archiveArtifacts artifacts: "${workspace}/${diffDir}"
+    archiveArtifacts artifacts: "${oldSuffix}/*"
+    archiveArtifacts artifacts: "${newSuffix}/*"
+    archiveArtifacts artifacts: "${diffDir}/*"
 }
 
 if (common.validInputParam('PIPELINE_TIMEOUT')) {
@@ -206,12 +206,31 @@
                     salt.cmdRun(venvPepper, 'I@salt:master', "cd /srv/salt/reclass/classes/system && git checkout ${reclassSystemBranch}")
                     // Add kubernetes-extra repo
                     if (salt.testTarget(venvPepper, "I@kubernetes:master")) {
+                        // docker-engine conflicts with the recent containerd versions, so it's removed during upgrade. Thus update source engine
+                        salt.cmdRun(venvPepper, 'I@salt:master', "cd /srv/salt/reclass/classes/cluster/$cluster_name && " +
+                            "grep -r -l 'engine: docker_hybrid' kubernetes | xargs --no-run-if-empty sed -i 's/engine: docker_hybrid/engine: archive/g'")
                         common.infoMsg("Add kubernetes-extra repo")
                         salt.cmdRun(venvPepper, 'I@salt:master', "cd /srv/salt/reclass/classes/cluster/$cluster_name && " +
                             "grep -q system.linux.system.repo.mcp.apt_mirantis.update.kubernetes_extra kubernetes/common.yml || sed -i '/classes:/ a - system.linux.system.repo.mcp.apt_mirantis.update.kubernetes_extra' kubernetes/common.yml")
                         salt.cmdRun(venvPepper, 'I@salt:master', "cd /srv/salt/reclass/classes/cluster/$cluster_name && " +
                             "grep -q system.linux.system.repo.mcp.apt_mirantis.kubernetes_extra kubernetes/common.yml || sed -i '/classes:/ a - system.linux.system.repo.mcp.apt_mirantis.kubernetes_extra' kubernetes/common.yml")
                     }
+                    // Add all update repositories
+                    def repoIncludeBase = '- system.linux.system.repo.mcp.apt_mirantis.'
+                    def updateRepoList = [ 'cassandra', 'ceph', 'contrail', 'docker', 'elastic', 'extra', 'openstack', 'percona', 'salt-formulas', 'saltstack', 'ubuntu' ]
+                    updateRepoList.each { repo ->
+                        def repoNameUpdateInclude = "${repoIncludeBase}update.${repo}"
+                        def filesWithInclude = salt.cmdRun(venvPepper, 'I@salt:master', "cd /srv/salt/reclass/classes/cluster/$cluster_name && grep -Plr '\\${repoIncludeBase}${repo}\$' . || true", false).get('return')[0].values()[0].trim().tokenize('\n')
+                        filesWithInclude.each { file ->
+                            def updateRepoIncludeExist = salt.cmdRun(venvPepper, 'I@salt:master', "cd /srv/salt/reclass/classes/cluster/$cluster_name && grep -P '\\${repoNameUpdateInclude}\$' ${file} || echo not_found", false, null, true).get('return')[0].values()[0].trim()
+                            if (updateRepoIncludeExist == 'not_found') {
+                                // Include needs to be added
+                                salt.cmdRun(venvPepper, 'I@salt:master', "cd /srv/salt/reclass/classes/cluster/$cluster_name && " +
+                                        "sed -i 's/\\( *\\)${repoIncludeBase}${repo}\$/&\\n\\1${repoNameUpdateInclude}/g' ${file}")
+                                common.infoMsg("Update repo for ${repo} is added to ${file}")
+                            }
+                        }
+                    }
                     // Add new defaults
                     common.infoMsg("Add new defaults")
                     salt.cmdRun(venvPepper, 'I@salt:master', "grep '^    mcp_version: ' /srv/salt/reclass/classes/cluster/$cluster_name/infra/init.yml || " +
