<p>Is it possible to invoke a kubernetes Cron job inside a pod . Like I have to run this job from the application running in pod .  </p>

<p>Do I have to use kubectl inside the pod to execute the job . </p>

<p>Appreciate your help</p>

<blockquote>
  <p>Use the Default Service Account to access the API server. When you
  create a pod, if you do not specify a service account, it is
  automatically assigned the default service account in the same
  namespace. If you get the raw json or yaml for a pod you have created
  (for example, kubectl get pods/ -o yaml), you can see the
  spec.serviceAccountName field has been automatically set.</p>
  
  <p>You can access the API from inside a pod using automatically mounted
  service account credentials, as described in Accessing the Cluster.
  The API permissions of the service account depend on the authorization
  plugin and policy in use.</p>
  
  <p>In version 1.6+, you can opt out of automounting API credentials for a
  service account by setting automountServiceAccountToken: false on the
  service account</p>
</blockquote>

<p><a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/</a></p>

<ol>
<li><p>So the First task is to either grant the permission of doing what you need to create to the default service account of the pod OR create a custom service account and use it inside the pod</p></li>
<li><p>Programatically access the API server using that service account to create the job you need</p></li>
<li><p>It could be just a simple curl POST to the API server from inside the pod with the json for the job creation</p></li>
</ol>

<p><a href="https://stackoverflow.com/questions/30690186/how-do-i-access-the-kubernetes-api-from-within-a-pod-container">How do I access the Kubernetes api from within a pod container?</a></p>

<p>you can also use the application specific SDK , for example if you have a python application , you can import kubernetes and run the job.</p>
