19 Dec 2024 09:27 PM
I'm currently trying to set up an EdgeConnect resource in my AWS EKS cluster using the following instructions:
- Initial Kubernetes RBAC Setup
- Deploying EdgeConnect Via Dynatrace Operator
My current Operator is on the latest version, and I can confirm the needed CRDs are available in my cluster. When deploying as the instructions describe, my Operator spits out the following log message when calling my Dynatrace instance's API:
tls: failed to verify certificate: x509: certificate signed by unknown authority
At this point, I assumed according to the listed parameters here that I would need to put the proper cacert into a Kubernetes configmap in my cluster that the EdgeConnect yaml would reference. Still, the same message occurs in my Operator's logs.
At this point, I've not only tried my organization's root cert by itself in the configmap, but I've also tried using a number of cacerts used by my organization all together in the configmap at the "certs" directory as described. It's important to note in this configmap that all the certs I've used can be found at the "certs" directory, following each other in pem file format like so...
-----BEGIN CERTIFICATE-----
{CERT1 INFO HERE}
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
{CERT2 HERE}
-----END CERTIFICATE-----
And so on...
Regardless of what I try, it seems that I still get the same message.
For anyone who has attempted to do this setup, what have I gotten wrong here? Do each of these certs need a separate key/value pair in the configmap under the "certs" directory, or would pem format under "certs" be desired here?
I also noticed in Workflows where I would run the Kubernetes automation I'm trying to do, an EdgeConnect connection has to be built, which includes the token of the service account created in the RBAC setup. Have I misunderstood these instructions and that service account token decoded as a cacert is what needs to be put into this configmap?
I'm at a bit of a loss here, so any help is appreciated. Thanks in advance!
20 Dec 2024 01:10 PM - edited 20 Dec 2024 01:10 PM
Hello @calogajac
Thanks for illustration, PFA comment:
Hoping it helps.
BR,
Peter
20 Dec 2024 05:15 PM
@Peter_Youssef Thanks for the response and thanks for confirming some of my setup. Something that I wanted to note that I wasn't specific about to your second bullet point is that the EdgeConnect has not ever gotten to a point where a pod is deployed/provisioned with this configuration. When deploying this setup as described in the documentation, the EdgeConnect custom resource that gets put into my cluster goes into an Error state, which corresponds to the logs I get off of my Dynatrace Operator about there being an issue with calling out to the EdgeConnect API endpoint. As a result, the configmap isn't getting mounted as there is no pod being deployed.
This may be a bit of a silly question, but when they refer to "directories" in a configmap within this documentation, are they simply talking about using a key called "certs" within the data section of the configmap? Perhaps I have my configmap set up wrong and it cannot get to the certs because of the setup of my configmap?
20 Dec 2024 05:27 PM
Hi @calogajac
We can also check the below factors:
The ConfigMap Reference in the YAML:
yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: edgeconnect-ca-bundle
data:
certs: |
-----BEGIN CERTIFICATE-----
{CERT1 INFO HERE}
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
{CERT2 INFO HERE}
-----END CERTIFICATE-----
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: dynatrace-operator
spec:
template:
spec:
volumes:
- name: ca-bundle
configMap:
name: edgeconnect-ca-bundle
containers:
- name: dynatrace-operator
volumeMounts:
- mountPath: /etc/ssl/certs
name: ca-bundle
assuming the operator is configured to use the CA bundle at /etc/ssl/certs.
Remarks:
Through the Correct Path for the Certificates:
CA Bundle Format:
-----BEGIN CERTIFICATE
----- and -----
END CERTIFICATE-----.
Hoping it helps addressing the highlighted issue.
BR,
Peter
20 Dec 2024 05:32 PM
Hi @calogajac
Regarding the certificate conversion, feel free to utilize the attached resource:
BR,
Peter
20 Dec 2024 06:01 PM
Hello @calogajac
As far as I've understood from your inputs, kindly find the below clarification:
Service Account Token:
On the other hand
CA Certificate:
Kindly Verify TLS with openssl or curl:
Via bash:
Tip:
As an attempt: (assuming CA certificates are in /etc/ssl/certs)
yaml
spec:
containers:
- name: dynatrace-operator
args:
- --tls-ca-file=/etc/ssl/certs/ca.crt
Last factor to consider checking:
Hoping it helps.
KR,
Peter
20 Dec 2024 01:26 PM - edited 20 Dec 2024 01:27 PM
Regarding the certificate:
Make sure the Certificate configurations are correct:
Single PEM Format for the CA Bundle:
While putting multiple certificates into the certs directory of the ConfigMap, they should be concatenated into a single file.
it means you should not split them into separate key/value pairs in the ConfigMap, but rather ensure all certificates are in a single PEM file format, like so:
20 Dec 2024 06:05 PM
Hello @calogajac
PFA references:
Hoping it assist addressing the highlighted concern.
BR,
Peter