Skip to content

Commit 439e0b9

Browse files
authored
fix: Remove grpcurl dependency from Operator (feast-dev#4972)
remove grpcurl dependency Signed-off-by: Tommy Hughes <[email protected]>
1 parent 72d3247 commit 439e0b9

File tree

9 files changed

+8
-55
lines changed

9 files changed

+8
-55
lines changed

infra/feast-operator/config/default/kustomization.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ patches:
3333
- path: related_image_fs_patch.yaml
3434
target:
3535
kind: Deployment
36-
- path: related_image_grpc_patch.yaml
37-
target:
38-
kind: Deployment
3936
# Uncomment the patches line if you enable Metrics, and/or are using webhooks and cert-manager
4037
# [METRICS] The following patch will enable the metrics endpoint using HTTPS and the port :8443.
4138
# More info: https://book.kubebuilder.io/reference/metrics

infra/feast-operator/config/default/related_image_grpc_patch.yaml

-5
This file was deleted.

infra/feast-operator/config/manager/manager.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ spec:
7373
env:
7474
- name: RELATED_IMAGE_FEATURE_SERVER
7575
value: feast:latest
76-
- name: RELATED_IMAGE_GRPC_CURL
77-
value: grpc:latest
7876
livenessProbe:
7977
httpGet:
8078
path: /healthz

infra/feast-operator/dist/install.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -4184,8 +4184,6 @@ spec:
41844184
env:
41854185
- name: RELATED_IMAGE_FEATURE_SERVER
41864186
value: docker.io/feastdev/feature-server:0.43.0
4187-
- name: RELATED_IMAGE_GRPC_CURL
4188-
value: docker.io/fullstorydev/grpcurl:v1.9.1-alpine
41894187
image: feastdev/feast-operator:0.43.0
41904188
livenessProbe:
41914189
httpGet:

infra/feast-operator/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ go 1.22.9
55
require (
66
github.com/onsi/ginkgo/v2 v2.17.1
77
github.com/onsi/gomega v1.32.0
8+
github.com/openshift/api v0.0.0-20240912201240-0a8800162826 // release-4.17
89
gopkg.in/yaml.v3 v3.0.1
910
k8s.io/api v0.30.1
1011
k8s.io/apimachinery v0.30.1
@@ -48,7 +49,6 @@ require (
4849
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
4950
github.com/modern-go/reflect2 v1.0.2 // indirect
5051
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
51-
github.com/openshift/api v0.0.0-20240912201240-0a8800162826 // indirect
5252
github.com/pkg/errors v0.9.1 // indirect
5353
github.com/prometheus/client_golang v1.18.0 // indirect
5454
github.com/prometheus/client_model v0.5.0 // indirect

infra/feast-operator/internal/controller/featurestore_controller_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ var _ = Describe("FeatureStore Controller", func() {
10211021
Namespace: objMeta.Namespace,
10221022
}, deploy)
10231023
Expect(err).NotTo(HaveOccurred())
1024-
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(2))
1024+
Expect(deploy.Spec.Template.Spec.InitContainers).To(HaveLen(1))
10251025

10261026
// check client config
10271027
cm := &corev1.ConfigMap{}

infra/feast-operator/internal/controller/services/services.go

+1-25
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func (feast *FeastServices) ApplyDefaults() error {
5252
// Deploy the feast services
5353
func (feast *FeastServices) Deploy() error {
5454
if feast.noLocalServiceConfigured() {
55-
return errors.New("At least one local service must be configured. e.g. registry / online / offline.")
55+
return errors.New("at least one local service must be configured. e.g. registry / online / offline")
5656
}
5757
openshiftTls, err := feast.checkOpenshiftTls()
5858
if err != nil {
@@ -349,7 +349,6 @@ func (feast *FeastServices) setPod(podSpec *corev1.PodSpec) error {
349349
if err := feast.setContainers(podSpec); err != nil {
350350
return err
351351
}
352-
feast.setRegistryClientInitContainer(podSpec)
353352
feast.mountTlsConfigs(podSpec)
354353
feast.mountPvcConfigs(podSpec)
355354
feast.mountEmptyDirVolumes(podSpec)
@@ -506,29 +505,6 @@ func (feast *FeastServices) setInitContainer(podSpec *corev1.PodSpec, fsYamlB64
506505
}
507506
}
508507

509-
// add grpc init container if remote registry reference (feastRef) is configured
510-
func (feast *FeastServices) setRegistryClientInitContainer(podSpec *corev1.PodSpec) {
511-
if !feast.Handler.FeatureStore.Status.Applied.Services.DisableInitContainers {
512-
hostname := feast.Handler.FeatureStore.Status.ServiceHostnames.Registry
513-
if len(hostname) > 0 && feast.IsRemoteRefRegistry() {
514-
grpcurlFlag := "-plaintext"
515-
hostSplit := strings.Split(hostname, ":")
516-
if len(hostSplit) > 1 && hostSplit[1] == "443" {
517-
grpcurlFlag = "-insecure"
518-
}
519-
podSpec.InitContainers = append(podSpec.InitContainers, corev1.Container{
520-
Name: "init-registry",
521-
Image: getGrpcCurlImage(),
522-
Command: []string{
523-
"sh", "-c",
524-
"until grpcurl -H \"authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)\" " +
525-
grpcurlFlag + " -d '' -format text " + hostname + " grpc.health.v1.Health/Check; do echo waiting for registry; sleep 2; done",
526-
},
527-
})
528-
}
529-
}
530-
}
531-
532508
func (feast *FeastServices) setService(svc *corev1.Service, feastType FeastServiceType) error {
533509
svc.Labels = feast.getFeastTypeLabels(feastType)
534510
if feast.isOpenShiftTls(feastType) {

infra/feast-operator/internal/controller/services/services_types.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,8 @@ import (
2525
)
2626

2727
const (
28-
feastServerImageVar = "RELATED_IMAGE_FEATURE_SERVER"
29-
grpcCurlImageVar = "RELATED_IMAGE_GRPC_CURL"
30-
grpcCurlImage = "fullstorydev/grpcurl:v1.9.1-alpine"
31-
3228
TmpFeatureStoreYamlEnvVar = "TMP_FEATURE_STORE_YAML_BASE64"
29+
feastServerImageVar = "RELATED_IMAGE_FEATURE_SERVER"
3330
FeatureStoreYamlCmKey = "feature_store.yaml"
3431
EphemeralPath = "/feast-data"
3532
FeatureRepoDir = "/feature_repo"

infra/feast-operator/internal/controller/services/util.go

+4-12
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
feastdevv1alpha1 "github.com/feast-dev/feast/infra/feast-operator/api/v1alpha1"
1212
appsv1 "k8s.io/api/apps/v1"
1313
corev1 "k8s.io/api/core/v1"
14-
v1 "k8s.io/api/core/v1"
1514
apierrors "k8s.io/apimachinery/pkg/api/errors"
1615
"k8s.io/apimachinery/pkg/api/resource"
1716
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -182,26 +181,19 @@ func getFeatureServerImage() string {
182181
return DefaultImage
183182
}
184183

185-
func getGrpcCurlImage() string {
186-
if img, exists := os.LookupEnv(grpcCurlImageVar); exists {
187-
return img
188-
}
189-
return grpcCurlImage
190-
}
191-
192184
func checkOfflineStoreFilePersistenceType(value string) error {
193185
if slices.Contains(feastdevv1alpha1.ValidOfflineStoreFilePersistenceTypes, value) {
194186
return nil
195187
}
196188
return fmt.Errorf("invalid file type %s for offline store", value)
197189
}
198190

199-
func ensureRequestedStorage(resources *v1.VolumeResourceRequirements, requestedStorage string) {
191+
func ensureRequestedStorage(resources *corev1.VolumeResourceRequirements, requestedStorage string) {
200192
if resources.Requests == nil {
201-
resources.Requests = v1.ResourceList{}
193+
resources.Requests = corev1.ResourceList{}
202194
}
203-
if _, ok := resources.Requests[v1.ResourceStorage]; !ok {
204-
resources.Requests[v1.ResourceStorage] = resource.MustParse(requestedStorage)
195+
if _, ok := resources.Requests[corev1.ResourceStorage]; !ok {
196+
resources.Requests[corev1.ResourceStorage] = resource.MustParse(requestedStorage)
205197
}
206198
}
207199

0 commit comments

Comments
 (0)