<p>How can I tell  whether or not I am running inside a kubernetes cluster? With docker I can check if <code>/.dockerinit</code> exist. Is there an equivalent?</p>

<p>You can check for <code>KUBERNETES_SERVICE_HOST</code> environment variable.</p>

<p>This variable is always exported in an environment where the container is executed.</p>

<p>Refer to <a href="https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/#environment-variables" rel="noreferrer">https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/#environment-variables</a></p>
