Leveraging Harness Secrets to store CA Certificate and Key


Recently I was helping customer to move the CA certs and key to Harness secret, I didn’t realize how time consuming it is to handle the indent and space issue in the yaml manifest file and decided to create this article to ensure other’s need not spend time on similar need going forward.

Use Case

I would like to create an OpenShift Route with CA certificate,Certificate and Key coming from Harness secret. Here is the screenshot how the content looks like

  • Step 1: Store the secret certificate content as encrypted files in harness secret manager

  • Step 2: Create Config files in Harness Service and refer the secret files configured in harness secret manager

  • Step 3: Configure Required go-template in k8s manifest, please note the space & indent values for certificates

  • Step 4: Configure value yaml to pick the values from appropriate service config files

  • Step 5: Run the deployment workflow, the secret must be rendered and added to the route.