def build_kubelet_args(facts):
 cloud_cfg_path = os.path.join(facts['common']['config_base'], 'cloudprovider')
 if ('node' in facts):
  kubelet_args = {}
  if ('cloudprovider' in facts):
   if ('kind' in facts['cloudprovider']):
    if (facts['cloudprovider']['kind'] == 'aws'):
     kubelet_args['cloud-provider'] = ['aws']
     kubelet_args['cloud-config'] = [(cloud_cfg_path + '/aws.conf')]
    if (facts['cloudprovider']['kind'] == 'openstack'):
     kubelet_args['cloud-provider'] = ['openstack']
     kubelet_args['cloud-config'] = [(cloud_cfg_path + '/openstack.conf')]
    if (facts['cloudprovider']['kind'] == 'gce'):
     kubelet_args['cloud-provider'] = ['gce']
     kubelet_args['cloud-config'] = [(cloud_cfg_path + '/gce.conf')]
  if (('labels' in facts['node']) and isinstance(facts['node']['labels'], dict)):
   labels_str = list(map((lambda x: '='.join(x)), facts['node']['labels'].items()))
   if (labels_str != ''):
    kubelet_args['node-labels'] = labels_str
  if (kubelet_args != {}):
   facts = merge_facts({'node': {'kubelet_args': kubelet_args}}, facts, [], [])
 return facts

def build_kubelet_args ( facts ) : cloud_cfg_path = os . path . join ( facts [ 'common' ] [ 'config_base' ] , 'cloudprovider' ) if ( 'node' in facts ) : kubelet_args = { } if ( 'cloudprovider' in facts ) : if ( 'kind' in facts [ 'cloudprovider' ] ) : if ( facts [ 'cloudprovider' ] [ 'kind' ] == 'aws' ) : kubelet_args [ 'cloud-provider' ] = [ 'aws' ] kubelet_args [ 'cloud-config' ] = [ ( cloud_cfg_path + '/aws.conf' ) ] if ( facts [ 'cloudprovider' ] [ 'kind' ] == 'openstack' ) : kubelet_args [ 'cloud-provider' ] = [ 'openstack' ] kubelet_args [ 'cloud-config' ] = [ ( cloud_cfg_path + '/openstack.conf' ) ] if ( facts [ 'cloudprovider' ] [ 'kind' ] == 'gce' ) : kubelet_args [ 'cloud-provider' ] = [ 'gce' ] kubelet_args [ 'cloud-config' ] = [ ( cloud_cfg_path + '/gce.conf' ) ] if ( ( 'labels' in facts [ 'node' ] ) and isinstance ( facts [ 'node' ] [ 'labels' ] , dict ) ) : labels_str = list ( map ( ( lambda x : '=' . join ( x ) ) , facts [ 'node' ] [ 'labels' ] . items ( ) ) ) if ( labels_str != '' ) : kubelet_args [ 'node-labels' ] = labels_str if ( kubelet_args != { } ) : facts = merge_facts ( { 'node' : { 'kubelet_args' : kubelet_args } } , facts , [ ] , [ ] ) return facts
build node kubelet_args in the node-config .