Skip to content

Commit 6cb4a67

Browse files
committed
feat: add tlsInsecureSkipVerify to ExternalModel spec
Adds an optional spec.tlsInsecureSkipVerify field to the ExternalModel CRD. When true, the reconciler generates the DestinationRule with insecureSkipVerify: true, allowing connections to endpoints with self-signed certificates without manual patching that gets overwritten on reconciliation. Default is false. Closes #627 Signed-off-by: Brent Salisbury <bsalisbu@redhat.com>
1 parent 4f06bcf commit 6cb4a67

3 files changed

Lines changed: 30 additions & 6 deletions

File tree

deployment/base/maas-controller/crd/bases/maas.opendatahub.io_externalmodels.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,18 @@ spec:
8383
e.g. "openai", "anthropic".
8484
maxLength: 63
8585
type: string
86+
tlsInsecureSkipVerify:
87+
description: |-
88+
TLSInsecureSkipVerify disables TLS certificate verification on the
89+
DestinationRule created for this external model. When true, the generated
90+
Istio DestinationRule includes insecureSkipVerify: true under
91+
trafficPolicy.tls, allowing connections to endpoints with self-signed or
92+
untrusted certificates (e.g., simulators, dev environments).
93+
94+
WARNING: Do not enable in production. This is intended for testing only.
95+
96+
Default: false (certificates are verified).
97+
type: boolean
8698
required:
8799
- credentialRef
88100
- endpoint

maas-controller/api/maas/v1alpha1/externalmodel_types.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ type ExternalModelSpec struct {
4141
// The Secret must contain a data key "api-key" with the credential value.
4242
// +kubebuilder:validation:Required
4343
CredentialRef CredentialReference `json:"credentialRef"`
44+
45+
// TLSInsecureSkipVerify disables TLS certificate verification on the
46+
// DestinationRule created for this external model. When true, the generated
47+
// Istio DestinationRule includes insecureSkipVerify: true under
48+
// trafficPolicy.tls, allowing connections to endpoints with self-signed or
49+
// untrusted certificates (e.g., simulators, dev environments).
50+
//
51+
// WARNING: Do not enable in production. This is intended for testing only.
52+
//
53+
// Default: false (certificates are verified).
54+
// +optional
55+
TLSInsecureSkipVerify bool `json:"tlsInsecureSkipVerify,omitempty"`
4456
}
4557

4658
// ExternalModelStatus defines the observed state of ExternalModel

maas-controller/pkg/reconciler/externalmodel/reconciler.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,12 @@ func specFromExternalModel(extModel *maasv1alpha1.ExternalModel, model *maasv1al
277277
}
278278

279279
spec := ExternalModelSpec{
280-
Provider: extModel.Spec.Provider,
281-
Endpoint: extModel.Spec.Endpoint,
282-
PathPrefix: ann[AnnPathPrefix],
283-
TLS: true,
284-
Port: 443,
285-
// TLSInsecureSkipVerify: extModel.Spec.TLSInsecureSkipVerify, // requires issue #627 CRD change
280+
Provider: extModel.Spec.Provider,
281+
Endpoint: extModel.Spec.Endpoint,
282+
PathPrefix: ann[AnnPathPrefix],
283+
TLS: true,
284+
Port: 443,
285+
TLSInsecureSkipVerify: extModel.Spec.TLSInsecureSkipVerify,
286286
}
287287

288288
if spec.Provider == "" {

0 commit comments

Comments
 (0)