'The k8s spec template is nothing but a Pod spec, except that it is nested and does not have an apiversion
nor kind. In addition to required fields for a Pod, a pod template in a job must specify appropriate labels
(see pod selector) and an appropriate restart policy.'

def __get_k8s_job_spec_template(self, job_wrapper):

    k8s_spec_template = {'metadata': {'labels': {'app': self.__produce_unique_k8s_job_name(job_wrapper.get_id_tag())}}, 'spec': {'volumes': self.__get_k8s_mountable_volumes(job_wrapper), 'restartPolicy': self.__get_k8s_restart_policy(job_wrapper), 'containers': self.__get_k8s_containers(job_wrapper)}}
    if (self._supplemental_group and (self._supplemental_group > 0)):
        k8s_spec_template['spec']['securityContext'] = dict(supplementalGroups=[self._supplemental_group])
    if (self._fs_group and (self._fs_group > 0)):
        if ('securityContext' in k8s_spec_template['spec']):
            k8s_spec_template['spec']['securityContext']['fsGroup'] = self._fs_group
        else:
            k8s_spec_template['spec']['securityContext'] = dict(fsGroup=self._fs_group)
    return k8s_spec_template
