How can I check whether it is plain vanilla docker container or a container wrapped in a pod by way of a very simple introspection during runtime?
Kubernetes sets many environment variables inside the container by default. You can check if any of them are set. eg: KUBERNETES_SERVICE_HOST
# kubectl exec -it api-server-594f9684b-jg2d4 env | grep KUBERNETES
KUBERNETES_SERVICE_PORT_HTTPS=443
KUBERNETES_SERVICE_PORT=443
KUBERNETES_SERVICE_HOST=10.96.0.1
KUBERNETES_PORT_443_TCP_PORT=443
KUBERNETES_PORT_443_TCP_PROTO=tcp
KUBERNETES_PORT_443_TCP=tcp://10.96.0.1:443
KUBERNETES_PORT_443_TCP_ADDR=10.96.0.1
KUBERNETES_PORT=tcp://10.96.0.1:443
https://kubernetes.io/docs/concepts/containers/container-environment-variables/