<p>I have written a job scheduler service in go, which uploads files under a periodic interval. There is no HTTP service is running inside that service.</p>
<p>Normally, for HTTP service, below are liveness and readiness probe configuration, need to be added at the deployment file.</p>
<pre><code>readinessProbe:
  httpGet:
    path: &lt;http_get_path&gt;
    port: 3401
  initialDelaySeconds: 5
  timeoutSeconds: 1
  periodSeconds: 15

livenessProbe:
  httpGet:
    path: &lt;http_get_path&gt;
    port: 3401
  initialDelaySeconds: 15
  timeoutSeconds: 1
  periodSeconds: 15
</code></pre>
<p>For standalone service like below:</p>
<pre><code>//main : main function to trigger the services
func main() {
    scheduler.RunScheduler()
}

//RunScheduler : Run the scheduler
func RunScheduler() {
    done := make(chan bool)
    quit := make(chan bool)

    go startJob1()

    go startJob2()
    
    sigs := make(chan os.Signal, 1)
    //pass done &quot;True&quot;, only if the application is stopped
    signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
    &lt;-sigs
    .....
}
</code></pre>
<p>which just runs periodically and don't listen to any port, can we configure any kind of readiness probe and liveness probe?</p>

Siddhanta Rath
<p>Since your container doesn't handle any http request you dont need <code>readinessProbe</code>.</p>
<blockquote>
<p><code>readinessProbe</code>: Indicates whether the container is ready to respond to
requests. If the readiness probe fails, the endpoints controller
removes the Pod's IP address from the endpoints of all Services that
match the Pod.</p>
</blockquote>
<p><a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#when-should-you-use-a-liveness-probe" rel="nofollow noreferrer">When should you use a liveness probe?</a></p>
<p>You need a <code>livenessProbe</code>.</p>
<blockquote>
<p><code>livenessProbe</code>: Indicates whether the container is running. If the
liveness probe fails, the kubelet kills the container, and the
container is subjected to its restart policy.</p>
</blockquote>
<p><a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#when-should-you-use-a-readiness-probe" rel="nofollow noreferrer">When should you use a readiness probe?</a></p>
<p>Here is an example with <code>ps</code> of process:</p>
<pre><code>livenessProbe:
    exec:
     command:
     - ps -ef | grep my_process_name
    initialDelaySeconds: 120
    periodSeconds: 30
</code></pre>
<p>Be sure you have a <code>ps</code> command in the <code>$PATH</code>.</p>
<p>Another way is to create a file in the tmp dir on the pod start and check if a file present in the <code>exec</code> command.</p>
