def initialize(interactive=False): _set_provider() if interactive: print('\nEnter the path to a Google Cloud service account json file with relevant permissions\n') _config_interactive_set({'service-account-json': None}, is_secret=True, from_file=True) print('\nEnter the service account email\n') _config_interactive_set({'service-account-email': None}, is_secret=True) print('\nEnter the compute zone of the Google Kubernetes cluster which will be used as default compute zone\n') _config_interactive_set({'cluster-compute-zone': None}) print('\nEnter the name of your cluster as defined in Google Kubernetes Engine\n') _config_interactive_set({'cluster-name': None}) print('\nEnter the google project ID\n') _config_interactive_set({'project-id': None}) print('\nWould you like to deploy the NFS client provisioner for shared storage? you need to have an existing NFS server. enter yes/no\n') _config_interactive_set({'deploy-nfs-client-provisioner': "no"}) if _config_get("deploy-nfs-client-provisioner") == "yes": print('\nEnter the NFS server ip and a path available to mount from the NFS server which will be used by the provisioner (path should exist)\n') _config_interactive_set({"nfs-client-provsioner-server-ip": None}) _config_interactive_set({"nfs-client-provsioner-server-path": None}) gcloud_driver.activate_auth( _config_get('project-id'), _config_get('cluster-compute-zone'), _config_get('service-account-email', is_secret=True), _config_get('service-account-json', is_secret=True) ) print(yaml.dump(get_info(), default_flow_style=False)) create_storage_class()
def activate_auth(): gcloud_driver.activate_auth( _config_get('project-id'), _config_get('cluster-compute-zone'), _config_get('service-account-email', is_secret=True), _config_get('service-account-json', is_secret=True) )
def initialize(interactive=False): _set_provider() if interactive: print( '\nEnter the path to a Google Cloud service account json file with relevant permissions\n' ) _config_interactive_set({'service-account-json': None}, is_secret=True, from_file=True) print('\nEnter the service account email\n') _config_interactive_set({'service-account-email': None}, is_secret=True) print( '\nEnter the compute zone of the Google Kubernetes cluster which will be used as default compute zone\n' ) _config_interactive_set({'cluster-compute-zone': None}) print( '\nEnter the name of your cluster as defined in Google Kubernetes Engine\n' ) _config_interactive_set({'cluster-name': None}) print('\nEnter the google project ID\n') _config_interactive_set({'project-id': None}) gcloud_driver.activate_auth( _config_get('project-id'), _config_get('cluster-compute-zone'), _config_get('service-account-email', is_secret=True), _config_get('service-account-json', is_secret=True)) print(yaml.dump(get_info(), default_flow_style=False))