Migrating Your Existing Installation with Brands to the New K8s UI Cluster

If in your current configuration brands are located at exclusive IP addresses, to complete the deployment of a Kubernetes UI cluster to a cloud, you need to migrate your brands from exclusive IP addresses to shared IP addresses.

Warning: In a Kubernetes UI Cluster, brands can be located only at shared IP addresses. Exclusive IP addresses are not supported.

To migrate your existing brands from exclusive to shared IP addresses:

  1. Register a K8s-based UI Cluster in CloudBlue Commerce.
  2. By default, in a Kubernetes UI Cluster, brands are located at random IP addresses. If in your current configuration brands are located at exclusive IP addresses, switch your existing brands from exclusive IPs to shared IPs: Change the IP Type value from Exclusive to Shared.
  3. Move brands from your existing UI Cluster to the K8s-based UI Cluster by using the following python code:

    # cat move-brands.py
    from poaupdater import openapi, uSysDB
    from optparse import OptionParser
    
    parser = OptionParser()
    parser.add_option("--from-host", dest="source", help="source host to move brands from")
    parser.add_option("--to-host", dest="dest", help="destrination host to move brands to")
    (options, args) = parser.parse_args()
    
    api = openapi.OpenAPI()
    con = uSysDB.connect()
    cur = con.cursor()
    cur.execute("SELECT brand_id, brand_name FROM brand_proxy_params JOIN brands USING (brand_id) JOIN proxies USING (proxy_id) WHERE host_id=%s", options.source)
    for id,name in cur.fetchall():
        print "moving brand %s id %s to host %s" % (name,options.dest, id)
        api.pem.moveBrandToHost(brand_id=id, host_id=int(options.dest))

Related Topics