Exemplo n.º 1
0
    def update_olm_configuration(cls,
                                 tf_config: BaseNodeConfig,
                                 operators=None) -> None:
        if operators is None:
            operators = parse_olm_operators_from_env()

        tf_config.worker_memory = resource_param(
            tf_config.worker_memory, OperatorResource.WORKER_MEMORY_KEY,
            operators)
        tf_config.master_memory = resource_param(
            tf_config.master_memory, OperatorResource.MASTER_MEMORY_KEY,
            operators)
        tf_config.worker_vcpu = resource_param(
            tf_config.worker_vcpu, OperatorResource.WORKER_VCPU_KEY, operators)
        tf_config.master_vcpu = resource_param(
            tf_config.master_vcpu, OperatorResource.MASTER_VCPU_KEY, operators)
        tf_config.workers_count = resource_param(
            tf_config.workers_count, OperatorResource.WORKER_COUNT_KEY,
            operators)
        tf_config.worker_disk = resource_param(
            tf_config.worker_disk, OperatorResource.WORKER_DISK_KEY, operators)
        tf_config.master_disk = resource_param(
            tf_config.master_disk, OperatorResource.MASTER_DISK_KEY, operators)
        tf_config.master_disk_count = resource_param(
            tf_config.master_disk_count,
            OperatorResource.MASTER_DISK_COUNT_KEY, operators)
        tf_config.worker_disk_count = resource_param(
            tf_config.worker_disk_count,
            OperatorResource.WORKER_DISK_COUNT_KEY, operators)
        tf_config.nodes_count = tf_config.masters_count + tf_config.workers_count
Exemplo n.º 2
0
    def download_iso_override_nodes_count(
            self, prepared_controller_configuration: BaseNodeConfig):
        """No need creating any nodes for creating a cluster and download its ISO
        Setting masters_count and workers_count to 0 on with overriding controller_configuration fixture return value
        before nodes creation causing Nodes object not to generate any new nodes"""

        prepared_controller_configuration.masters_count = 0
        prepared_controller_configuration.workers_count = 0
        yield prepared_controller_configuration
Exemplo n.º 3
0
    def prepared_controller_configuration(
            self,
            new_controller_configuration: BaseNodeConfig) -> BaseNodeConfig:
        if not isinstance(new_controller_configuration, TerraformConfig):
            yield new_controller_configuration
            return

        # Configuring net asset which currently supported by libvirt terraform only
        net_asset = LibvirtNetworkAssets()
        new_controller_configuration.net_asset = net_asset.get()

        if new_controller_configuration.bootstrap_in_place:
            new_controller_configuration.single_node_ip = new_controller_configuration.net_asset.machine_cidr.replace(
                "0/24", "10")

        yield new_controller_configuration
        net_asset.release_all()
Exemplo n.º 4
0
    def prepared_controller_configuration(
            self,
            new_controller_configuration: BaseNodeConfig) -> BaseNodeConfig:
        if not isinstance(new_controller_configuration, TerraformConfig):
            yield new_controller_configuration
            return

        # Configuring net asset which currently supported by libvirt terraform only
        net_asset = LibvirtNetworkAssets()
        new_controller_configuration.net_asset = net_asset.get()
        yield new_controller_configuration
        net_asset.release_all()
Exemplo n.º 5
0
 def _configure_workers(terraform_config: BaseNodeConfig):
     terraform_config.masters_count = 0
     terraform_config.workers_count = 2
     terraform_config.worker_vcpu = 4
     terraform_config.worker_memory = 17920
     terraform_config.ingress_dns = True
     terraform_config.cluster_name = global_variables.cluster_name
Exemplo n.º 6
0
 def _configure_highly_available(terraform_config: BaseNodeConfig):
     terraform_config.masters_count = 3
     terraform_config.workers_count = 0
     terraform_config.master_vcpu = 4
     terraform_config.master_memory = 17920
Exemplo n.º 7
0
 def _configure_single_node(terraform_config: BaseNodeConfig):
     terraform_config.masters_count = 1
     terraform_config.workers_count = 0
     terraform_config.master_vcpu = 8
     terraform_config.master_memory = 35840