class_docstr: Creates Kubernetes API connection.
  
  - use in cluster configuration by using extra field ``in_cluster`` in connection
  - use custom config by providing path to the file using extra field ``kube_config_path`` in connection
  - use custom configuration by providing content of kubeconfig file via
      extra field ``kube_config`` in connection
  - use default config by providing no extras
  
  This hook check for configuration option in the above order. Once an option is present it will
  use this configuration.
  
  .. seealso::
      For more information about Kubernetes connection:
      :doc:`/connections/kubernetes`
  
  :param conn_id: The :ref:`kubernetes connection <howto/connection:kubernetes>`
      to Kubernetes cluster.
  :param client_configuration: Optional dictionary of client configuration params.
      Passed on to kubernetes client.
  :param cluster_context: Optionally specify a context to use (e.g. if you have multiple
      in your kubeconfig.
  :param config_file: Path to kubeconfig file.
  :param in_cluster: Set to ``True`` if running from within a kubernetes cluster.
  :param disable_verify_ssl: Set to ``True`` if SSL verification should be disabled.
  :param disable_tcp_keepalive: Set to ``True`` if you want to disable keepalive logic.
class_docstr_tok: ["Creates","Kubernetes","API","connection",".","-","use","in","cluster","configuration","by","using","extra","field","``","in_cluster","``","in","connection","-","use","custom","config","by","providing","path","to","the","file","using","extra","field","``","kube_config_path","``","in","connection","-","use","custom","configuration","by","providing","content","of","kubeconfig","file","via","extra","field","``","kube_config","``","in","connection","-","use","default","config","by","providing","no","extras","This","hook","check","for","configuration","option","in","the","above","order",".","Once","an","option","is","present","it","will","use","this","configuration",".","..","seealso",":",":","For","more","information","about","Kubernetes","connection",":",":","doc",":","`","\/connections\/kubernetes","`",":","param","conn_id",":","The",":","ref",":","`","kubernetes","connection","<","howto\/connection",":","kubernetes",">","`","to","Kubernetes","cluster",".",":","param","client_configuration",":","Optional","dictionary","of","client","configuration","params",".","Passed","on","to","kubernetes","client",".",":","param","cluster_context",":","Optionally","specify","a","context","to","use","(","e.g",".","if","you","have","multiple","in","your","kubeconfig",".",":","param","config_file",":","Path","to","kubeconfig","file",".",":","param","in_cluster",":","Set","to","``","True","``","if","running","from","within","a","kubernetes","cluster",".",":","param","disable_verify_ssl",":","Set","to","``","True","``","if","SSL","verification","should","be","disabled",".",":","param","disable_tcp_keepalive",":","Set","to","``","True","``","if","you","want","to","disable","keepalive","logic","."]
docstr: Retrieve a container's log from the specified pod.
  
  :param pod_name: pod name
  :param container: container name
  :param namespace: kubernetes namespace
docstr_tok: ["Retrieve","a","container","'s","log","from","the","specified","pod",".",":","param","pod_name",":","pod","name",":","param","container",":","container","name",":","param","namespace",":","kubernetes","namespace"]
code: def get_pod_logs(
      self,
      pod_name: str,
      container: str | None = "",
      namespace: str | None = None,
  ):
      """
      Retrieve a container's log from the specified pod.
  
      :param pod_name: pod name
      :param container: container name
      :param namespace: kubernetes namespace
      """
      return self.core_v1_client.read_namespaced_pod_log(
          name=pod_name,
          container=container,
          _preload_content=False,
          namespace=namespace
          or self.get_namespace()
          or self.DEFAULT_NAMESPACE,
      )
  
imports: from __future__ import annotations
  import contextlib
  import json
  import tempfile
  from functools import cached_property
  from typing import TYPE_CHECKING, Any, Generator
  import aiofiles
  from asgiref.sync import sync_to_async
  from kubernetes import client, config, watch
  from kubernetes.config import ConfigException
  from kubernetes_asyncio import client, config
  from urllib3.exceptions import HTTPError
  from airflow.exceptions import AirflowException, AirflowNotFoundException
  from airflow.hooks.base import BaseHook
  from airflow.models import Connection
  from airflow.providers.cncf.kubernetes.kube_client import _disable_verify_ssl, _enable_tcp_keepalive
  from airflow.providers.cncf.kubernetes.utils.pod_manager import PodOperatorHookProtocol
  from airflow.utils import yaml
label_desc: Use image node_id 21 for calling the KubernetesHook obj's underlying member method code with example usage: obj.get_pod_logs(pod_name, container, namespace) and returns: self