Skip to content

Commit

Permalink
F OpenNebula/one-aiops#70: fix kubecfg path
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioRobres committed Jun 7, 2024
1 parent 76c17c4 commit b3256fd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions lithops/serverless/backends/one/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ class OneConfigError(Exception):


# Add OpenNebula defaults
DEFAULT_CONFIG_KEYS = {
DEFAULT_CONFIG_KEYS.update({
'timeout': 600,
'kubcfg_path': '/tmp/kube_config'
}
'kubecfg_path': '/tmp/kube_config',
})


def load_config(config_data):
Expand Down
10 changes: 5 additions & 5 deletions lithops/serverless/backends/one/one.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(self, one_config, internal_storage):
logger.debug("Initializing OpenNebula python client")
self.one = _config_one()

# template_id: instantiate OneKE
# template_id: instantiate master node
if 'template_id' in one_config:
one_config['service_id'] = self._instantiate_oneke(one_config['template_id'], one_config['oneke_config'])
self._wait_for_oneke(one_config['service_id'], one_config['timeout'])
Expand All @@ -59,13 +59,13 @@ def __init__(self, one_config, internal_storage):

# Get and Save kubeconfig from OneKE
kubecfg = self._get_kube_config(one_config['service_id'])
with open(one_config['oneconfig_path'], 'w') as file:
with open(one_config['kubecfg_path'], 'w') as file:
file.write(kubecfg)

# Overwrite config values
self.name = 'one'
self.kubecfg_path = one_config['oneconfig_path']
self.kubecfg_path = one_config['kubecfg_path']

super().__init__(one_config, internal_storage)


Expand All @@ -91,7 +91,7 @@ def _check_oneke(self, service_id):
def _instantiate_oneke(self, template_id, oneke_config):
# TODO: create private network if not passed

# Pass the temporary file path to the update() function
# Instantiate OneKE
oneke_json = json.loads(oneke_config)
_json = self.client.templatepool[template_id].instantiate(json_str=oneke_json)

Expand Down
4 changes: 2 additions & 2 deletions lithops/serverless/backends/one/one_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ lithops:
one:
service_id: # oneke service id (means OneKE is already deployed)
service_template_id: # oneke_tempalte_id (client has downloaded before)
oneconfig_path: # PATH to OneKE JSON config
oneke_config_path: # PATH to OneKE JSON config
timeout: # time to wait for OneKE to be ready
kubcfg_path': # PATH were kubeconfig will be stored
kubecfg_path': # PATH were kubeconfig will be stored
oneke_config:
public_network_id: # ID for Public vnet
private_network_id: # ID for Private vnet (if not passed: create a new one)
Expand Down

0 comments on commit b3256fd

Please sign in to comment.