Ejemplo n.º 1
0
def deploy_prometheus_sub(olm_ns, cat_src):
    '''Deploy Operator Subscription'''
    topic = 'Prometheus Operator Subscription'
    src_file = os.path.join(os.getcwd(),\
            'deploy/monitoring/prometheus/assisted-installer-operator-subscription.yaml')
    dst_file = os.path.join(os.getcwd(),\
            'build', deploy_options.namespace, 'assisted-installer-operator-subscription.yaml')
    with open(src_file, "r") as src:
        with open(dst_file, "w+") as dst:
            data = src.read()
            data = data.replace('REPLACE_NAMESPACE',
                                f'"{deploy_options.namespace}"')
            data = data.replace("CAT_SRC",
                                cat_src).replace("OLM_NAMESPACE", olm_ns)
            print("Deploying {}: {}".format(topic, dst_file))
            dst.write(data)
    utils.apply(target=deploy_options.target,
                namespace=deploy_options.namespace,
                profile=deploy_options.profile,
                file=dst_file)
    utils.wait_for_rollout(k8s_object='deployment',
                           k8s_object_name='prometheus-operator',
                           target=deploy_options.target,
                           namespace=deploy_options.namespace,
                           profile=deploy_options.profile)
Ejemplo n.º 2
0
def check_deployment():
    # Checks
    print("Checking OLM deployment")
    deployments = ['olm-operator', 'catalog-operator', 'packageserver']
    for deployment in deployments:
        utils.wait_for_rollout(k8s_object='deployment',
                               k8s_object_name=deployment,
                               target=deploy_options.target,
                               namespace='olm')
Ejemplo n.º 3
0
def deploy_prometheus_sub(olm_ns, cat_src):
    '''Deploy Operator Subscription'''
    topic = 'Prometheus Operator Subscription'
    src_file = os.path.join(os.getcwd(),\
            "deploy/monitoring/prometheus/assisted-installer-operator-subscription.yaml")
    dst_file = os.path.join(os.getcwd(),\
            "build/assisted-installer-operator-subscription.yaml")
    with open(src_file, "r") as src:
        with open(dst_file, "w+") as dst:
            data = src.read()
            data = data.replace("CAT_SRC",
                                cat_src).replace("OLM_NAMESPACE", olm_ns)
            print("Deploying {}: {}".format(topic, dst_file))
            dst.write(data)
    utils.apply(dst_file)
    utils.wait_for_rollout('deployment', 'prometheus-operator')
Ejemplo n.º 4
0
def check_deployment():
    # Checks
    print("Checking OLM deployment")
    deployments = ['olm-operator', 'catalog-operator', 'packageserver']
    for deployment in deployments:
        utils.wait_for_rollout('deployment', deployment, namespace='olm')