Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions infra/feast-operator/internal/controller/services/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -922,11 +922,13 @@ func (feast *FeastServices) setInitContainer(podSpec *corev1.PodSpec, fsYamlB64
}

// getServiceAppProtocol returns the appProtocol for a Service port.
// The registry gRPC service uses the gRPC protocol, which requires HTTP/2.
// Setting appProtocol allows service meshes (e.g. Istio) and load balancers
// to correctly classify the traffic and avoid downgrading to HTTP/1.1.
// The registry gRPC service and the offline (Arrow Flight) service use the gRPC
// protocol, which requires HTTP/2. Setting appProtocol allows service meshes
// (e.g. Istio) and load balancers to correctly classify the traffic and avoid
// downgrading to HTTP/1.1.
func (feast *FeastServices) getServiceAppProtocol(feastType FeastServiceType, isRestService bool) *string {
if feastType == RegistryFeastType && !isRestService && feast.isRegistryGrpcEnabled() {
if (feastType == RegistryFeastType && !isRestService && feast.isRegistryGrpcEnabled()) ||
feastType == OfflineFeastType {
return ptr.To("grpc")
}
return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -857,8 +857,8 @@ var _ = Describe("Service AppProtocol Configuration", func() {
Expect(feast.getServiceAppProtocol(OnlineFeastType, false)).To(BeNil())
})

It("should return nil appProtocol for the offline store service", func() {
Expect(feast.getServiceAppProtocol(OfflineFeastType, false)).To(BeNil())
It("should return grpc appProtocol for the offline store service", func() {
Expect(feast.getServiceAppProtocol(OfflineFeastType, false)).To(Equal(ptr.To("grpc")))
})

It("should return nil appProtocol when registry gRPC is disabled", func() {
Expand Down Expand Up @@ -896,6 +896,28 @@ var _ = Describe("Service AppProtocol Configuration", func() {
Expect(restSvc.Spec.Ports).To(HaveLen(1))
Expect(restSvc.Spec.Ports[0].AppProtocol).To(BeNil())
})

It("should set grpc appProtocol on the offline Service port", func() {
featureStore.Spec.Services.OfflineStore = &feastdevv1.OfflineStore{
Server: &feastdevv1.ServerConfigs{
ContainerConfigs: feastdevv1.ContainerConfigs{
DefaultCtrConfigs: feastdevv1.DefaultCtrConfigs{
Image: ptr.To("test-image"),
},
},
},
}
Expect(k8sClient.Update(ctx, featureStore)).To(Succeed())
Expect(feast.ApplyDefaults()).To(Succeed())
applySpecToStatus(featureStore)

svc := feast.initFeastSvc(OfflineFeastType)
Expect(svc).NotTo(BeNil())
Expect(feast.setService(svc, OfflineFeastType, false)).To(Succeed())

Expect(svc.Spec.Ports).To(HaveLen(1))
Expect(svc.Spec.Ports[0].AppProtocol).To(Equal(ptr.To("grpc")))
})
})

var _ = Describe("Pod Container Failure Messages", func() {
Expand Down
Loading