def whisk_create()

in nuvolaris/main.py [0:0]


def whisk_create(spec, name, **kwargs):
    logging.info(f"*** whisk_create {name}")

    operator_util.config_from_spec(spec)
    owner = kube.get(f"wsk/{name}")

    state = {
        "openwhisk": "?",  # Openwhisk Controller or Standalone
        "invoker": "?",  # Invoker
        "couchdb": "?",  # Couchdb
        "kafka": "?",  # Kafka
        "redis": "?",  # Redis
        "mongodb": "?",  # MongoDB
        "cron": "?",   # Cron based actions executor
        "tls": "?",   # Cron based actions executor
        "endpoint": "?", # Http/s controller endpoint # Http/s controller endpoint
        "issuer": "?", # ClusterIssuer configuration
        "ingress": "?", # Ingress configuration
        "minio": "?", # Minio configuration
        "static": "?", # Minio static endpoint provider
        "zookeeper": "?", #Zookeeper configuration
        "quota":"?", #Quota configuration
        "etcd":"?"
    }

    runtime = cfg.get('nuvolaris.kube')
    logging.info(f"kubernetes engine in use={runtime}")

    if cfg.get('components.openwhisk'):
        try:
            msg = preloader.create(owner)
            state['preloader']= "on"
            logging.info(msg)
        except:
            logging.exception("could not create runtime preloader batach")
            state['preloader']= "error"
    else:
        state['preloader']= "off"   

    if cfg.get('components.couchdb'):
        try:
            msg = couchdb.create(owner)
            state['couchdb']= "on"
            logging.info(msg)
        except:
            logging.exception("cannot create couchdb")
            state['couchdb']= "error"
    else:
        state['couchdb'] = "off"

    if cfg.get('components.redis'):
        try:
            msg = redis.create(owner)
            state['redis'] = "on"
            logging.info(msg)
        except:
            logging.exception("cannot create redis")
            state['redis']= "error"
    else:
        state['redis'] = "off"

    if cfg.get('components.tls') and not runtime in ["kind","openshift"]:
        try:
            msg = issuer.create(owner)
            state['issuer'] = "on"
            state['tls'] = "on"
            logging.info(msg)
        except:
            logging.exception("cannot configure issuer")
            state['issuer']= "error"
            state['tls'] = "error"
    else:
        state['issuer'] = "off"
        state['tls'] = "off"
        if runtime == "kind" and cfg.get('components.tls'):
            logging.info("*** cluster issuer will not be deployed with kind runtime")

    if cfg.get('components.cron'):
        try:
            msg = cron.create(owner)
            state['cron'] = "on"
            logging.info(msg)
        except:
            logging.exception("cannot create cron")
            state['cron']= "error"
    else:
        state['cron'] = "off" 

    if cfg.get('components.minio'):
        msg = minio.create(owner)
        logging.info(msg)
        state['minio'] = "on"
    else:
        state['minio'] = "off"

    if cfg.get('components.static'):
        msg = static.create(owner)
        logging.info(msg)
        state['static'] = "on"
    else:
        state['static'] = "off"

    if cfg.get('components.postgres') or cfg.get('components.mongodb'):
        msg = postgres.create(owner)
        logging.info(msg)
        state['postgres'] = "on"
    else:
        state['postgres'] = "off"

    if cfg.get('components.mongodb'):
        msg = mongodb.create(owner)
        logging.info(msg)
        state['mongodb'] = "on"
    else:
        state['mongodb'] = "off"
    
    if(cfg.get('components.zookeeper')):
        try:
            msg = zookeeper.create(owner)
            state['zookeeper'] = "on"
            logging.info(msg)
        except:
            logging.exception("cannot create zookeeper")
            state['zookeeper'] = "error"

    if(cfg.get('components.kafka')):
        try:
            msg = kafka.create(owner)
            state['kafka'] = "on"
            logging.info(msg)
        except:
            logging.exception("cannot create kafka")
            state['kafka'] = "error"            

    if (cfg.get('components.invoker')):
        try:
            msg = invoker.create(owner)
            state['invoker'] = "on"
            logging.info(msg)
        except:
            logging.exception("cannot create openwhisk invoker")
            state['invoker']= "error"

    if cfg.get('components.openwhisk'):
        try:
            msg = openwhisk.create(owner)
            state['openwhisk'] = "on"
            logging.info(msg)

            msg = endpoint.create(owner)
            state['endpoint'] = "on"
            logging.info(msg)

        except:
            logging.exception("cannot create openwhisk")
            state['openwhisk']= "error"
            state['endpoint'] = "error"
    else:
        state['openwhisk'] = "off"
        state['endpoint'] = "off"

    if (cfg.get('components.monitoring')):
        try:
            msg = monitoring.create(owner)
            state['monitoring'] = "on"
            logging.info(msg)

        except:
            logging.exception("cannot create monitoring")
            state['monitoring']= "error"
    else:
        state['monitoring'] = "off"

    if cfg.get('components.quota'):
        try:
            msg = quota.create(owner)
            state['quota'] = "on"
            logging.info(msg)
        except:
            logging.exception("cannot create quotaa checker")
            state['quota']= "error"
    else:
        state['quota'] = "off"

    if cfg.get('components.etcd'):
        try:
            msg = etcd.create(owner)
            state['etcd'] = "on"
            logging.info(msg)
        except:
            logging.exception("cannot create etcd")
            state['etcd']= "error"
    else:
        state['etcd'] = "off" 

    if cfg.get('components.milvus'):
        try:
            msg = milvus.create(owner)
            state['milvus'] = "on"
            logging.info(msg)
        except:
            logging.exception("cannot create milvus")
            state['milvus']= "error"
    else:
        state['milvus'] = "off"                        

    whisk_post_create(name,state)
    state['controller']= "Ready"
    return state