def make_pod_spec(<EOL>image,<EOL>labels={},<EOL>threads_per_worker=<NUM_LIT:1>,<EOL>env={},<EOL>extra_container_config={},<EOL>extra_pod_config={},<EOL>memory_limit=None,<EOL>memory_request=None,<EOL>cpu_limit=None,<EOL>cpu_request=None,<EOL>):
args = [<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>', str(threads_per_worker),<EOL>'<STR_LIT>', '<STR_LIT>',<EOL>]<EOL>if memory_limit:<EOL><INDENT>args.extend(['<STR_LIT>', str(memory_limit)])<EOL><DEDENT>pod = client.V1Pod(<EOL>metadata=client.V1ObjectMeta(<EOL>labels=labels<EOL>),<EOL>spec=client.V1PodSpec(<EOL>restart_policy='<STR_LIT>',<EOL>containers=[<EOL>client.V1Container(<EOL>name='<STR_LIT>',<EOL>image=image,<EOL>args=args,<EOL>env=[client.V1EnvVar(name=k, value=v)<EOL>for k, v in env.items()],<EOL>)<EOL>],<EOL>tolerations=[<EOL>client.V1Toleration(<EOL>key='<STR_LIT>',<EOL>operator='<STR_LIT>',<EOL>value='<STR_LIT>',<EOL>effect='<STR_LIT>',<EOL>),<EOL>client.V1Toleration(<EOL>key='<STR_LIT>',<EOL>operator='<STR_LIT>',<EOL>value='<STR_LIT>',<EOL>effect='<STR_LIT>',<EOL>),<EOL>]<EOL>)<EOL>)<EOL>resources = client.V1ResourceRequirements(limits={}, requests={})<EOL>if cpu_request:<EOL><INDENT>resources.requests['<STR_LIT>'] = cpu_request<EOL><DEDENT>if memory_request:<EOL><INDENT>resources.requests['<STR_LIT>'] = memory_request<EOL><DEDENT>if cpu_limit:<EOL><INDENT>resources.limits['<STR_LIT>'] = cpu_limit<EOL><DEDENT>if memory_limit:<EOL><INDENT>resources.limits['<STR_LIT>'] = memory_limit<EOL><DEDENT>pod.spec.containers[<NUM_LIT:0>].resources = resources<EOL>for key, value in extra_container_config.items():<EOL><INDENT>_set_k8s_attribute(<EOL>pod.spec.containers[<NUM_LIT:0>],<EOL>key,<EOL>value<EOL>)<EOL><DEDENT>for key, value in extra_pod_config.items():<EOL><INDENT>_set_k8s_attribute(<EOL>pod.spec,<EOL>key,<EOL>value<EOL>)<EOL><DEDENT>return pod<EOL>
Create generic pod template from input parameters

Examples
--------
>>> make_pod_spec(image='daskdev/dask:latest', memory_limit='4G', memory_request='4G')