Update coroot operator with new TLS Support configs#44
Conversation
|
Bumped controller-gen to 0.20.1 (latest) in Makefile as 0.16.1 version is not compatible with go 1.25 version Not facing above issue with latest version |
There was a problem hiding this comment.
I ran k3s in ubuntu vm. I have used openssl and created certs and keys. Used this custom resource and deployed coroot to start in TLS mode
I ran make run to test this operator code
|
Hi @def , I have tested these changes and it looks good. Pls review this MR. Also, I need your input for below things.
So, should I add code to remove this or shall we keep it for fallback? |
| // Whether to skip verification of the Coroot server's TLS certificate. | ||
| TLSSkipVerify bool `json:"tlsSkipVerify,omitempty"` | ||
| // Secret containing the CA certificate to verify the Coroot server's certificate. | ||
| CASecret *corev1.SecretKeySelector `json:"caSecret,omitempty"` |
There was a problem hiding this comment.
I feels like we need to configure CASecret in NodeAgentSpec only. I was a wrong decision to configure TLSSkipVerify right here (let's keep it here for back compatibility)
| var caSecret *corev1.SecretKeySelector | ||
| if cr.Spec.AgentsOnly != nil && cr.Spec.AgentsOnly.CorootURL != "" { | ||
| corootURL = cr.Spec.AgentsOnly.CorootURL | ||
| tlsSkipVerify = cr.Spec.AgentsOnly.TLSSkipVerify |
There was a problem hiding this comment.
let's set it to cr.Spec.AgentsOnly.TLSSkipVerify or cr.Spec.NodeAgent.TLS.TLSSkipVerify (if TLS != nil)
| if cr.Spec.AgentsOnly != nil && cr.Spec.AgentsOnly.CorootURL != "" { | ||
| corootURL = cr.Spec.AgentsOnly.CorootURL | ||
| tlsSkipVerify = cr.Spec.AgentsOnly.TLSSkipVerify | ||
| caSecret = cr.Spec.AgentsOnly.CASecret |
There was a problem hiding this comment.
this should be set only from cr.Spec.NodeAgent.TLS
There was a problem hiding this comment.
I think using NodeAgent TLS config inside ClusterAgent would be confusing. This will remove the redundancy and we can just add one CA Secret in NodeAgent Spec but wont it confuse?
There was a problem hiding this comment.
Surely we need to keep both: one for NodeAgent, another for ClusterAgent. I meant AgentsOnly should contain only the Coroot URL. Other agent configuration (such as resource requests/limits) should come from NodeAgent and ClusterAgent, so it would be good to have TLS configs in those sections as well.
| if cr.Spec.Service.HTTPSPort != 0 { | ||
| env = append(env, corev1.EnvVar{Name: "HTTPS_LISTEN", Value: httpsListen}) | ||
| _, port, _ := strings.Cut(httpsListen, ":") | ||
| p, _ := resource.ParseQuantity(port) |
There was a problem hiding this comment.
i'm not sure that using resource.ParseQuantity is necessary
| tlsSkipVerify = cr.Spec.AgentsOnly.TLSSkipVerify | ||
| caSecret = cr.Spec.AgentsOnly.CASecret |
There was a problem hiding this comment.
Let's add this only if !cr.Spec.HTTPDisabled ?
There was a problem hiding this comment.
Added in b9ad4a0 with other related ingress changes
|
Hi @def , let me know if any other changes are required. |
|
@vishnukumarkvs thank you, and apologies for the delay on my end |

Adding TLS configurations to coroot operator which we already support now for coroot components in latest releases