ironik.config_file_handler package

Submodules

ironik.config_file_handler.cloud_conf_parser module

author

Jonathan Decker

ironik.config_file_handler.cloud_conf_parser.config_ini_to_string(cloud_conf)[source]
Parameters

cloud_conf (configparser.ConfigParser) –

Return type

str

ironik.config_file_handler.cloud_conf_parser.get_cloud_conf(openstack_credentials, openstack_config, subnet_id, public_network_id, router_id)[source]
Parameters
Returns

Return type

configparser.ConfigParser

ironik.config_file_handler.deploy_template module

Definition and functions for spawning deployment templates.

author

Jonathan Decker

class ironik.config_file_handler.deploy_template.DeployConfig(rancher_credentials: ironik.config_file_handler.deploy_template.RancherCredentials = RancherCredentials(rancher_access_key='', rancher_secret_key=''), openstack_credentials: ironik.config_file_handler.deploy_template.OpenStackCredentials = OpenStackCredentials(username='', password='', project_id=''), rancher_config: ironik.config_file_handler.deploy_template.RancherConfig = RancherConfig(rancher_api_base_url='', ssh_user='', new_cluster_admin_user_name='', new_cluster_admin_user_password='', engine_install_url='https://releases.rancher.com/install-docker/20.10.sh'), openstack_config: ironik.config_file_handler.deploy_template.OpenStackConfig = OpenStackConfig(openstack_auth_url='', user_domain_name='', project_domain_name='', lb_provider='', default_flavor_name='', default_image_name='', remote_ip_prefix='', private_network_id='', region_name='', use_octavia=True, security_group_name='ironik-k8s-node', volume_size=10, volume_type='ssd'), network_config: ironik.config_file_handler.deploy_template.NetworkConfig = NetworkConfig(required_TCP_ports=[22, 80, 443, 2376, 2379, 2380, 6443, 8443, 8472, 9913, 10250, 10254], required_UDP_ports=[8443, 8472], worker_port_range_min=30000, worker_port_range_max=32767), kubernetes_config: ironik.config_file_handler.deploy_template.KubernetesConfig = KubernetesConfig(master_node_roles='master, etcd, worker', worker_node_roles='worker', version='v1.22.9-rancher1-1', number_master_nodes=1, number_worker_nodes=1), deployment_options: ironik.config_file_handler.deploy_template.DeploymentOptions = DeploymentOptions(deploy_example_workload=False, example_workload_image='rancher/hello-world', example_workload_name='hello-world-example', deploy_nginx_workload=False, nginx_ingress_version='4.1.0', nginx_ingress_repo='https://kubernetes.github.io/ingress-nginx', nginx_ingress_app_name='nginx-ingress-lb', install_cinder_driver=False, deploy_example_volume=False, cleanup_example_workload=True, cleanup_nginx_ingress=True, cleanup_example_volume=True))[source]

Bases: yaml.YAMLObject

Parameters
Return type

None

deployment_options: ironik.config_file_handler.deploy_template.DeploymentOptions = DeploymentOptions(deploy_example_workload=False, example_workload_image='rancher/hello-world', example_workload_name='hello-world-example', deploy_nginx_workload=False, nginx_ingress_version='4.1.0', nginx_ingress_repo='https://kubernetes.github.io/ingress-nginx', nginx_ingress_app_name='nginx-ingress-lb', install_cinder_driver=False, deploy_example_volume=False, cleanup_example_workload=True, cleanup_nginx_ingress=True, cleanup_example_volume=True)
kubernetes_config: ironik.config_file_handler.deploy_template.KubernetesConfig = KubernetesConfig(master_node_roles='master, etcd, worker', worker_node_roles='worker', version='v1.22.9-rancher1-1', number_master_nodes=1, number_worker_nodes=1)
network_config: ironik.config_file_handler.deploy_template.NetworkConfig = NetworkConfig(required_TCP_ports=[22, 80, 443, 2376, 2379, 2380, 6443, 8443, 8472, 9913, 10250, 10254], required_UDP_ports=[8443, 8472], worker_port_range_min=30000, worker_port_range_max=32767)
openstack_config: ironik.config_file_handler.deploy_template.OpenStackConfig = OpenStackConfig(openstack_auth_url='', user_domain_name='', project_domain_name='', lb_provider='', default_flavor_name='', default_image_name='', remote_ip_prefix='', private_network_id='', region_name='', use_octavia=True, security_group_name='ironik-k8s-node', volume_size=10, volume_type='ssd')
openstack_credentials: ironik.config_file_handler.deploy_template.OpenStackCredentials = OpenStackCredentials(username='', password='', project_id='')
rancher_config: ironik.config_file_handler.deploy_template.RancherConfig = RancherConfig(rancher_api_base_url='', ssh_user='', new_cluster_admin_user_name='', new_cluster_admin_user_password='', engine_install_url='https://releases.rancher.com/install-docker/20.10.sh')
rancher_credentials: ironik.config_file_handler.deploy_template.RancherCredentials = RancherCredentials(rancher_access_key='', rancher_secret_key='')
yaml_loader

