Kafka
Create a Secret for securing Kafka credentials across multiple security modes.
Prerequisites
To create a Secret for securing Kafka credentials, you need the following information.
See Secret: Access control for who can create a Secret and how access to it is managed.
Source system requirements
Collect the values that match your Kafka security mode.
Common for all Kafka modes
brokers: Kafka bootstrap server addresses, such asbroker1:9092,broker2:9092. Get these from your Kafka admin, managed Kafka console, or cluster connection settings.security_protocol: Connection security mode used by the cluster. Supported values in this guide arePLAINTEXT,SSL,SASL_PLAINTEXT, andSASL_SSL. Get this from your Kafka client configuration, platform team, or cluster admin.sasl_mechanism: Required only forSASL-based modes. Supported values in this guide arePLAINandSCRAM-SHA-256. Get this from the same client configuration or from the Kafka admin.
Mode-specific attributes and credentials
Use this mode when the cluster uses username-password authentication without TLS.
username: Kafka username or service account name. Get this from the Kafka admin or from the user provisioning workflow of your managed Kafka service.password: Password or API secret for the Kafka user. Get this when the user is created, or request a reset from the Kafka admin if needed.
Use this mode when the cluster uses PLAINTEXT.
No additional Secret fields are required beyond
security_protocol.
Use this mode when the cluster requires TLS client authentication.
trust_store_type: Format of the trust store file. The examples useJKS. Get this from the security team that issued the trust store.trust_store_password: Password that protects the trust store. Get this from the security team or Kafka admin.trust_store_file: Local path to the trust store file that contains the CA certificates used to validate the broker certificate. This is usually exported and shared by the security team or platform admin.key_store_type: Format of the client key store file. The examples useJKS. Get this from the team that issued the client certificate.key_store_password: Password that protects the key store. Get this from the security team or Kafka admin.key_password: Password for the private key inside the key store. Get this from the security team or whoever generated the client key pair.key_store_file: Local path to the key store file that contains the client certificate and private key. This is usually generated by your PKI or security team.
Use this mode when the cluster uses TLS plus SASL PLAIN.
username: Kafka username or service account name. Get this from the Kafka admin or managed Kafka access control setup.password: Password or API secret for the Kafka user. Get this during user creation or from the Kafka admin.trust_store_type: Format of the trust store file. The examples useJKS. Get this from the security team.trust_store_password: Password that protects the trust store. Get this from the security team or Kafka admin.trust_store_file: Local path to the trust store file used to validate broker certificates. Get this from the security team or platform admin.
Use this mode when the cluster uses TLS plus SASL SCRAM-SHA-256.
username: Kafka username or SCRAM user name. Get this from the Kafka admin or managed Kafka identity setup.password: SCRAM password for the Kafka user. Get this when the SCRAM user is created, or rotate it through the Kafka admin.trust_store_type: Format of the trust store file. The examples useJKS. Get this from the security team.trust_store_password: Password that protects the trust store. Get this from the security team or Kafka admin.trust_store_file: Local path to the trust store file used to validate broker certificates. Get this from the security team or platform admin.ca_file: Optional CA certificate file path. Use this only when your team shares the CA certificate directly instead of a prepared trust store.
Create a Secret for securing Kafka credentials
DataOS supports multiple Kafka security modes. Choose the matching Secret template from the tabs below.
Supported Kafka Secret modes
SASL + PLAINTEXT
SASL_PLAINTEXT
PLAIN
username, password
Passwordless
PLAINTEXT
NA
security_protocol
SSL
SSL
NA
trust_store_*, key_store_*, key_password, files
SASL + SSL (PLAIN)
SASL_SSL
PLAIN
trust_store_*, username, password, files
SASL + SSL (SCRAM-256)
SASL_SSL
SCRAM-SHA-256
trust_store_*, username, password, files
Step 1: Create a manifest file
Create a manifest file with the configuration details for your Kafka Secret.
For more information about each attribute, refer to the configurations section.
Step 2: Apply the manifest
Use the apply command to create the Kafka Secret in DataOS.
Example Usage:
Step 3: Validate the Secret
Use the get command to verify the Kafka Secret in DataOS.
Expected Output:
To list all Secrets in the DataOS environment, run the following command.
Expected Output:
Delete the Secret
To delete the Kafka Secret, use one of the following commands:
Specify the Resource type and Secret name in the delete command.
Example Usage:
Last updated
Was this helpful?