diff --git a/PROJECT b/PROJECT index aaaa4457a..face2ff62 100644 --- a/PROJECT +++ b/PROJECT @@ -43,4 +43,20 @@ resources: kind: FlagSourceConfiguration path: github.com/open-feature/open-feature-operator/apis/core/v1alpha3 version: v1alpha3 +- api: + crdVersion: v1 + namespaced: true + domain: openfeature.dev + group: core + kind: FeatureFlag + path: github.com/open-feature/open-feature-operator/apis/core/v1beta1 + version: v1beta1 +- api: + crdVersion: v1 + namespaced: true + domain: openfeature.dev + group: core + kind: FeatureFlagSource + path: github.com/open-feature/open-feature-operator/apis/core/v1beta1 + version: v1beta1 version: "3" diff --git a/apis/core/v1beta1/common.go b/apis/core/v1beta1/common.go new file mode 100644 index 000000000..c67656d3c --- /dev/null +++ b/apis/core/v1beta1/common.go @@ -0,0 +1,11 @@ +package v1beta1 + +type SyncProviderType string + +const ( + SyncProviderKubernetes SyncProviderType = "kubernetes" + SyncProviderFilepath SyncProviderType = "file" + SyncProviderHttp SyncProviderType = "http" + SyncProviderGrpc SyncProviderType = "grpc" + SyncProviderFlagdProxy SyncProviderType = "flagd-proxy" +) diff --git a/apis/core/v1beta1/featureflag_types.go b/apis/core/v1beta1/featureflag_types.go new file mode 100644 index 000000000..ee327fb8d --- /dev/null +++ b/apis/core/v1beta1/featureflag_types.go @@ -0,0 +1,85 @@ +/* +Copyright 2022. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "encoding/json" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// FeatureFlagSpec defines the desired state of FeatureFlag +type FeatureFlagSpec struct { + // FlagSpec is the structured representation of the feature flag specification + FlagSpec FlagSpec `json:"flagSpec,omitempty"` +} + +type FlagSpec struct { + Flags map[string]Flag `json:"flags"` + // +optional + // +kubebuilder:validation:Schemaless + // +kubebuilder:pruning:PreserveUnknownFields + // +kubebuilder:validation:Type=object + Evaluators json.RawMessage `json:"$evaluators,omitempty"` +} + +type Flag struct { + // +kubebuilder:validation:Enum=ENABLED;DISABLED + State string `json:"state"` + // +kubebuilder:validation:Schemaless + // +kubebuilder:pruning:PreserveUnknownFields + // +kubebuilder:validation:Type=object + Variants json.RawMessage `json:"variants"` + DefaultVariant string `json:"defaultVariant"` + // +optional + // +kubebuilder:validation:Schemaless + // +kubebuilder:pruning:PreserveUnknownFields + // +kubebuilder:validation:Type=object + // Targeting is the json targeting rule + Targeting json.RawMessage `json:"targeting,omitempty"` +} + +// FeatureFlagStatus defines the observed state of FeatureFlag +type FeatureFlagStatus struct { +} + +// TODO change to `ff` when v1alpha* is removed +//+kubebuilder:resource:shortName="ffc" +//+kubebuilder:object:root=true +//+kubebuilder:subresource:status + +// FeatureFlag is the Schema for the featureflags API +type FeatureFlag struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec FeatureFlagSpec `json:"spec,omitempty"` + Status FeatureFlagStatus `json:"status,omitempty"` +} + +//+kubebuilder:object:root=true + +// FeatureFlagList contains a list of FeatureFlag +type FeatureFlagList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []FeatureFlag `json:"items"` +} + +func init() { + SchemeBuilder.Register(&FeatureFlag{}, &FeatureFlagList{}) +} diff --git a/apis/core/v1beta1/featureflagsource_types.go b/apis/core/v1beta1/featureflagsource_types.go new file mode 100644 index 000000000..bbb6bebf9 --- /dev/null +++ b/apis/core/v1beta1/featureflagsource_types.go @@ -0,0 +1,174 @@ +/* +Copyright 2022. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// FeatureFlagSourceSpec defines the desired state of FeatureFlagSource +type FeatureFlagSourceSpec struct { + // MetricsPort defines the port to serve metrics on, defaults to 8014 + // +optional + MetricsPort int32 `json:"metricsPort"` + + // Port defines the port to listen on, defaults to 8013 + // +optional + Port int32 `json:"port"` + + // SocketPath defines the unix socket path to listen on + // +optional + SocketPath string `json:"socketPath"` + + // Evaluator sets an evaluator, defaults to 'json' + // +optional + Evaluator string `json:"evaluator"` + + // Image allows for the sidecar image to be overridden, defaults to 'ghcr.io/open-feature/flagd' + // +optional + Image string `json:"image"` + + // Tag to be appended to the sidecar image, defaults to 'main' + // +optional + Tag string `json:"tag"` + + // SyncProviders define the syncProviders and associated configuration to be applied to the sidecar + // +kubebuilder:validation:MinItems=1 + Sources []Source `json:"sources"` + + // EnvVars define the env vars to be applied to the sidecar, any env vars in FeatureFlagConfiguration CRs + // are added at the lowest index, all values will have the EnvVarPrefix applied, default FLAGD + // +optional + EnvVars []corev1.EnvVar `json:"envVars"` + + // SyncProviderArgs are string arguments passed to all sync providers, defined as key values separated by = + // +optional + SyncProviderArgs []string `json:"syncProviderArgs"` + + // DefaultSyncProvider defines the default sync provider + // +optional + DefaultSyncProvider SyncProviderType `json:"defaultSyncProvider"` + + // LogFormat allows for the sidecar log format to be overridden, defaults to 'json' + // +optional + LogFormat string `json:"logFormat"` + + // EnvVarPrefix defines the prefix to be applied to all environment variables applied to the sidecar, default FLAGD + // +optional + EnvVarPrefix string `json:"envVarPrefix"` + + // RolloutOnChange dictates whether annotated deployments will be restarted when configuration changes are + // detected in this CR, defaults to false + // +optional + RolloutOnChange *bool `json:"rolloutOnChange"` + + // ProbesEnabled defines whether to enable liveness and readiness probes of flagd sidecar. Default true (enabled). + // +optional + ProbesEnabled *bool `json:"probesEnabled"` + + // DebugLogging defines whether to enable --debug flag of flagd sidecar. Default false (disabled). + // +optional + DebugLogging *bool `json:"debugLogging"` + + // OtelCollectorUri defines whether to enable --otel-collector-uri flag of flagd sidecar. Default false (disabled). + // +optional + OtelCollectorUri string `json:"otelCollectorUri"` + + // Resources defines flagd sidecar resources. Default to operator sidecar-cpu-* and sidecar-ram-* flags. + // +optional + Resources corev1.ResourceRequirements `json:"resources"` +} + +type Source struct { + // Source is a URI of the flag sources + Source string `json:"source"` + + // Provider type - kubernetes, http(s), grpc(s) or filepath + // +optional + Provider SyncProviderType `json:"provider"` + + // HttpSyncBearerToken is a bearer token. Used by http(s) sync provider only + // +optional + HttpSyncBearerToken string `json:"httpSyncBearerToken"` + + // TLS - Enable/Disable secure TLS connectivity. Currently used only by GRPC sync + // +optional + TLS bool `json:"tls"` + + // CertPath is a path of a certificate to be used by grpc TLS connection + // +optional + CertPath string `json:"certPath"` + + // ProviderID is an identifier to be used in grpc provider + // +optional + ProviderID string `json:"providerID"` + + // Selector is a flag configuration selector used by grpc provider + // +optional + Selector string `json:"selector,omitempty"` +} + +// FeatureFlagSourceStatus defines the observed state of FeatureFlagSource +type FeatureFlagSourceStatus struct { +} + +//+kubebuilder:resource:shortName="ffs" +//+kubebuilder:object:root=true +//+kubebuilder:subresource:status + +// FeatureFlagSource is the Schema for the FeatureFlagSources API +type FeatureFlagSource struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec FeatureFlagSourceSpec `json:"spec,omitempty"` + Status FeatureFlagSourceStatus `json:"status,omitempty"` +} + +//+kubebuilder:object:root=true + +// FeatureFlagSourceList contains a list of FeatureFlagSource +type FeatureFlagSourceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []FeatureFlagSource `json:"items"` +} + +func init() { + SchemeBuilder.Register(&FeatureFlagSource{}, &FeatureFlagSourceList{}) +} + +func (s SyncProviderType) IsKubernetes() bool { + return s == SyncProviderKubernetes +} + +func (s SyncProviderType) IsHttp() bool { + return s == SyncProviderHttp +} + +func (s SyncProviderType) IsFilepath() bool { + return s == SyncProviderFilepath +} + +func (s SyncProviderType) IsGrpc() bool { + return s == SyncProviderGrpc +} + +func (s SyncProviderType) IsFlagdProxy() bool { + return s == SyncProviderFlagdProxy +} diff --git a/apis/core/v1beta1/featureflagsource_types_test.go b/apis/core/v1beta1/featureflagsource_types_test.go new file mode 100644 index 000000000..a719871d4 --- /dev/null +++ b/apis/core/v1beta1/featureflagsource_types_test.go @@ -0,0 +1,24 @@ +package v1beta1 + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func Test_FeatureFlagSource_SyncProvider(t *testing.T) { + k := SyncProviderKubernetes + f := SyncProviderFilepath + h := SyncProviderHttp + g := SyncProviderGrpc + + require.True(t, k.IsKubernetes()) + require.True(t, f.IsFilepath()) + require.True(t, h.IsHttp()) + require.True(t, g.IsGrpc()) + + require.False(t, f.IsKubernetes()) + require.False(t, h.IsFilepath()) + require.False(t, k.IsGrpc()) + require.False(t, g.IsHttp()) +} diff --git a/apis/core/v1beta1/groupversion_info.go b/apis/core/v1beta1/groupversion_info.go new file mode 100644 index 000000000..53ceff093 --- /dev/null +++ b/apis/core/v1beta1/groupversion_info.go @@ -0,0 +1,36 @@ +/* +Copyright 2022. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package v1beta1 contains API Schema definitions for the core v1beta1 API group +//+kubebuilder:object:generate=true +//+groupName=core.openfeature.dev +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects + GroupVersion = schema.GroupVersion{Group: "core.openfeature.dev", Version: "v1beta1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/apis/core/v1beta1/zz_generated.deepcopy.go b/apis/core/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 000000000..3c111fcc8 --- /dev/null +++ b/apis/core/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,307 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright 2022. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "encoding/json" + "k8s.io/api/core/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeatureFlag) DeepCopyInto(out *FeatureFlag) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureFlag. +func (in *FeatureFlag) DeepCopy() *FeatureFlag { + if in == nil { + return nil + } + out := new(FeatureFlag) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FeatureFlag) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeatureFlagList) DeepCopyInto(out *FeatureFlagList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]FeatureFlag, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureFlagList. +func (in *FeatureFlagList) DeepCopy() *FeatureFlagList { + if in == nil { + return nil + } + out := new(FeatureFlagList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FeatureFlagList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeatureFlagSource) DeepCopyInto(out *FeatureFlagSource) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureFlagSource. +func (in *FeatureFlagSource) DeepCopy() *FeatureFlagSource { + if in == nil { + return nil + } + out := new(FeatureFlagSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FeatureFlagSource) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeatureFlagSourceList) DeepCopyInto(out *FeatureFlagSourceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]FeatureFlagSource, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureFlagSourceList. +func (in *FeatureFlagSourceList) DeepCopy() *FeatureFlagSourceList { + if in == nil { + return nil + } + out := new(FeatureFlagSourceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FeatureFlagSourceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeatureFlagSourceSpec) DeepCopyInto(out *FeatureFlagSourceSpec) { + *out = *in + if in.Sources != nil { + in, out := &in.Sources, &out.Sources + *out = make([]Source, len(*in)) + copy(*out, *in) + } + if in.EnvVars != nil { + in, out := &in.EnvVars, &out.EnvVars + *out = make([]v1.EnvVar, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SyncProviderArgs != nil { + in, out := &in.SyncProviderArgs, &out.SyncProviderArgs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.RolloutOnChange != nil { + in, out := &in.RolloutOnChange, &out.RolloutOnChange + *out = new(bool) + **out = **in + } + if in.ProbesEnabled != nil { + in, out := &in.ProbesEnabled, &out.ProbesEnabled + *out = new(bool) + **out = **in + } + if in.DebugLogging != nil { + in, out := &in.DebugLogging, &out.DebugLogging + *out = new(bool) + **out = **in + } + in.Resources.DeepCopyInto(&out.Resources) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureFlagSourceSpec. +func (in *FeatureFlagSourceSpec) DeepCopy() *FeatureFlagSourceSpec { + if in == nil { + return nil + } + out := new(FeatureFlagSourceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeatureFlagSourceStatus) DeepCopyInto(out *FeatureFlagSourceStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureFlagSourceStatus. +func (in *FeatureFlagSourceStatus) DeepCopy() *FeatureFlagSourceStatus { + if in == nil { + return nil + } + out := new(FeatureFlagSourceStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeatureFlagSpec) DeepCopyInto(out *FeatureFlagSpec) { + *out = *in + in.FlagSpec.DeepCopyInto(&out.FlagSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureFlagSpec. +func (in *FeatureFlagSpec) DeepCopy() *FeatureFlagSpec { + if in == nil { + return nil + } + out := new(FeatureFlagSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeatureFlagStatus) DeepCopyInto(out *FeatureFlagStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureFlagStatus. +func (in *FeatureFlagStatus) DeepCopy() *FeatureFlagStatus { + if in == nil { + return nil + } + out := new(FeatureFlagStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Flag) DeepCopyInto(out *Flag) { + *out = *in + if in.Variants != nil { + in, out := &in.Variants, &out.Variants + *out = make(json.RawMessage, len(*in)) + copy(*out, *in) + } + if in.Targeting != nil { + in, out := &in.Targeting, &out.Targeting + *out = make(json.RawMessage, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Flag. +func (in *Flag) DeepCopy() *Flag { + if in == nil { + return nil + } + out := new(Flag) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FlagSpec) DeepCopyInto(out *FlagSpec) { + *out = *in + if in.Flags != nil { + in, out := &in.Flags, &out.Flags + *out = make(map[string]Flag, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Evaluators != nil { + in, out := &in.Evaluators, &out.Evaluators + *out = make(json.RawMessage, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlagSpec. +func (in *FlagSpec) DeepCopy() *FlagSpec { + if in == nil { + return nil + } + out := new(FlagSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Source) DeepCopyInto(out *Source) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Source. +func (in *Source) DeepCopy() *Source { + if in == nil { + return nil + } + out := new(Source) + in.DeepCopyInto(out) + return out +} diff --git a/config/crd/bases/core.openfeature.dev_featureflagconfigurations.yaml b/config/crd/bases/core.openfeature.dev_featureflagconfigurations.yaml index dfb0ed59d..a615e49c5 100644 --- a/config/crd/bases/core.openfeature.dev_featureflagconfigurations.yaml +++ b/config/crd/bases/core.openfeature.dev_featureflagconfigurations.yaml @@ -442,6 +442,54 @@ spec: type: object type: array type: object + resources: + description: Resources defines flagd sidecar resources. Default to + operator sidecar-cpu-* and sidecar-ram-* flags. + properties: + claims: + description: "Claims lists the names of resources, defined in + spec.resourceClaims, that are used by this container. \n This + is an alpha field and requires enabling the DynamicResourceAllocation + feature gate. \n This field is immutable. It can only be set + for containers." + items: + description: ResourceClaim references one entry in PodSpec.ResourceClaims. + properties: + name: + description: Name must match the name of one entry in pod.spec.resourceClaims + of the Pod where this field is used. It makes that resource + available inside a container. + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute resources + allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes the minimum amount of compute + resources required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, otherwise + to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + type: object serviceProvider: description: 'ServiceProvider [DEPRECATED]: superseded by FlagSourceConfiguration' nullable: true diff --git a/config/crd/bases/core.openfeature.dev_featureflags.yaml b/config/crd/bases/core.openfeature.dev_featureflags.yaml new file mode 100644 index 000000000..c87e5ae7b --- /dev/null +++ b/config/crd/bases/core.openfeature.dev_featureflags.yaml @@ -0,0 +1,81 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.10.0 + creationTimestamp: null + name: featureflags.core.openfeature.dev +spec: + group: core.openfeature.dev + names: + kind: FeatureFlag + listKind: FeatureFlagList + plural: featureflags + shortNames: + - ffc + singular: featureflag + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + description: FeatureFlag is the Schema for the featureflags API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: FeatureFlagSpec defines the desired state of FeatureFlag + properties: + flagSpec: + description: FlagSpec is the structured representation of the feature + flag specification + properties: + $evaluators: + type: object + x-kubernetes-preserve-unknown-fields: true + flags: + additionalProperties: + properties: + defaultVariant: + type: string + state: + enum: + - ENABLED + - DISABLED + type: string + targeting: + description: Targeting is the json targeting rule + type: object + x-kubernetes-preserve-unknown-fields: true + variants: + type: object + x-kubernetes-preserve-unknown-fields: true + required: + - defaultVariant + - state + - variants + type: object + type: object + required: + - flags + type: object + type: object + status: + description: FeatureFlagStatus defines the observed state of FeatureFlag + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/config/crd/bases/core.openfeature.dev_featureflagsources.yaml b/config/crd/bases/core.openfeature.dev_featureflagsources.yaml new file mode 100644 index 000000000..1324cfed2 --- /dev/null +++ b/config/crd/bases/core.openfeature.dev_featureflagsources.yaml @@ -0,0 +1,303 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.10.0 + creationTimestamp: null + name: featureflagsources.core.openfeature.dev +spec: + group: core.openfeature.dev + names: + kind: FeatureFlagSource + listKind: FeatureFlagSourceList + plural: featureflagsources + shortNames: + - ffs + singular: featureflagsource + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + description: FeatureFlagSource is the Schema for the FeatureFlagSources API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: FeatureFlagSourceSpec defines the desired state of FeatureFlagSource + properties: + debugLogging: + description: DebugLogging defines whether to enable --debug flag of + flagd sidecar. Default false (disabled). + type: boolean + defaultSyncProvider: + description: DefaultSyncProvider defines the default sync provider + type: string + envVarPrefix: + description: EnvVarPrefix defines the prefix to be applied to all + environment variables applied to the sidecar, default FLAGD + type: string + envVars: + description: EnvVars define the env vars to be applied to the sidecar, + any env vars in FeatureFlagConfiguration CRs are added at the lowest + index, all values will have the EnvVarPrefix applied, default FLAGD + items: + description: EnvVar represents an environment variable present in + a Container. + properties: + name: + description: Name of the environment variable. Must be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are expanded using + the previously defined environment variables in the container + and any service environment variables. If a variable cannot + be resolved, the reference in the input string will be unchanged. + Double $$ are reduced to a single $, which allows for escaping + the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the + string literal "$(VAR_NAME)". Escaped references will never + be expanded, regardless of whether the variable exists or + not. Defaults to "".' + type: string + valueFrom: + description: Source for the environment variable's value. Cannot + be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap or its key + must be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + description: 'Selects a field of the pod: supports metadata.name, + metadata.namespace, `metadata.labels['''']`, `metadata.annotations['''']`, + spec.nodeName, spec.serviceAccountName, status.hostIP, + status.podIP, status.podIPs.' + properties: + apiVersion: + description: Version of the schema the FieldPath is + written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in the specified + API version. + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + description: 'Selects a resource of the container: only + resources limits and requests (limits.cpu, limits.memory, + limits.ephemeral-storage, requests.cpu, requests.memory + and requests.ephemeral-storage) are currently supported.' + properties: + containerName: + description: 'Container name: required for volumes, + optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output format of the exposed + resources, defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + description: Selects a key of a secret in the pod's namespace + properties: + key: + description: The key of the secret to select from. Must + be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the Secret or its key must + be defined + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + evaluator: + description: Evaluator sets an evaluator, defaults to 'json' + type: string + image: + description: Image allows for the sidecar image to be overridden, + defaults to 'ghcr.io/open-feature/flagd' + type: string + logFormat: + description: LogFormat allows for the sidecar log format to be overridden, + defaults to 'json' + type: string + metricsPort: + description: MetricsPort defines the port to serve metrics on, defaults + to 8014 + format: int32 + type: integer + otelCollectorUri: + description: OtelCollectorUri defines whether to enable --otel-collector-uri + flag of flagd sidecar. Default false (disabled). + type: string + port: + description: Port defines the port to listen on, defaults to 8013 + format: int32 + type: integer + probesEnabled: + description: ProbesEnabled defines whether to enable liveness and + readiness probes of flagd sidecar. Default true (enabled). + type: boolean + resources: + description: Resources defines flagd sidecar resources. Default to + operator sidecar-cpu-* and sidecar-ram-* flags. + properties: + claims: + description: "Claims lists the names of resources, defined in + spec.resourceClaims, that are used by this container. \n This + is an alpha field and requires enabling the DynamicResourceAllocation + feature gate. \n This field is immutable. It can only be set + for containers." + items: + description: ResourceClaim references one entry in PodSpec.ResourceClaims. + properties: + name: + description: Name must match the name of one entry in pod.spec.resourceClaims + of the Pod where this field is used. It makes that resource + available inside a container. + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute resources + allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes the minimum amount of compute + resources required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, otherwise + to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + type: object + rolloutOnChange: + description: RolloutOnChange dictates whether annotated deployments + will be restarted when configuration changes are detected in this + CR, defaults to false + type: boolean + socketPath: + description: SocketPath defines the unix socket path to listen on + type: string + sources: + description: SyncProviders define the syncProviders and associated + configuration to be applied to the sidecar + items: + properties: + certPath: + description: CertPath is a path of a certificate to be used + by grpc TLS connection + type: string + httpSyncBearerToken: + description: HttpSyncBearerToken is a bearer token. Used by + http(s) sync provider only + type: string + provider: + description: Provider type - kubernetes, http(s), grpc(s) or + filepath + type: string + providerID: + description: ProviderID is an identifier to be used in grpc + provider + type: string + selector: + description: Selector is a flag configuration selector used + by grpc provider + type: string + source: + description: Source is a URI of the flag sources + type: string + tls: + description: TLS - Enable/Disable secure TLS connectivity. Currently + used only by GRPC sync + type: boolean + required: + - source + type: object + minItems: 1 + type: array + syncProviderArgs: + description: SyncProviderArgs are string arguments passed to all sync + providers, defined as key values separated by = + items: + type: string + type: array + tag: + description: Tag to be appended to the sidecar image, defaults to + 'main' + type: string + required: + - sources + type: object + status: + description: FeatureFlagSourceStatus defines the observed state of FeatureFlagSource + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/config/crd/bases/core.openfeature.dev_flagsourceconfigurations.yaml b/config/crd/bases/core.openfeature.dev_flagsourceconfigurations.yaml index da40f1f67..8a419a104 100644 --- a/config/crd/bases/core.openfeature.dev_flagsourceconfigurations.yaml +++ b/config/crd/bases/core.openfeature.dev_flagsourceconfigurations.yaml @@ -191,7 +191,7 @@ spec: type: boolean resources: description: Resources defines flagd sidecar resources. Default to - operator sidecar-cpu-limit and sidecar-ram-limit flags. + operator sidecar-cpu-* and sidecar-ram-* flags. properties: claims: description: "Claims lists the names of resources, defined in @@ -551,6 +551,54 @@ spec: description: ProbesEnabled defines whether to enable liveness and readiness probes of flagd sidecar. Default true (enabled). type: boolean + resources: + description: Resources defines flagd sidecar resources. Default to + operator sidecar-cpu-* and sidecar-ram-* flags. + properties: + claims: + description: "Claims lists the names of resources, defined in + spec.resourceClaims, that are used by this container. \n This + is an alpha field and requires enabling the DynamicResourceAllocation + feature gate. \n This field is immutable. It can only be set + for containers." + items: + description: ResourceClaim references one entry in PodSpec.ResourceClaims. + properties: + name: + description: Name must match the name of one entry in pod.spec.resourceClaims + of the Pod where this field is used. It makes that resource + available inside a container. + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute resources + allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes the minimum amount of compute + resources required. If Requests is omitted for a container, + it defaults to Limits if that is explicitly specified, otherwise + to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + type: object rolloutOnChange: description: RolloutOnChange dictates whether annotated deployments will be restarted when configuration changes are detected in this diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index 267d52874..7c73909b0 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -4,6 +4,8 @@ resources: - bases/core.openfeature.dev_featureflagconfigurations.yaml - bases/core.openfeature.dev_flagsourceconfigurations.yaml +- bases/core.openfeature.dev_featureflags.yaml +- bases/core.openfeature.dev_featureflagsources.yaml #+kubebuilder:scaffold:crdkustomizeresource patchesStrategicMerge: @@ -11,12 +13,16 @@ patchesStrategicMerge: # patches here are for enabling the conversion webhook for each CRD - patches/webhook_in_featureflagconfigurations.yaml - patches/webhook_in_flagsourceconfigurations.yaml +#- patches/webhook_in_featureflags.yaml +#- patches/webhook_in_featureflagsources.yaml #+kubebuilder:scaffold:crdkustomizewebhookpatch # [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix. # patches here are for enabling the CA injection for each CRD - patches/cainjection_in_featureflagconfigurations.yaml - patches/cainjection_in_flagsourceconfigurations.yaml +#- patches/cainjection_in_featureflags.yaml +#- patches/cainjection_in_featureflagsources.yaml #+kubebuilder:scaffold:crdkustomizecainjectionpatch # the following config is for teaching kustomize how to do kustomization for CRDs. diff --git a/config/crd/patches/cainjection_in_core_featureflags.yaml b/config/crd/patches/cainjection_in_core_featureflags.yaml new file mode 100644 index 000000000..67581e1e6 --- /dev/null +++ b/config/crd/patches/cainjection_in_core_featureflags.yaml @@ -0,0 +1,7 @@ +# The following patch adds a directive for certmanager to inject CA into the CRD +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) + name: featureflags.core.openfeature.dev diff --git a/config/crd/patches/cainjection_in_core_featureflagsources.yaml b/config/crd/patches/cainjection_in_core_featureflagsources.yaml new file mode 100644 index 000000000..d23936843 --- /dev/null +++ b/config/crd/patches/cainjection_in_core_featureflagsources.yaml @@ -0,0 +1,7 @@ +# The following patch adds a directive for certmanager to inject CA into the CRD +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) + name: featureflagsources.core.openfeature.dev diff --git a/config/crd/patches/webhook_in_core_featureflags.yaml b/config/crd/patches/webhook_in_core_featureflags.yaml new file mode 100644 index 000000000..d52034067 --- /dev/null +++ b/config/crd/patches/webhook_in_core_featureflags.yaml @@ -0,0 +1,16 @@ +# The following patch enables a conversion webhook for the CRD +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: featureflags.core.openfeature.dev +spec: + conversion: + strategy: Webhook + webhook: + clientConfig: + service: + namespace: system + name: webhook-service + path: /convert + conversionReviewVersions: + - v1 diff --git a/config/crd/patches/webhook_in_core_featureflagsources.yaml b/config/crd/patches/webhook_in_core_featureflagsources.yaml new file mode 100644 index 000000000..624268108 --- /dev/null +++ b/config/crd/patches/webhook_in_core_featureflagsources.yaml @@ -0,0 +1,16 @@ +# The following patch enables a conversion webhook for the CRD +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: featureflagsources.core.openfeature.dev +spec: + conversion: + strategy: Webhook + webhook: + clientConfig: + service: + namespace: system + name: webhook-service + path: /convert + conversionReviewVersions: + - v1 diff --git a/config/rbac/core_featureflag_editor_role.yaml b/config/rbac/core_featureflag_editor_role.yaml new file mode 100644 index 000000000..61631ccf7 --- /dev/null +++ b/config/rbac/core_featureflag_editor_role.yaml @@ -0,0 +1,24 @@ +# permissions for end users to edit featureflags. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: featureflag-editor-role +rules: +- apiGroups: + - core.openfeature.dev + resources: + - featureflags + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - core.openfeature.dev + resources: + - featureflags/status + verbs: + - get diff --git a/config/rbac/core_featureflag_viewer_role.yaml b/config/rbac/core_featureflag_viewer_role.yaml new file mode 100644 index 000000000..4a3d9d414 --- /dev/null +++ b/config/rbac/core_featureflag_viewer_role.yaml @@ -0,0 +1,20 @@ +# permissions for end users to view featureflags. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: featureflag-viewer-role +rules: +- apiGroups: + - core.openfeature.dev + resources: + - featureflags + verbs: + - get + - list + - watch +- apiGroups: + - core.openfeature.dev + resources: + - featureflags/status + verbs: + - get diff --git a/config/rbac/core_featureflagsource_editor_role.yaml b/config/rbac/core_featureflagsource_editor_role.yaml new file mode 100644 index 000000000..0dd935a85 --- /dev/null +++ b/config/rbac/core_featureflagsource_editor_role.yaml @@ -0,0 +1,24 @@ +# permissions for end users to edit featureflagsources. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: featureflagsource-editor-role +rules: +- apiGroups: + - core.openfeature.dev + resources: + - featureflagsources + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - core.openfeature.dev + resources: + - featureflagsources/status + verbs: + - get diff --git a/config/rbac/core_featureflagsource_viewer_role.yaml b/config/rbac/core_featureflagsource_viewer_role.yaml new file mode 100644 index 000000000..fd08e073c --- /dev/null +++ b/config/rbac/core_featureflagsource_viewer_role.yaml @@ -0,0 +1,20 @@ +# permissions for end users to view featureflagsources. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: featureflagsource-viewer-role +rules: +- apiGroups: + - core.openfeature.dev + resources: + - featureflagsources + verbs: + - get + - list + - watch +- apiGroups: + - core.openfeature.dev + resources: + - featureflagsources/status + verbs: + - get diff --git a/config/samples/core_v1beta1_featureflag.yaml b/config/samples/core_v1beta1_featureflag.yaml new file mode 100644 index 000000000..35d1cc9a9 --- /dev/null +++ b/config/samples/core_v1beta1_featureflag.yaml @@ -0,0 +1,13 @@ +apiVersion: core.openfeature.dev/v1beta1 +kind: FeatureFlag +metadata: + name: featureflag-sample +spec: + flagSpec: + flags: + "simple-flag": + state: "ENABLED" + variants: + "on": true + "off": false + defaultVariant: "on" diff --git a/config/samples/core_v1beta1_featureflagsource.yaml b/config/samples/core_v1beta1_featureflagsource.yaml new file mode 100644 index 000000000..9e5c9f9d1 --- /dev/null +++ b/config/samples/core_v1beta1_featureflagsource.yaml @@ -0,0 +1,13 @@ +apiVersion: core.openfeature.dev/v1beta1 +kind: FeatureFlagSource +metadata: + name: featureflagsource-sample +spec: + metricsPort: 8080 + evaluator: json + defaultSyncProvider: file + tag: latest + sources: + - source: end-to-end-test + provider: file + probesEnabled: true diff --git a/docs/crds.md b/docs/crds.md index bc8ebbe4e..a1dd3fc05 100644 --- a/docs/crds.md +++ b/docs/crds.md @@ -4,6 +4,7 @@ Packages: - [core.openfeature.dev/v1alpha1](#coreopenfeaturedevv1alpha1) - [core.openfeature.dev/v1alpha2](#coreopenfeaturedevv1alpha2) +- [core.openfeature.dev/v1beta1](#coreopenfeaturedevv1beta1) - [core.openfeature.dev/v1alpha3](#coreopenfeaturedevv1alpha3) # core.openfeature.dev/v1alpha1 @@ -737,7 +738,7 @@ FlagSourceConfigurationSpec defines the desired state of FlagSourceConfiguration resources object - Resources defines flagd sidecar resources. Default to operator sidecar-cpu-limit and sidecar-ram-limit flags.
+ Resources defines flagd sidecar resources. Default to operator sidecar-cpu-* and sidecar-ram-* flags.
false @@ -1092,7 +1093,7 @@ Selects a key of a secret in the pod's namespace -Resources defines flagd sidecar resources. Default to operator sidecar-cpu-limit and sidecar-ram-limit flags. +Resources defines flagd sidecar resources. Default to operator sidecar-cpu-* and sidecar-ram-* flags. @@ -1251,6 +1252,13 @@ FeatureFlagConfigurationSpec defines the desired state of FeatureFlagConfigurati FlagDSpec [DEPRECATED]: superseded by FlagSourceConfiguration
+ + + + + @@ -1626,6 +1634,76 @@ Selects a key of a secret in the pod's namespace
false
resourcesobject + Resources defines flagd sidecar resources. Default to operator sidecar-cpu-* and sidecar-ram-* flags.
+
false
serviceProvider object
+### FeatureFlagConfiguration.spec.resources +[↩ Parent](#featureflagconfigurationspec-1) + + + +Resources defines flagd sidecar resources. Default to operator sidecar-cpu-* and sidecar-ram-* flags. + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
claims[]object + Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. + This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. + This field is immutable. It can only be set for containers.
+
false
limitsmap[string]int or string + Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
+
false
requestsmap[string]int or string + Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
+
false
+ + +### FeatureFlagConfiguration.spec.resources.claims[index] +[↩ Parent](#featureflagconfigurationspecresources) + + + +ResourceClaim references one entry in PodSpec.ResourceClaims. + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring + Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.
+
true
+ + ### FeatureFlagConfiguration.spec.serviceProvider [↩ Parent](#featureflagconfigurationspec-1) @@ -1954,24 +2032,26 @@ FlagSourceConfigurationSpec defines the desired state of FlagSourceConfiguration -# core.openfeature.dev/v1alpha3 +# core.openfeature.dev/v1beta1 Resource Types: -- [FlagSourceConfiguration](#flagsourceconfiguration) +- [FeatureFlag](#featureflag) +- [FeatureFlagSource](#featureflagsource) -## FlagSourceConfiguration -[↩ Parent](#coreopenfeaturedevv1alpha3 ) +## FeatureFlag +[↩ Parent](#coreopenfeaturedevv1beta1 ) -FlagSourceConfiguration is the Schema for the FlagSourceConfigurations API + +FeatureFlag is the Schema for the featureflags API @@ -1985,13 +2065,13 @@ FlagSourceConfiguration is the Schema for the FlagSourceConfigurations API - + - + @@ -2000,29 +2080,29 @@ FlagSourceConfiguration is the Schema for the FlagSourceConfigurations API - +
apiVersion stringcore.openfeature.dev/v1alpha3core.openfeature.dev/v1beta1 true
kind stringFlagSourceConfigurationFeatureFlag true
Refer to the Kubernetes API documentation for the fields of the `metadata` field. true
specspec object - FlagSourceConfigurationSpec defines the desired state of FlagSourceConfiguration
+ FeatureFlagSpec defines the desired state of FeatureFlag
false
status object - FlagSourceConfigurationStatus defines the observed state of FlagSourceConfiguration
+ FeatureFlagStatus defines the observed state of FeatureFlag
false
-### FlagSourceConfiguration.spec -[↩ Parent](#flagsourceconfiguration-1) +### FeatureFlag.spec +[↩ Parent](#featureflag) -FlagSourceConfigurationSpec defines the desired state of FlagSourceConfiguration +FeatureFlagSpec defines the desired state of FeatureFlag @@ -2034,7 +2114,171 @@ FlagSourceConfigurationSpec defines the desired state of FlagSourceConfiguration - + + + + + +
sourcesflagSpecobject + FlagSpec is the structured representation of the feature flag specification
+
false
+ + +### FeatureFlag.spec.flagSpec +[↩ Parent](#featureflagspec) + + + +FlagSpec is the structured representation of the feature flag specification + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
flagsmap[string]object +
+
true
$evaluatorsobject +
+
false
+ + +### FeatureFlag.spec.flagSpec.flags[key] +[↩ Parent](#featureflagspecflagspec) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
defaultVariantstring +
+
true
stateenum +
+
+ Enum: ENABLED, DISABLED
+
true
variantsobject +
+
true
targetingobject + Targeting is the json targeting rule
+
false
+ +## FeatureFlagSource +[↩ Parent](#coreopenfeaturedevv1beta1 ) + + + + + + +FeatureFlagSource is the Schema for the FeatureFlagSources API + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
apiVersionstringcore.openfeature.dev/v1beta1true
kindstringFeatureFlagSourcetrue
metadataobjectRefer to the Kubernetes API documentation for the fields of the `metadata` field.true
specobject + FeatureFlagSourceSpec defines the desired state of FeatureFlagSource
+
false
statusobject + FeatureFlagSourceStatus defines the observed state of FeatureFlagSource
+
false
+ + +### FeatureFlagSource.spec +[↩ Parent](#featureflagsource) + + + +FeatureFlagSourceSpec defines the desired state of FeatureFlagSource + + + + + + + + + + + + - + + + + + + @@ -2153,8 +2404,8 @@ FlagSourceConfigurationSpec defines the desired state of FlagSourceConfiguration
NameTypeDescriptionRequired
sources []object SyncProviders define the syncProviders and associated configuration to be applied to the sidecar
@@ -2062,7 +2306,7 @@ FlagSourceConfigurationSpec defines the desired state of FlagSourceConfiguration
false
envVarsenvVars []object EnvVars define the env vars to be applied to the sidecar, any env vars in FeatureFlagConfiguration CRs are added at the lowest index, all values will have the EnvVarPrefix applied, default FLAGD
@@ -2121,6 +2365,13 @@ FlagSourceConfigurationSpec defines the desired state of FlagSourceConfiguration ProbesEnabled defines whether to enable liveness and readiness probes of flagd sidecar. Default true (enabled).
false
resourcesobject + Resources defines flagd sidecar resources. Default to operator sidecar-cpu-* and sidecar-ram-* flags.
+
false
rolloutOnChange boolean
-### FlagSourceConfiguration.spec.sources[index] -[↩ Parent](#flagsourceconfigurationspec-1) +### FeatureFlagSource.spec.sources[index] +[↩ Parent](#featureflagsourcespec) @@ -2222,8 +2473,8 @@ FlagSourceConfigurationSpec defines the desired state of FlagSourceConfiguration -### FlagSourceConfiguration.spec.envVars[index] -[↩ Parent](#flagsourceconfigurationspec-1) +### FeatureFlagSource.spec.envVars[index] +[↩ Parent](#featureflagsourcespec) @@ -2253,7 +2504,7 @@ EnvVar represents an environment variable present in a Container. false - valueFrom + valueFrom object Source for the environment variable's value. Cannot be used if value is not empty.
@@ -2263,8 +2514,8 @@ EnvVar represents an environment variable present in a Container. -### FlagSourceConfiguration.spec.envVars[index].valueFrom -[↩ Parent](#flagsourceconfigurationspecenvvarsindex-1) +### FeatureFlagSource.spec.envVars[index].valueFrom +[↩ Parent](#featureflagsourcespecenvvarsindex) @@ -2280,28 +2531,28 @@ Source for the environment variable's value. Cannot be used if value is not empt - configMapKeyRef + configMapKeyRef object Selects a key of a ConfigMap.
false - fieldRef + fieldRef object Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
false - resourceFieldRef + resourceFieldRef object Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
false - secretKeyRef + secretKeyRef object Selects a key of a secret in the pod's namespace
@@ -2311,8 +2562,8 @@ Source for the environment variable's value. Cannot be used if value is not empt -### FlagSourceConfiguration.spec.envVars[index].valueFrom.configMapKeyRef -[↩ Parent](#flagsourceconfigurationspecenvvarsindexvaluefrom-1) +### FeatureFlagSource.spec.envVars[index].valueFrom.configMapKeyRef +[↩ Parent](#featureflagsourcespecenvvarsindexvaluefrom) @@ -2352,8 +2603,8 @@ Selects a key of a ConfigMap. -### FlagSourceConfiguration.spec.envVars[index].valueFrom.fieldRef -[↩ Parent](#flagsourceconfigurationspecenvvarsindexvaluefrom-1) +### FeatureFlagSource.spec.envVars[index].valueFrom.fieldRef +[↩ Parent](#featureflagsourcespecenvvarsindexvaluefrom) @@ -2386,8 +2637,8 @@ Selects a field of the pod: supports metadata.name, metadata.namespace, `metadat -### FlagSourceConfiguration.spec.envVars[index].valueFrom.resourceFieldRef -[↩ Parent](#flagsourceconfigurationspecenvvarsindexvaluefrom-1) +### FeatureFlagSource.spec.envVars[index].valueFrom.resourceFieldRef +[↩ Parent](#featureflagsourcespecenvvarsindexvaluefrom) @@ -2427,8 +2678,8 @@ Selects a resource of the container: only resources limits and requests (limits. -### FlagSourceConfiguration.spec.envVars[index].valueFrom.secretKeyRef -[↩ Parent](#flagsourceconfigurationspecenvvarsindexvaluefrom-1) +### FeatureFlagSource.spec.envVars[index].valueFrom.secretKeyRef +[↩ Parent](#featureflagsourcespecenvvarsindexvaluefrom) @@ -2465,4 +2716,664 @@ Selects a key of a secret in the pod's namespace false + + + +### FeatureFlagSource.spec.resources +[↩ Parent](#featureflagsourcespec) + + + +Resources defines flagd sidecar resources. Default to operator sidecar-cpu-* and sidecar-ram-* flags. + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
claims[]object + Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. + This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. + This field is immutable. It can only be set for containers.
+
false
limitsmap[string]int or string + Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
+
false
requestsmap[string]int or string + Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
+
false
+ + +### FeatureFlagSource.spec.resources.claims[index] +[↩ Parent](#featureflagsourcespecresources) + + + +ResourceClaim references one entry in PodSpec.ResourceClaims. + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring + Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.
+
true
+ +# core.openfeature.dev/v1alpha3 + +Resource Types: + +- [FlagSourceConfiguration](#flagsourceconfiguration) + + + + +## FlagSourceConfiguration +[↩ Parent](#coreopenfeaturedevv1alpha3 ) + + + + + + +FlagSourceConfiguration is the Schema for the FlagSourceConfigurations API + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
apiVersionstringcore.openfeature.dev/v1alpha3true
kindstringFlagSourceConfigurationtrue
metadataobjectRefer to the Kubernetes API documentation for the fields of the `metadata` field.true
specobject + FlagSourceConfigurationSpec defines the desired state of FlagSourceConfiguration
+
false
statusobject + FlagSourceConfigurationStatus defines the observed state of FlagSourceConfiguration
+
false
+ + +### FlagSourceConfiguration.spec +[↩ Parent](#flagsourceconfiguration-1) + + + +FlagSourceConfigurationSpec defines the desired state of FlagSourceConfiguration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
sources[]object + SyncProviders define the syncProviders and associated configuration to be applied to the sidecar
+
true
debugLoggingboolean + DebugLogging defines whether to enable --debug flag of flagd sidecar. Default false (disabled).
+
false
defaultSyncProviderstring + DefaultSyncProvider defines the default sync provider
+
false
envVarPrefixstring + EnvVarPrefix defines the prefix to be applied to all environment variables applied to the sidecar, default FLAGD
+
false
envVars[]object + EnvVars define the env vars to be applied to the sidecar, any env vars in FeatureFlagConfiguration CRs are added at the lowest index, all values will have the EnvVarPrefix applied, default FLAGD
+
false
evaluatorstring + Evaluator sets an evaluator, defaults to 'json'
+
false
imagestring + Image allows for the sidecar image to be overridden, defaults to 'ghcr.io/open-feature/flagd'
+
false
logFormatstring + LogFormat allows for the sidecar log format to be overridden, defaults to 'json'
+
false
metricsPortinteger + MetricsPort defines the port to serve metrics on, defaults to 8014
+
+ Format: int32
+
false
otelCollectorUristring + OtelCollectorUri defines whether to enable --otel-collector-uri flag of flagd sidecar. Default false (disabled).
+
false
portinteger + Port defines the port to listen on, defaults to 8013
+
+ Format: int32
+
false
probesEnabledboolean + ProbesEnabled defines whether to enable liveness and readiness probes of flagd sidecar. Default true (enabled).
+
false
resourcesobject + Resources defines flagd sidecar resources. Default to operator sidecar-cpu-* and sidecar-ram-* flags.
+
false
rolloutOnChangeboolean + RolloutOnChange dictates whether annotated deployments will be restarted when configuration changes are detected in this CR, defaults to false
+
false
socketPathstring + SocketPath defines the unix socket path to listen on
+
false
syncProviderArgs[]string + SyncProviderArgs are string arguments passed to all sync providers, defined as key values separated by =
+
false
tagstring + Tag to be appended to the sidecar image, defaults to 'main'
+
false
+ + +### FlagSourceConfiguration.spec.sources[index] +[↩ Parent](#flagsourceconfigurationspec-1) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
sourcestring + Source is a URI of the flag sources
+
true
certPathstring + CertPath is a path of a certificate to be used by grpc TLS connection
+
false
httpSyncBearerTokenstring + HttpSyncBearerToken is a bearer token. Used by http(s) sync provider only
+
false
providerstring + Provider type - kubernetes, http(s), grpc(s) or filepath
+
false
providerIDstring + ProviderID is an identifier to be used in grpc provider
+
false
selectorstring + Selector is a flag configuration selector used by grpc provider
+
false
tlsboolean + TLS - Enable/Disable secure TLS connectivity. Currently used only by GRPC sync
+
false
+ + +### FlagSourceConfiguration.spec.envVars[index] +[↩ Parent](#flagsourceconfigurationspec-1) + + + +EnvVar represents an environment variable present in a Container. + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring + Name of the environment variable. Must be a C_IDENTIFIER.
+
true
valuestring + Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".
+
false
valueFromobject + Source for the environment variable's value. Cannot be used if value is not empty.
+
false
+ + +### FlagSourceConfiguration.spec.envVars[index].valueFrom +[↩ Parent](#flagsourceconfigurationspecenvvarsindex-1) + + + +Source for the environment variable's value. Cannot be used if value is not empty. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
configMapKeyRefobject + Selects a key of a ConfigMap.
+
false
fieldRefobject + Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
+
false
resourceFieldRefobject + Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
+
false
secretKeyRefobject + Selects a key of a secret in the pod's namespace
+
false
+ + +### FlagSourceConfiguration.spec.envVars[index].valueFrom.configMapKeyRef +[↩ Parent](#flagsourceconfigurationspecenvvarsindexvaluefrom-1) + + + +Selects a key of a ConfigMap. + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
keystring + The key to select.
+
true
namestring + Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
+
false
optionalboolean + Specify whether the ConfigMap or its key must be defined
+
false
+ + +### FlagSourceConfiguration.spec.envVars[index].valueFrom.fieldRef +[↩ Parent](#flagsourceconfigurationspecenvvarsindexvaluefrom-1) + + + +Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs. + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
fieldPathstring + Path of the field to select in the specified API version.
+
true
apiVersionstring + Version of the schema the FieldPath is written in terms of, defaults to "v1".
+
false
+ + +### FlagSourceConfiguration.spec.envVars[index].valueFrom.resourceFieldRef +[↩ Parent](#flagsourceconfigurationspecenvvarsindexvaluefrom-1) + + + +Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported. + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
resourcestring + Required: resource to select
+
true
containerNamestring + Container name: required for volumes, optional for env vars
+
false
divisorint or string + Specifies the output format of the exposed resources, defaults to "1"
+
false
+ + +### FlagSourceConfiguration.spec.envVars[index].valueFrom.secretKeyRef +[↩ Parent](#flagsourceconfigurationspecenvvarsindexvaluefrom-1) + + + +Selects a key of a secret in the pod's namespace + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
keystring + The key of the secret to select from. Must be a valid secret key.
+
true
namestring + Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?
+
false
optionalboolean + Specify whether the Secret or its key must be defined
+
false
+ + +### FlagSourceConfiguration.spec.resources +[↩ Parent](#flagsourceconfigurationspec-1) + + + +Resources defines flagd sidecar resources. Default to operator sidecar-cpu-* and sidecar-ram-* flags. + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
claims[]object + Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. + This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. + This field is immutable. It can only be set for containers.
+
false
limitsmap[string]int or string + Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
+
false
requestsmap[string]int or string + Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
+
false
+ + +### FlagSourceConfiguration.spec.resources.claims[index] +[↩ Parent](#flagsourceconfigurationspecresources-1) + + + +ResourceClaim references one entry in PodSpec.ResourceClaims. + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring + Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.
+
true
\ No newline at end of file diff --git a/main.go b/main.go index 788e7b74e..9164e465a 100644 --- a/main.go +++ b/main.go @@ -20,33 +20,30 @@ import ( "context" "flag" "fmt" - v1 "k8s.io/api/rbac/v1" "os" - "sigs.k8s.io/controller-runtime/pkg/client" - - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - // Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) - // to ensure that exec-entrypoint and run can make use of them. + corev1alpha1 "github.com/open-feature/open-feature-operator/apis/core/v1alpha1" + corev1alpha2 "github.com/open-feature/open-feature-operator/apis/core/v1alpha2" + corev1alpha3 "github.com/open-feature/open-feature-operator/apis/core/v1alpha3" + corev1beta1 "github.com/open-feature/open-feature-operator/apis/core/v1beta1" controllercommon "github.com/open-feature/open-feature-operator/controllers/common" + "github.com/open-feature/open-feature-operator/controllers/core/featureflagconfiguration" + "github.com/open-feature/open-feature-operator/controllers/core/flagsourceconfiguration" + webhooks "github.com/open-feature/open-feature-operator/webhooks" "go.uber.org/zap/zapcore" + appsV1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + v1 "k8s.io/api/rbac/v1" + "k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" _ "k8s.io/client-go/plugin/pkg/client/auth" ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/healthz" "sigs.k8s.io/controller-runtime/pkg/log/zap" "sigs.k8s.io/controller-runtime/pkg/webhook" - - corev1alpha1 "github.com/open-feature/open-feature-operator/apis/core/v1alpha1" - corev1alpha2 "github.com/open-feature/open-feature-operator/apis/core/v1alpha2" - corev1alpha3 "github.com/open-feature/open-feature-operator/apis/core/v1alpha3" - "github.com/open-feature/open-feature-operator/controllers/core/featureflagconfiguration" - "github.com/open-feature/open-feature-operator/controllers/core/flagsourceconfiguration" - webhooks "github.com/open-feature/open-feature-operator/webhooks" - appsV1 "k8s.io/api/apps/v1" //+kubebuilder:scaffold:imports ) @@ -86,6 +83,7 @@ func init() { utilruntime.Must(corev1alpha1.AddToScheme(scheme)) utilruntime.Must(corev1alpha2.AddToScheme(scheme)) utilruntime.Must(corev1alpha3.AddToScheme(scheme)) + utilruntime.Must(corev1beta1.AddToScheme(scheme)) //+kubebuilder:scaffold:scheme } diff --git a/test/e2e/kuttl/beta-resources/00-assert.yaml b/test/e2e/kuttl/beta-resources/00-assert.yaml new file mode 100644 index 000000000..931a2e295 --- /dev/null +++ b/test/e2e/kuttl/beta-resources/00-assert.yaml @@ -0,0 +1,28 @@ +--- +apiVersion: core.openfeature.dev/v1beta1 +kind: FeatureFlag +metadata: + name: featureflag +spec: + flagSpec: + flags: + "simple-flag": + state: "ENABLED" + variants: + "on": true + "off": false + defaultVariant: "on" +--- +apiVersion: core.openfeature.dev/v1beta1 +kind: FeatureFlagSource +metadata: + name: featureflagsource +spec: + metricsPort: 8080 + evaluator: json + defaultSyncProvider: file + tag: latest + sources: + - source: end-to-end-test + provider: file + probesEnabled: true diff --git a/test/e2e/kuttl/beta-resources/00-install.yaml b/test/e2e/kuttl/beta-resources/00-install.yaml new file mode 100644 index 000000000..931a2e295 --- /dev/null +++ b/test/e2e/kuttl/beta-resources/00-install.yaml @@ -0,0 +1,28 @@ +--- +apiVersion: core.openfeature.dev/v1beta1 +kind: FeatureFlag +metadata: + name: featureflag +spec: + flagSpec: + flags: + "simple-flag": + state: "ENABLED" + variants: + "on": true + "off": false + defaultVariant: "on" +--- +apiVersion: core.openfeature.dev/v1beta1 +kind: FeatureFlagSource +metadata: + name: featureflagsource +spec: + metricsPort: 8080 + evaluator: json + defaultSyncProvider: file + tag: latest + sources: + - source: end-to-end-test + provider: file + probesEnabled: true