alias of yaml.loader.SafeLoader

yaml_tag = '!DeployConfig'
class ironik.config_file_handler.deploy_template.DeploymentOptions(deploy_example_workload: bool = False, example_workload_image: str = 'rancher/hello-world', example_workload_name: str = 'hello-world-example', deploy_nginx_workload: bool = False, nginx_ingress_version: str = '4.1.0', nginx_ingress_repo: str = 'https://kubernetes.github.io/ingress-nginx', nginx_ingress_app_name: str = 'nginx-ingress-lb', install_cinder_driver: bool = False, deploy_example_volume: bool = False, cleanup_example_workload: bool = True, cleanup_nginx_ingress: bool = True, cleanup_example_volume: bool = True)[source]

Bases: yaml.YAMLObject

Parameters
  • deploy_example_workload (bool) –

  • example_workload_image (str) –

  • example_workload_name (str) –

  • deploy_nginx_workload (bool) –

  • nginx_ingress_version (str) –

  • nginx_ingress_repo (str) –

  • nginx_ingress_app_name (str) –

  • install_cinder_driver (bool) –

  • deploy_example_volume (bool) –

  • cleanup_example_workload (bool) –

  • cleanup_nginx_ingress (bool) –

  • cleanup_example_volume (bool) –

Return type

None

cleanup_example_volume: bool = True
cleanup_example_workload: bool = True
cleanup_nginx_ingress: bool = True
deploy_example_volume: bool = False
deploy_example_workload: bool = False
deploy_nginx_workload: bool = False
example_workload_image: str = 'rancher/hello-world'
example_workload_name: str = 'hello-world-example'
install_cinder_driver: bool = False
nginx_ingress_app_name: str = 'nginx-ingress-lb'
nginx_ingress_repo: str = 'https://kubernetes.github.io/ingress-nginx'
nginx_ingress_version: str = '4.1.0'
yaml_loader

alias of yaml.loader.SafeLoader

yaml_tag = '!DeploymentOptions'
class ironik.config_file_handler.deploy_template.KubernetesConfig(master_node_roles: str = 'master, etcd, worker', worker_node_roles: str = 'worker', version: str = 'v1.22.9-rancher1-1', number_master_nodes: int = 1, number_worker_nodes: int = 1)[source]

Bases: yaml.YAMLObject

Parameters
  • master_node_roles (str) –

  • worker_node_roles (str) –

  • version (str) –

  • number_master_nodes (int) –

  • number_worker_nodes (int) –

Return type

None

master_node_roles: str = 'master, etcd, worker'
number_master_nodes: int = 1
number_worker_nodes: int = 1
version: str = 'v1.22.9-rancher1-1'
worker_node_roles: str = 'worker'
yaml_loader

alias of yaml.loader.SafeLoader

yaml_tag = '!KubernetesConfig'
class ironik.config_file_handler.deploy_template.NetworkConfig(required_TCP_ports: list = <factory>, required_UDP_ports: list = <factory>, worker_port_range_min: int = 30000, worker_port_range_max: int = 32767)[source]

Bases: yaml.YAMLObject

Parameters
  • required_TCP_ports (list[int]) –

  • required_UDP_ports (list[int]) –

  • worker_port_range_min (int) –

  • worker_port_range_max (int) –

Return type

None

required_TCP_ports: list[int]
required_UDP_ports: list[int]
worker_port_range_max: int = 32767
worker_port_range_min: int = 30000
yaml_loader

alias of yaml.loader.SafeLoader

