Terrakube componentes (api, registry and executor) are using buildpacks to create the docker images
When using buildpack to add a custom CA certificate at runtime you need to do the following:
Provide the following environment variable to the container:
SERVICE_BINDING_ROOT: /mnt/platform/bindings
Inside the path there is a folder call "ca-certificates"
cnb@terrakube-api-678cb68d5b-ns5gt:/mnt/platform/bindings$ ls
ca-certificates
We need to mount some information to that path
/mnt/platform/bindings/ca-certificates
Inside this folder we should put out custom PEM CA certs and one additional file call type
cnb@terrakube-api-678cb68d5b-ns5gt:/mnt/platform/bindings/ca-certificates$ ls
terrakubeDemo1.pem terrakubeDemo2.pem type
The content of the file type is just the text "ca-certificates"
cnb@terrakube-api-678cb68d5b-ns5gt:/mnt/platform/bindings/ca-certificates$ cat type
ca-certificates
Finally your helm terrakube.yaml should look something like this because we are mounting out CA certs and the file called type in the following path " /mnt/platform/bindings/ca-certificates"
Terrakube allow to add the certs when building the application, to use this option use the following:
git clone https://github.com/AzBuilder/terrakube
cd terrakube
git checkout <<TERRAKUBE-VERSION>>
mv EXAMPLE.pem bindings/ca-certificates
# This script should be run from the root folder
./scripts/build/terrakubeBuild.sh
The certs will be added at runtime as the following image.