How do I tell if my container is running inside a Kubernetes cluster?

You can check for KUBERNETES_SERVICE_HOST environment variable.

This variable is always exported in an environment where the container is executed.

Refer to https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/#environment-variables

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)