yaml_tag = '!NetworkConfig'
class ironik.config_file_handler.deploy_template.OpenStackConfig(openstack_auth_url: str, user_domain_name: str, project_domain_name: str, lb_provider: str, default_flavor_name: str, default_image_name: str, remote_ip_prefix: str, private_network_id: str, region_name: str = 'RegionOne', use_octavia: bool = True, security_group_name: str = 'ironik-k8s-node', volume_size: int = 10, volume_type: str = 'ssd')[source]

Bases: yaml.YAMLObject

Parameters
  • openstack_auth_url (str) –

  • user_domain_name (str) –

  • project_domain_name (str) –

  • lb_provider (str) –

  • default_flavor_name (str) –

  • default_image_name (str) –

  • remote_ip_prefix (str) –

  • private_network_id (str) –

  • region_name (str) –

  • use_octavia (bool) –

  • security_group_name (str) –

  • volume_size (int) –

  • volume_type (str) –

Return type

None

default_flavor_name: str
default_image_name: str
lb_provider: str
openstack_auth_url: str
private_network_id: str
project_domain_name: str
region_name: str = 'RegionOne'
remote_ip_prefix: str
security_group_name: str = 'ironik-k8s-node'
use_octavia: bool = True
user_domain_name: str
volume_size: int = 10
volume_type: str = 'ssd'
yaml_loader

alias of yaml.loader.SafeLoader

yaml_tag = '!OpenStackConfig'
class ironik.config_file_handler.deploy_template.OpenStackCredentials(username: str, password: str, project_id: str)[source]

Bases: yaml.YAMLObject

Parameters
  • username (str) –

  • password (str) –

  • project_id (str) –

Return type

None

password: str
project_id: str
username: str
yaml_loader

alias of yaml.loader.SafeLoader

yaml_tag = '!OpenStackCredentials'
class ironik.config_file_handler.deploy_template.RancherConfig(rancher_api_base_url: str, ssh_user: str, new_cluster_admin_user_name: str, new_cluster_admin_user_password: str = '', engine_install_url: str = 'https://releases.rancher.com/install-docker/20.10.sh')[source]

Bases: yaml.YAMLObject

Parameters
  • rancher_api_base_url (str) –

  • ssh_user (str) –

  • new_cluster_admin_user_name (str) –

  • new_cluster_admin_user_password (str) –

  • engine_install_url (str) –

Return type

None

engine_install_url: str = 'https://releases.rancher.com/install-docker/20.10.sh'
new_cluster_admin_user_name: str
new_cluster_admin_user_password: str = ''
rancher_api_base_url: str
ssh_user: str
yaml_loader

alias of yaml.loader.SafeLoader

yaml_tag = '!RancherConfig'
class ironik.config_file_handler.deploy_template.RancherCredentials(rancher_access_key: str, rancher_secret_key: str)[source]

Bases: yaml.YAMLObject

Parameters
  • rancher_access_key (str) –

  • rancher_secret_key (str) –

Return type

None

rancher_access_key: str
rancher_secret_key: str
yaml_loader

alias of yaml.loader.SafeLoader

yaml_tag = '!RancherCredentials'
ironik.config_file_handler.deploy_template.load_deploy_template(path)[source]
Parameters

path (pathlib.Path) –

Returns

Return type

ironik.config_file_handler.deploy_template.DeployConfig

ironik.config_file_handler.deploy_template.validate_deploy_template()[source]
ironik.config_file_handler.deploy_template.write_deploy_template(path, overwrite)[source]
Parameters
  • path (pathlib.Path) –

  • overwrite (bool) –

Returns

Return type

None

ironik.config_file_handler.manifest_parser module

author

Jonathan Decker

ironik.config_file_handler.manifest_parser.get_cloud_controller_role_bindings_manifest()[source]
Return type

dict

ironik.config_file_handler.manifest_parser.get_cloud_controller_roles_manifest()[source]
Return type

dict

ironik.config_file_handler.manifest_parser.get_csi_plugin_manifest()[source]
Return type

list[dict]

ironik.config_file_handler.manifest_parser.get_manifest_path(manifest)[source]
Parameters

manifest (str) –

Return type

pathlib.Path

ironik.config_file_handler.manifest_parser.get_openstack_controller_manager_manifest(openstack_config)[source]
Parameters

openstack_config (ironik.config_file_handler.deploy_template.OpenStackConfig) –

Return type

list[dict]

Module contents