예제 #1
0
def Factory_InitKubeClient(configtype=None,
                           configfile=None,
                           context=None,
                           apiversion=None):

    if configtype == "InCluster":
        config.load_incluster_config()
    elif configtype == "OutCluster":
        if configfile == None:
            configfile = dirname(
                os.path.realpath(__file__)) + os.sep + "kube_config.yml"
        config.load_kube_config(config_file=configfile, context=context)
    else:
        print("Input cofigtype not support!")
        exit(1)

    CoreV1Api = client.CoreV1Api()
    #Store CoreV1Api Client in global module
    globalvars.set_value('KubCoreV1Api', CoreV1Api)
예제 #2
0
    'specify the tenant name for current environment, default value is demo')
delPVCParser.add_argument(
    '-env',
    type=str,
    default='qa',
    help='specify the environment name, default value is qa')
delPVCParser.add_argument(
    '-envtype',
    type=str,
    default='auth',
    help=
    'specify environment type [live | auth] for current environment, default value is auth'
)
delPVCParser.add_argument(
    '-namespace',
    type=str,
    default='default',
    help=
    'specify the namespace in kubernetes for current environment, default value is default'
)
delPVCParser.add_argument(
    '-component',
    type=str,
    help='specify current component which startup rely on the dependence check'
)

createPVCParser.set_defaults(func=CreateKubePVC)
delPVCParser.set_defaults(func=DeleteKubePVC)

globalvars.set_value('SubCMDParser', _secureSubParser)
    'specify the namespace in kubernetes for current environment, default value is default'
)
buildIndexParser.add_argument('-masterCatalogId',
                              type=str,
                              default='default',
                              help='master catalog Id')
buildIndexParser.add_argument(
    '-spiEncryptedToken',
    type=str,
    default='c3BpdXNlcjpwYXNzdzByZA==',
    help=
    'specfy encrypted spiuser password str by command: echo -n "spiuser:password" | base64'
)
buildIndexParser.set_defaults(func=buildIndex)

globalvars.set_value('SubCMDParser', buildIndexSubParser)

replicaIndexSubParser = globalvars.get_value('SubCMDParser')

replicaIndexParser = replicaIndexSubParser.add_parser(
    'replicaIndex', help='build search master index in auth enviroment')
replicaIndexParser.add_argument(
    '-tenant',
    type=str,
    default='demo',
    help=
    'specify the tenant name for current environment, default value is demo')
replicaIndexParser.add_argument(
    '-env',
    type=str,
    default='qa',