For securing communications to Kafka, part of Cloud Pak Foundational services, retrieve
Kafka truststore.p12.
About this task
Typically, you retrieve the Kafka truststore for communications from Kafka brokers.
Procedure
-
Retrieve the environment information.
JOB_MANAGER_POD=$(kubectl get pod -n <namespace> -l component=jobmanager --no-headers -o custom-columns=":metadata.name")
TRUSTSTORE_PATH=$(kubectl get pods ${JOB_MANAGER_POD} -n <namespace> -o jsonpath='{.spec.containers[?(@.name=="flink-main-container")].env[?(@.name=="TRUSTSTORE_PATH")].value}')
TRUSTSTORE_PASSWORD_PATH=$(kubectl get pods ${JOB_MANAGER_POD} -n <namespace> -o jsonpath='{.spec.containers[?(@.name=="flink-main-container")].env[?(@.name=="TRUSTSTORE_PASSWORD_PATH")].value}')
- Retrieve the truststore.
kubectl cp -n <namespace> -c flink-main-container ${JOB_MANAGER_POD}:${TRUSTSTORE_PATH} truststore.p12
- Retrieve the truststore password in plain text.
kubectl exec -it -c flink-main-container ${JOB_MANAGER_POD} -n <namespace> -- cat ${TRUSTSTORE_PASSWORD_PATH}