Update configs according to latest release

- drop deprecated MetalLB configs
- update storage mapping with strict byPath

MOSSUST-117

Change-Id: Ic36d2bf2f76783cd780184c9a1b5ee166212913f
diff --git a/bm_mcc_mosk/child/cluster/baremetalhostprofiles.yaml b/bm_mcc_mosk/child/cluster/baremetalhostprofiles.yaml
index 5a8df06..bd1fca9 100644
--- a/bm_mcc_mosk/child/cluster/baremetalhostprofiles.yaml
+++ b/bm_mcc_mosk/child/cluster/baremetalhostprofiles.yaml
@@ -82,7 +82,7 @@
   devices:
     - device:
         workBy: "by_id,by_path,by_wwn,by_name"
-        byName: /dev/sda
+        byPath: /dev/disk/by-path/pci-0000:00:1f.2-ata-1
         minSize: 60Gi
         wipeDevice:
           eraseMetadata:
@@ -100,7 +100,7 @@
           size: 0
     - device:
         workBy: "by_id,by_path,by_wwn,by_name"
-        byName: /dev/sdb
+        byPath: /dev/disk/by-path/pci-0000:00:1f.2-ata-2
         wipe: true
   fileSystems:
     - fileSystem: vfat
@@ -157,7 +157,7 @@
   devices:
     - device:
         workBy: "by_id,by_path,by_wwn,by_name"
-        byName: /dev/sda
+        byPath: /dev/disk/by-path/pci-0000:00:1f.2-ata-1
         minSize: 60Gi
         wipeDevice:
           eraseMetadata:
@@ -175,7 +175,7 @@
           size: 0
     - device:
         workBy: "by_id,by_path,by_wwn,by_name"
-        byName: /dev/sdb
+        byPath: /dev/disk/by-path/pci-0000:00:1f.2-ata-2
         wipe: true
   fileSystems:
     - fileSystem: vfat
@@ -228,7 +228,7 @@
   devices:
     - device:
         workBy: "by_id,by_path,by_wwn,by_name"
-        byName: /dev/sda
+        byPath: /dev/disk/by-path/pci-0000:00:1f.2-ata-1
         minSize: 60Gi
         wipeDevice:
           eraseMetadata:
@@ -246,7 +246,7 @@
           size: 0
     - device:
         workBy: "by_id,by_path,by_wwn,by_name"
-        byName: /dev/sdb
+        byPath: /dev/disk/by-path/pci-0000:00:1f.2-ata-2
         wipe: true
   fileSystems:
     - fileSystem: vfat
@@ -299,7 +299,7 @@
   devices:
     - device:
         workBy: "by_id,by_path,by_wwn,by_name"
-        byName: /dev/sda
+        byPath: /dev/disk/by-path/pci-0000:00:1f.2-ata-1
         minSize: 60Gi
         wipeDevice:
           eraseMetadata:
@@ -317,7 +317,7 @@
           size: 0
     - device:
         workBy: "by_id,by_path,by_wwn,by_name"
-        byName: /dev/sdb
+        byPath: /dev/disk/by-path/pci-0000:00:1f.2-ata-2
         wipe: true
   fileSystems:
     - fileSystem: vfat
diff --git a/bm_mcc_mosk/kaas-mgmt/cluster.yaml b/bm_mcc_mosk/kaas-mgmt/cluster.yaml
index 05e45a0..5e39da4 100644
--- a/bm_mcc_mosk/kaas-mgmt/cluster.yaml
+++ b/bm_mcc_mosk/kaas-mgmt/cluster.yaml
@@ -17,7 +17,7 @@
   providerSpec:
     value:
       kind: BaremetalClusterProviderSpec
-      release: mke-16-1-0-3-7-5
+      #release: mke-16-1-0-3-7-5
       apiVersion: baremetal.k8s.io/v1alpha1
       dedicatedControlPlane: false
       dedicatedMetallbPools: true
@@ -37,7 +37,7 @@
           prometheusServer:
             persistentVolumeClaimSize: 16Gi
       kaas:
-        release: kaas-2-26-0
+        #release: kaas-2-26-0
         management:
           enabled: true
         regional:
diff --git a/bm_mcc_mosk/kaas-mgmt/ipam-objects.yaml b/bm_mcc_mosk/kaas-mgmt/ipam-objects.yaml
index eb5535d..2a88aa8 100644
--- a/bm_mcc_mosk/kaas-mgmt/ipam-objects.yaml
+++ b/bm_mcc_mosk/kaas-mgmt/ipam-objects.yaml
@@ -1,37 +1,4 @@
 ---
-# This template allows you to configure networking for servers
-# of the management cluster of Mirantis Container Cloud. Network
-# configuration requires the following resources.
-
-# WARNING: Since Container Cloud 2.24, the default networking
-# definition schema has been significantly changed.
-# Older templates will not work for 2.24+ release bootstrap deployment.
-# For details, see
-# https://docs.mirantis.com/container-cloud/latest/deployment-guide/deploy-bm-mgmt.html
-
-# The 'mgmt-lb-pxe' Subnet object defines the range of IP addresses
-# used by MetalLB to expose services in the PXE network. This
-# includes Ironic API (bare metal provisioning server), HTTP server
-# that provides images for network boot and server provisioning,
-# and the caching server for accessing the Container Cloud artifacts
-# deployed on the hosts.
-apiVersion: "ipam.mirantis.com/v1alpha1"
-kind: Subnet
-metadata:
-  name: mgmt-lb-pxe
-  namespace: default
-  labels:
-    kaas.mirantis.com/provider: baremetal
-    cluster.sigs.k8s.io/cluster-name: kaas-mgmt
-    ipam/SVC-MetalLB: "presents"
-    metallb/address-pool-auto-assign: "false"
-    metallb/address-pool-name: services-pxe
-    metallb/address-pool-protocol: layer2
-spec:
-  cidr: 172.16.180.0/23
-  includeRanges:
-    - 172.16.181.10-172.16.181.13
----
 apiVersion: "ipam.mirantis.com/v1alpha1"
 kind: Subnet
 metadata:
@@ -103,31 +70,6 @@
     - 172.16.181.51-172.16.181.100
 
 ---
-# The 'mgmt-k8s-lb' Subnet object defines the range of IP addresses
-# used by MetalLB to expose services in the LCM/Management network.
-# It defines the same MetalLB address pool that was previously defined
-# in MetalLB chart values configInline parameter (which is deprecated).
-# These services include Keycloak, MCC UI, Stacklight services,
-# and the caching server for accessing the Container Cloud artifacts
-# deployed on the hosts.
-apiVersion: "ipam.mirantis.com/v1alpha1"
-kind: Subnet
-metadata:
-  name: mgmt-k8s-lb
-  namespace: default
-  labels:
-    kaas.mirantis.com/provider: baremetal
-    cluster.sigs.k8s.io/cluster-name: kaas-mgmt
-    ipam/SVC-MetalLB: "presents"
-    metallb/address-pool-auto-assign: "true"
-    metallb/address-pool-name: default
-    metallb/address-pool-protocol: layer2
-spec:
-  cidr: 172.16.180.0/23
-  includeRanges:
-    - 172.16.181.101-172.16.181.140
-
----
 apiVersion: ipam.mirantis.com/v1alpha1
 kind: MetalLBConfigTemplate
 metadata:
diff --git a/bm_mcc_mosk/kaas-mgmt/metallbconfig.yaml b/bm_mcc_mosk/kaas-mgmt/metallbconfig.yaml
index 8c218d0..9f2fa63 100644
--- a/bm_mcc_mosk/kaas-mgmt/metallbconfig.yaml
+++ b/bm_mcc_mosk/kaas-mgmt/metallbconfig.yaml
@@ -16,4 +16,29 @@
   name: kaas-mgmt-metallb
   namespace: default
 spec:
-  templateName: kaas-mgmt-metallb
+  ipAddressPools:
+  - name: default
+    spec:
+      addresses:
+        - 172.16.181.101-172.16.181.140
+      autoAssign: true
+      avoidBuggyIPs: false
+  - name: services-pxe
+    spec:
+      addresses:
+        # IP address range to use for the MetalLB address pool to expose
+        # Kubernetes services in the PXE network.
+        # This address range must be within the PXE network.
+        # The minimum required address range size is 4 IP addresses.
+        - 172.16.181.10-172.16.181.13
+      autoAssign: false
+      avoidBuggyIPs: false
+  l2Advertisements:
+  - name: default
+    spec:
+      ipAddressPools:
+        - default
+  - name: pxe
+    spec:
+      ipAddressPools:
+        - services-pxe
diff --git a/bm_mcc_mosk/mcc_seed_2401_userdata.yaml b/bm_mcc_mosk/mcc_seed_2401_userdata.yaml
index 22b3fc3..17292d1 100644
--- a/bm_mcc_mosk/mcc_seed_2401_userdata.yaml
+++ b/bm_mcc_mosk/mcc_seed_2401_userdata.yaml
@@ -176,7 +176,16 @@
       source /root/env_vars.sh
       while [ ! -d "${OUT_DIR}" ] ; do sleep 4 ; done
       [[ "$(sed -n 693p /root/kaas-bootstrap/bootstrap.sh)" -eq "configure" ]] && sed -i "693d" /root/kaas-bootstrap/bootstrap.sh
-      /root/kaas-bootstrap/bootstrap.sh all
+      # PROD-44779
+      set +e -o pipefail
+      /root/kaas-bootstrap/bootstrap.sh all 2>&1 | tee deploy_mcc_mgmt_output.log
+      retcode=$?
+      set -e
+      if [[ $retcode -ne 0 ]] ; then
+        grep "Keycloak service is unavailable" deploy_mcc_mgmt_output.log && echo "PRODX-44779 is still there, ignoring" || exit $retcode
+      else
+        echo 'REMOVE PRODX-44779 WORKAROUND'
+      fi
       export KUBECONFIG=/root/kubeconfig
       echo r00tme | /root/kaas-bootstrap/container-cloud bootstrap user add --username root --roles global-admin,management-admin,reader,writer,operator --kubeconfig kubeconfig --password-stdin
   - path: /root/do_deploy_child.sh