diff --git a/PROJECT b/PROJECT index aaaa4457a..e7c64404d 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: FlagSourceConfiguration + path: github.com/open-feature/open-feature-operator/apis/core/v1beta1 + version: v1beta1 +- api: + crdVersion: v1 + namespaced: true + domain: openfeature.dev + group: core + kind: FeatureFlagConfiguration + path: github.com/open-feature/open-feature-operator/apis/core/v1beta1 + version: v1beta1 version: "3" diff --git a/apis/core/v1beta1/featureflagconfiguration_types.go b/apis/core/v1beta1/featureflagconfiguration_types.go new file mode 100644 index 000000000..77d217a7a --- /dev/null +++ b/apis/core/v1beta1/featureflagconfiguration_types.go @@ -0,0 +1,108 @@ +/* +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" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// FeatureFlagConfigurationSpec defines the desired state of FeatureFlagConfiguration +type FeatureFlagConfigurationSpec struct { + // FeatureFlagSpec is the structured representation of the feature flag specification + FeatureFlagSpec FeatureFlagSpec `json:"featureFlagSpec,omitempty"` +} + +type FeatureFlagSpec struct { + Flags map[string]FlagSpec `json:"flags"` + // +optional + // +kubebuilder:validation:Schemaless + // +kubebuilder:pruning:PreserveUnknownFields + // +kubebuilder:validation:Type=object + Evaluators json.RawMessage `json:"$evaluators,omitempty"` +} + +type FlagSpec 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"` +} + +type FeatureFlagSyncProvider struct { + Name string `json:"name"` + // +optional + // +nullable + HttpSyncConfiguration *HttpSyncConfiguration `json:"httpSyncConfiguration"` +} + +// HttpSyncConfiguration defines the desired configuration for a http sync +type HttpSyncConfiguration struct { + // Target is the target url for flagd to poll + Target string `json:"target"` + // +optional + BearerToken string `json:"bearerToken,omitempty"` +} + +type FeatureFlagServiceProvider struct { + // +kubebuilder:validation:Enum=flagd + Name string `json:"name"` + // +optional + // +nullable + Credentials *corev1.ObjectReference `json:"credentials"` +} + +// FeatureFlagConfigurationStatus defines the observed state of FeatureFlagConfiguration +type FeatureFlagConfigurationStatus struct { +} + +//+kubebuilder:resource:shortName="ff" +//+kubebuilder:object:root=true +//+kubebuilder:subresource:status + +// FeatureFlagConfiguration is the Schema for the featureflagconfigurations API +type FeatureFlagConfiguration struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec FeatureFlagConfigurationSpec `json:"spec,omitempty"` + Status FeatureFlagConfigurationStatus `json:"status,omitempty"` +} + +//+kubebuilder:object:root=true + +// FeatureFlagConfigurationList contains a list of FeatureFlagConfiguration +type FeatureFlagConfigurationList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []FeatureFlagConfiguration `json:"items"` +} + +func init() { + SchemeBuilder.Register(&FeatureFlagConfiguration{}, &FeatureFlagConfigurationList{}) +} diff --git a/apis/core/v1beta1/flagsourceconfiguration_types.go b/apis/core/v1beta1/flagsourceconfiguration_types.go new file mode 100644 index 000000000..708a1cc28 --- /dev/null +++ b/apis/core/v1beta1/flagsourceconfiguration_types.go @@ -0,0 +1,184 @@ +/* +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" +) + +const ( + SyncProviderKubernetes SyncProviderType = "kubernetes" + SyncProviderFilepath SyncProviderType = "file" + SyncProviderHttp SyncProviderType = "http" + SyncProviderGrpc SyncProviderType = "grpc" + SyncProviderFlagdProxy SyncProviderType = "flagd-proxy" +) + +type SyncProviderType string + +// FlagSourceConfigurationSpec defines the desired state of FlagSourceConfiguration +type FlagSourceConfigurationSpec 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 string `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"` +} + +// FlagSourceConfigurationStatus defines the observed state of FlagSourceConfiguration +type FlagSourceConfigurationStatus struct { +} + +//+kubebuilder:resource:shortName="fsc" +//+kubebuilder:object:root=true +//+kubebuilder:subresource:status + +// FlagSourceConfiguration is the Schema for the FlagSourceConfigurations API +type FlagSourceConfiguration struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec FlagSourceConfigurationSpec `json:"spec,omitempty"` + Status FlagSourceConfigurationStatus `json:"status,omitempty"` +} + +//+kubebuilder:object:root=true + +// FlagSourceConfigurationList contains a list of FlagSourceConfiguration +type FlagSourceConfigurationList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []FlagSourceConfiguration `json:"items"` +} + +func init() { + SchemeBuilder.Register(&FlagSourceConfiguration{}, &FlagSourceConfigurationList{}) +} + +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/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..b6fe790b5 --- /dev/null +++ b/apis/core/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,362 @@ +//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 *FeatureFlagConfiguration) DeepCopyInto(out *FeatureFlagConfiguration) { + *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 FeatureFlagConfiguration. +func (in *FeatureFlagConfiguration) DeepCopy() *FeatureFlagConfiguration { + if in == nil { + return nil + } + out := new(FeatureFlagConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FeatureFlagConfiguration) 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 *FeatureFlagConfigurationList) DeepCopyInto(out *FeatureFlagConfigurationList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]FeatureFlagConfiguration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureFlagConfigurationList. +func (in *FeatureFlagConfigurationList) DeepCopy() *FeatureFlagConfigurationList { + if in == nil { + return nil + } + out := new(FeatureFlagConfigurationList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FeatureFlagConfigurationList) 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 *FeatureFlagConfigurationSpec) DeepCopyInto(out *FeatureFlagConfigurationSpec) { + *out = *in + in.FeatureFlagSpec.DeepCopyInto(&out.FeatureFlagSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureFlagConfigurationSpec. +func (in *FeatureFlagConfigurationSpec) DeepCopy() *FeatureFlagConfigurationSpec { + if in == nil { + return nil + } + out := new(FeatureFlagConfigurationSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeatureFlagConfigurationStatus) DeepCopyInto(out *FeatureFlagConfigurationStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureFlagConfigurationStatus. +func (in *FeatureFlagConfigurationStatus) DeepCopy() *FeatureFlagConfigurationStatus { + if in == nil { + return nil + } + out := new(FeatureFlagConfigurationStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeatureFlagServiceProvider) DeepCopyInto(out *FeatureFlagServiceProvider) { + *out = *in + if in.Credentials != nil { + in, out := &in.Credentials, &out.Credentials + *out = new(v1.ObjectReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureFlagServiceProvider. +func (in *FeatureFlagServiceProvider) DeepCopy() *FeatureFlagServiceProvider { + if in == nil { + return nil + } + out := new(FeatureFlagServiceProvider) + 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 + if in.Flags != nil { + in, out := &in.Flags, &out.Flags + *out = make(map[string]FlagSpec, 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 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 *FeatureFlagSyncProvider) DeepCopyInto(out *FeatureFlagSyncProvider) { + *out = *in + if in.HttpSyncConfiguration != nil { + in, out := &in.HttpSyncConfiguration, &out.HttpSyncConfiguration + *out = new(HttpSyncConfiguration) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeatureFlagSyncProvider. +func (in *FeatureFlagSyncProvider) DeepCopy() *FeatureFlagSyncProvider { + if in == nil { + return nil + } + out := new(FeatureFlagSyncProvider) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FlagSourceConfiguration) DeepCopyInto(out *FlagSourceConfiguration) { + *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 FlagSourceConfiguration. +func (in *FlagSourceConfiguration) DeepCopy() *FlagSourceConfiguration { + if in == nil { + return nil + } + out := new(FlagSourceConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FlagSourceConfiguration) 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 *FlagSourceConfigurationList) DeepCopyInto(out *FlagSourceConfigurationList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]FlagSourceConfiguration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlagSourceConfigurationList. +func (in *FlagSourceConfigurationList) DeepCopy() *FlagSourceConfigurationList { + if in == nil { + return nil + } + out := new(FlagSourceConfigurationList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FlagSourceConfigurationList) 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 *FlagSourceConfigurationSpec) DeepCopyInto(out *FlagSourceConfigurationSpec) { + *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 FlagSourceConfigurationSpec. +func (in *FlagSourceConfigurationSpec) DeepCopy() *FlagSourceConfigurationSpec { + if in == nil { + return nil + } + out := new(FlagSourceConfigurationSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FlagSourceConfigurationStatus) DeepCopyInto(out *FlagSourceConfigurationStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlagSourceConfigurationStatus. +func (in *FlagSourceConfigurationStatus) DeepCopy() *FlagSourceConfigurationStatus { + if in == nil { + return nil + } + out := new(FlagSourceConfigurationStatus) + 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.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 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 *HttpSyncConfiguration) DeepCopyInto(out *HttpSyncConfiguration) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HttpSyncConfiguration. +func (in *HttpSyncConfiguration) DeepCopy() *HttpSyncConfiguration { + if in == nil { + return nil + } + out := new(HttpSyncConfiguration) + 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..84f2bf550 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 @@ -547,3 +595,68 @@ spec: storage: false subresources: status: {} + - name: v1beta1 + schema: + openAPIV3Schema: + description: FeatureFlagConfiguration is the Schema for the featureflagconfigurations + 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: FeatureFlagConfigurationSpec defines the desired state of + FeatureFlagConfiguration + properties: + featureFlagSpec: + description: FeatureFlagSpec 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: FeatureFlagConfigurationStatus defines the observed state + of FeatureFlagConfiguration + type: object + type: object + served: true + storage: false + subresources: + status: {} diff --git a/config/crd/bases/core.openfeature.dev_flagsourceconfigurations.yaml b/config/crd/bases/core.openfeature.dev_flagsourceconfigurations.yaml index da40f1f67..0ff95889a 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,341 @@ 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 + 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: FlagSourceConfigurationStatus defines the observed state + of FlagSourceConfiguration + type: object + type: object + served: true + storage: false + subresources: + status: {} + - name: v1beta1 + schema: + openAPIV3Schema: + description: FlagSourceConfiguration is the Schema for the FlagSourceConfigurations + 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: FlagSourceConfigurationSpec defines the desired state of + FlagSourceConfiguration + 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 diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index 267d52874..dcc3a0b7f 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -11,12 +11,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_flagsourceconfigurations.yaml +#- patches/webhook_in_featureflagconfigurations.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_flagsourceconfigurations.yaml +#- patches/cainjection_in_featureflagconfigurations.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_featureflagconfigurations.yaml b/config/crd/patches/cainjection_in_core_featureflagconfigurations.yaml new file mode 100644 index 000000000..74c4735c4 --- /dev/null +++ b/config/crd/patches/cainjection_in_core_featureflagconfigurations.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: featureflagconfigurations.core.openfeature.dev diff --git a/config/crd/patches/webhook_in_core_featureflagconfigurations.yaml b/config/crd/patches/webhook_in_core_featureflagconfigurations.yaml new file mode 100644 index 000000000..0983a2ebb --- /dev/null +++ b/config/crd/patches/webhook_in_core_featureflagconfigurations.yaml @@ -0,0 +1,16 @@ +# The following patch enables a conversion webhook for the CRD +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: featureflagconfigurations.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_featureflagconfiguration_editor_role.yaml b/config/rbac/core_featureflagconfiguration_editor_role.yaml new file mode 100644 index 000000000..c339f9f92 --- /dev/null +++ b/config/rbac/core_featureflagconfiguration_editor_role.yaml @@ -0,0 +1,24 @@ +# permissions for end users to edit featureflagconfigurations. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: featureflagconfiguration-editor-role +rules: +- apiGroups: + - core.openfeature.dev + resources: + - featureflagconfigurations + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - core.openfeature.dev + resources: + - featureflagconfigurations/status + verbs: + - get diff --git a/config/rbac/core_featureflagconfiguration_viewer_role.yaml b/config/rbac/core_featureflagconfiguration_viewer_role.yaml new file mode 100644 index 000000000..52e50a919 --- /dev/null +++ b/config/rbac/core_featureflagconfiguration_viewer_role.yaml @@ -0,0 +1,20 @@ +# permissions for end users to view featureflagconfigurations. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: featureflagconfiguration-viewer-role +rules: +- apiGroups: + - core.openfeature.dev + resources: + - featureflagconfigurations + verbs: + - get + - list + - watch +- apiGroups: + - core.openfeature.dev + resources: + - featureflagconfigurations/status + verbs: + - get diff --git a/config/samples/core_v1beta1_featureflagconfiguration.yaml b/config/samples/core_v1beta1_featureflagconfiguration.yaml new file mode 100644 index 000000000..e280ecc34 --- /dev/null +++ b/config/samples/core_v1beta1_featureflagconfiguration.yaml @@ -0,0 +1,6 @@ +apiVersion: core.openfeature.dev/v1beta1 +kind: FeatureFlagConfiguration +metadata: + name: featureflagconfiguration-sample +spec: + # TODO(user): Add fields here diff --git a/config/samples/core_v1beta1_flagsourceconfiguration.yaml b/config/samples/core_v1beta1_flagsourceconfiguration.yaml new file mode 100644 index 000000000..7e70e1b1f --- /dev/null +++ b/config/samples/core_v1beta1_flagsourceconfiguration.yaml @@ -0,0 +1,6 @@ +apiVersion: core.openfeature.dev/v1beta1 +kind: FlagSourceConfiguration +metadata: + name: flagsourceconfiguration-sample +spec: + # TODO(user): Add fields here diff --git a/docs/crds.md b/docs/crds.md index bc8ebbe4e..8f25d3b7c 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,17 +2032,183 @@ FlagSourceConfigurationSpec defines the desired state of FlagSourceConfiguration -# core.openfeature.dev/v1alpha3 +# core.openfeature.dev/v1beta1 Resource Types: +- [FeatureFlagConfiguration](#featureflagconfiguration) + - [FlagSourceConfiguration](#flagsourceconfiguration) +## FeatureFlagConfiguration +[↩ Parent](#coreopenfeaturedevv1beta1 ) + + + + + + +FeatureFlagConfiguration is the Schema for the featureflagconfigurations API + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
apiVersionstringcore.openfeature.dev/v1beta1true
kindstringFeatureFlagConfigurationtrue
metadataobjectRefer to the Kubernetes API documentation for the fields of the `metadata` field.true
specobject + FeatureFlagConfigurationSpec defines the desired state of FeatureFlagConfiguration
+
false
statusobject + FeatureFlagConfigurationStatus defines the observed state of FeatureFlagConfiguration
+
false
+ + +### FeatureFlagConfiguration.spec +[↩ Parent](#featureflagconfiguration-1) + + + +FeatureFlagConfigurationSpec defines the desired state of FeatureFlagConfiguration + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
featureFlagSpecobject + FeatureFlagSpec is the structured representation of the feature flag specification
+
false
+ + +### FeatureFlagConfiguration.spec.featureFlagSpec +[↩ Parent](#featureflagconfigurationspec-1) + + + +FeatureFlagSpec is the structured representation of the feature flag specification + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
flagsmap[string]object +
+
true
$evaluatorsobject +
+
false
+ + +### FeatureFlagConfiguration.spec.featureFlagSpec.flags[key] +[↩ Parent](#featureflagconfigurationspecfeatureflagspec-1) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
defaultVariantstring +
+
true
stateenum +
+
+ Enum: ENABLED, DISABLED
+
true
variantsobject +
+
true
targetingobject + Targeting is the json targeting rule
+
false
+ ## FlagSourceConfiguration -[↩ Parent](#coreopenfeaturedevv1alpha3 ) +[↩ Parent](#coreopenfeaturedevv1beta1 ) @@ -1985,7 +2229,7 @@ FlagSourceConfiguration is the Schema for the FlagSourceConfigurations API apiVersion string - core.openfeature.dev/v1alpha3 + core.openfeature.dev/v1beta1 true @@ -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 + + resources + object + + Resources defines flagd sidecar resources. Default to operator sidecar-cpu-* and sidecar-ram-* flags.
+ + false rolloutOnChange boolean @@ -2465,4 +2716,664 @@ Selects a key of a secret in the pod's namespace 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
+ +# 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