I have to create a secret using .p12 keystore (binary file). If I am creating it as below-
resource "kubernetes_secret_v1" "app_keystore" {
metadata {
name = "app-keystore"
namespace = "test"
}
type = "Opaque"
data = {
"test.p12"=file("./secret/appkeystore/test.p12")
}
}
It is giving below error
With filebase64 encoding, no error but the .p12 is encoded twice.
Found the resolution.
The correct encoding for a binary file is filebase64.