Harness GitOps Agent with self-signed certificates
This topic describes how to install and configure Harness GitOps Agent to connect to Harness with self-signed certificates.
Harness supports self-signed certificates. This topic describes how to install and configure a Harness GitOps Agent to connect to Harness using self-signed certificates.
In this topic, you will do the following:
Create a Kubernetes secret with your certificates.
Configure the GitOps Agent to use the custom certificates.
Create the secret
Create a Kubernetes secret containing your self-signed certificates in the same namespace where the GitOps Agent is installed.
Copy the following YAML to your editor.
apiVersion: v1 kind: Secret metadata: name: addcerts namespace: {agent-namespace} type: Opaque stringData: ca.bundle: | -----BEGIN CERTIFICATE----- XXXXXXXXXXXXXXXXXXXXXXXXXXX -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- XXXXXXXXXXXXXXXXXXXXXXXXXXX -----END CERTIFICATE-----Replace
{agent-namespace}with the namespace where your GitOps Agent is installed.Add your certificates to the
ca.bundlefield.The
XXXXXXXXXXXXXXXXXXXXXXXXXXXplaceholder indicates the position for the certificate body. Enclose each certificate between-----BEGIN CERTIFICATE-----and-----END CERTIFICATE-----markers.Here is one way to get the certificate using
openssl:openssl s_client -servername NAME -connect HOST:PORTFor example, to get the certificate for app.harness.io:
openssl s_client -servername app.harness.io -connect app.harness.io:443Save the file as
addcerts.yaml, then apply the manifest to your cluster.kubectl apply -f addcerts.yaml -n {agent-namespace}
Configure the GitOps Agent
Configure the GitOps Agent to mount and use the custom certificates based on your installation method.
To configure a GitOps Agent installed with Kubernetes manifests to use custom certificates, do the following:
Open the
gitops-agent.ymlfile in your editor.In the
{GitopsAgentName}-agentConfigMap, set the value ofGITOPS_SERVICE_HTTP_TLS_ENABLEDconfig totrue.Save and apply the modified manifest.
To configure a GitOps Agent installed with Helm to use custom certificates, do the following:
Modify the
values.yamlfile and add thevolumesandvolumeMountssection to theagentfield.Set the
GITOPS_SERVICE_HTTP_TLS_ENABLEDflag totrueby setting theharness.configMap.http.tlsEnabledoption in thevalues.yamlfile totrue.If certificates are required to be mounted onto the Argo CD Repo Server and Application Controller, add the following configurations in the
values.yamlfile.Repo Server:
Application Controller:
Apply the Helm chart with the updated values.
Verify certificate configuration
After configuring the GitOps Agent with self-signed certificates, verify that the certificate is properly mounted and the agent can connect to Harness.
Check if the agent pod is running.
Verify the certificate file is mounted in the agent pod.
You should see the certificate file at
/tmp/ca.bundle.Check the agent logs to confirm TLS is enabled and the certificate is being used.
Look for log entries indicating that TLS is enabled and certificates are loaded.
Verify the agent is connected in the Harness UI.
Go to GitOps → Settings → GitOps Agents and confirm that your agent shows a Connected status.
Last updated
Was this helpful?