Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The in-process flagd pod does not use the default value of FeatureFlagSource #697

Open
kencharos opened this issue Jul 26, 2024 · 1 comment

Comments

@kencharos
Copy link

Hi, open feature operator is nice tool.
I will report what I have noticed.

version: 0.7.0

I applied following manifest to deploy standalone flagd pod.

---
apiVersion: core.openfeature.dev/v1beta1
kind: FeatureFlagSource
metadata:
  name: sample-sources
  labels:
    app: sample-flags
spec:
  sources:
    - source: test-flag
      provider: kubernetes
---
apiVersion: core.openfeature.dev/v1beta1
kind: Flagd
metadata:
  name: flagd
spec:
  replicas: 1
  serviceType: ClusterIP
  serviceAccountName: default
  featureFlagSource: sample-sources

As a result, flagd pod was generated with no default values used , as shown below.

kubectl describe pod flagd-5f4cfcb898-nwflf
Name:             flagd-5f4cfcb898-nwflf
Namespace:        default
Priority:         0
Service Account:  default
Node:             minikube/192.168.49.2
Start Time:       Fri, 26 Jul 2024 11:20:38 +0900
Labels:           app=flagd-in-process
                  app.kubernetes.io/managed-by=open-feature-operator
                  app.kubernetes.io/name=flagd
                  app.kubernetes.io/version=v0.10.3
                  pod-template-hash=5f4cfcb898
Annotations:      <none>
Status:           Running
IP:               10.244.0.71
IPs:
  IP:           10.244.0.71
Controlled By:  ReplicaSet/flagd-5f4cfcb898
Containers:
  flagd:
    Container ID:    docker://7568edc4a1e1ce366da1579c7da1eee5c93c42354df089e8a6fcfa2870033e0f
    Image:           ghcr.io/open-feature/flagd:v0.10.3
    Image ID:        docker-pullable://ghcr.io/open-feature/flagd@sha256:cc87349925a1643cd3f6e4f894ef6b6b3139712baf78133f3aed70a6b66f69bd
    Ports:           8014/TCP, 8013/TCP, 8016/TCP, 8015/TCP
    Host Ports:      0/TCP, 0/TCP, 0/TCP, 0/TCP
    SeccompProfile:  RuntimeDefault
    Args:
      start
      --management-port
      0
      --sources
      [{"uri":"default/sample-flags","provider":"kubernetes"}]
    State:          Running
      Started:      Fri, 26 Jul 2024 11:20:39 +0900
    Ready:          True
    Restart Count:  0
    Limits:
      cpu:     500m
      memory:  64Mi
    Requests:
      cpu:     200m
      memory:  32Mi
    Environment:
      _MANAGEMENT_PORT:  0
      _PORT:             0
      _EVALUATOR:        
      _LOG_FORMAT:       
      _RESOLVER:         rpc

When creating a pod from a Flagd manifest, the default values listed below do not appear to be used.

https://github.com/open-feature/open-feature-operator/blob/main/apis/core/v1beta1/featureflagsource_types.go

In the current version, the default value must be set explicitly.

apiVersion: core.openfeature.dev/v1beta1
kind: Flagd
metadata:
  name: flagd
spec:
  # Fill default values
  port: 8013
  managementPort: 8014
  envVarPrefix: FLAGD
  replicas: 1
  serviceType: ClusterIP
  serviceAccountName: default
  featureFlagSource: sample-sources

Thanks.

@toddbaert
Copy link
Member

This may have been fixed with some other recent changes since 0.7.0, but I'm not sure. It's definitely a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants