Rollback IEM on Failure - Manual - Industrial Edge - Industrial Edge - Industrial Edge - Documentation of Industrial Edge APIs - CLI tools - Industrial Edge - References - APIs

Industrial Edge Platform Operation - APIs & References

Product
Industrial Edge
Edition
12/2024
Language
en-US (original)

If at any point the IEM fails to onboard, please run the following commands before re-running the IEM setup manifest. Create a shell script with the name rollback-manifest.yaml and copy the content below.

variables:
  config_name: "test_iehub"   #update iectl iehub config name
  config_url: "https://iehub.eu1.edge.siemens.cloud"    #update iehub url on which iem needs to be onboarded
  config_user: "user@siemens.com"   #update iehub cli user
  config_password: "cliuserpassword"   #update iehub cli user password
  iem_instance_name: "devieminstance"    #same name which is used while setting up IEM
commands:
 - command:
   target: config
   resource: add.iehub
   parameters:
     user: "${{config_user}}"
     password: "${{config_password}}"
     url: "${{config_url}}"
     name: "${{config_name}}"
 - command:
   target: iehub
   resource: iem-instance.delete
   parameters:
     name: "${{iem_instance_name}}"

Create a shell script with the name rollback.sh and copy the content below.

#!/bin/bash

certkey=""
cert=""
namespace="deviem"
while getopts k:c:h:r:t:n: flag; do
 case "$flag" in
  k)
   kindversion=${OPTARG};;
  c)
   kubectlversion=${OPTARG};;
  h)
   helmversion=${OPTARG};;
  r)
   certkey=${OPTARG};;
  t)
   cert=${OPTARG};;
  n)
   namespace=${OPTARG};;
 esac
done
iectl apply -f rollback-manifest.yaml --verbose
kubectl delete namespace $namespace
kubectl create namespace $namespace
kubectl -n $namespace create secret tls kongcert --key $certkey --cert $cert

After the above step is completed, run the script with the following command

NOTICE

Please update the value of the iem namespace variable -n before running. Use the same iem namespace that was created during cluster setup.

  bash +x rollback.sh -r "out/myCert.key" -t "out/myCert.crt" -n "deviem"