Use Kafka command line with Kerberos

kdestroy
kinit -k -t myprincipal.keytab myprincipal/HOST.com

export KAFKA_CLIENT_KERBEROS_PARAMS="-Djava.security.auth.login.config=/etc/kafka/conf/kafka_client_jaas.conf"

/usr/hdp/current/kafka-broker/bin/kafka-console-consumer.sh \
--zookeeper zookeeper.com:2181 \
--topic topicname \
--from-beginning \
--security-protocol SASL_PLAINTEXT

Login to Container in Kubernetes

Step 0

Get all pods

kubectl get po --all-namespaces

Find the pod name in which your container is running

Step 1

Get the container name from running pod

kubectl describe po pod_name --namespace my_namespace


Example output

Name: pod_name
Namespace: my_namespace
Node: docker-host-03/10.1.3.115
Start Time: Wed, 23 Nov 2016 16:57:15 +1100
Labels: name=my_container_name,pod-template-hash=2802333548
Status: Running
IP: 10.20.71.4


Note the label with value name

Step 2

Login to container

Example

kubectl exec -it pod_name --namespace my_namespace -c my_container_name bash