Converting a String to Base64
Sensitive data contained in a Secret must be represented in base64. Use these steps to convert such information to the base64 representation:
For example, in Linux:
echo -n 'mapr' | base64
The output shows the base64 representation of the user name mapr
is
bWFwcg==
.
MapR tickets include a cluster name followed by a base64-encoded string. It is not sufficient to insert the base64-encoded string into a Kubernetes Secret. You must convert both the cluster name and string into base64 representation and then insert the result into the Secret.
The following command shows how to convert a MapR ticket to base64 representation:
echo -n "cluster-name <base64-encoded ticket-value>" | base64
For
example:
echo -n "cluster2 PuG0lpuPXuDxj9ERgKCTXOqsXYPTnqRJl6/mlWJjdVKvE5r46QS2Bh9nC+I4Rcu0GtnWRUOtKBG9gp65bsZN9Kphnr/Wp15z8D3O2go951CANes/7QQllYVP7l2BOpGR6I1zIrC3XGwI8OQWT61qpsjSVZv8zO5oQ5GDYQTkPttI/yAk/uJBES1ohCz38n9HgYALLvMALVsBPtUtG+cNGc1ktUDDMR2q1EgVzdJbuYsOuHnZX3LO3euKDGl4C4MCmrv9DWiWJxwiZ1yZu69GbZJlXxqLOQBlkdMoTXk=" | base64
Y2x1c3RlcjIgUHVHMGxwdVBYdUR4ajlFUmdLQ1RYT3FzWFlQVG5xUkpsNi9tbFdKamRWS3ZFNXI0
NlFTMkJoOW5DK0k0UmN1MEd0bldSVU90S0JHOWdwNjVic1pOOUtwaG5yL1dwMTV6OEQzTzJnbzk1
MUNBTmVzLzdRUWxsWVZQN2wyQk9wR1I2STF6SXJDM1hHd0k4T1FXVDYxcXBzalNWWnY4ek81b1E1
R0RZUVRrUHR0SS95QWsvdUpCRVMxb2hDejM4bjlIZ1lBTEx2TUFMVnNCUHRVdEcrY05HYzFrdFVE
RE1SMnExRWdWemRKYnVZc091SG5aWDNMTzNldUtER2w0QzRNQ21ydjlEV2lXSnh3aVoxeVp1NjlH
YlpKbFh4cUxPUUJsa2RNb1RYaz0K
NOTE
Another method for converting values to base64 is to use an Internet tool such as https://www.base64encode.org to encode or decode data.