-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
flagd
CRD with ingress support (#633)
Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com> Co-authored-by: odubajDT <93584209+odubajDT@users.noreply.github.com>
- Loading branch information
Showing
44 changed files
with
3,485 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
/* | ||
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 ( | ||
v1 "k8s.io/api/core/v1" | ||
networkingv1 "k8s.io/api/networking/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// FlagdSpec defines the desired state of Flagd | ||
type FlagdSpec struct { | ||
// Replicas defines the number of replicas to create for the service. | ||
// Default: 1 | ||
// +optional | ||
// +kubebuilder:default=1 | ||
Replicas *int32 `json:"replicas,omitempty"` | ||
|
||
// ServiceType represents the type of Service to create. | ||
// Must be one of: ClusterIP, NodePort, LoadBalancer, and ExternalName. | ||
// Default: ClusterIP | ||
// +optional | ||
// +kubebuilder:default=ClusterIP | ||
// +kubebuilder:validation:Enum:=ClusterIP;NodePort;LoadBalancer;ExternalName | ||
ServiceType v1.ServiceType `json:"serviceType,omitempty"` | ||
|
||
// ServiceAccountName the service account name for the flagd deployment | ||
// +optional | ||
ServiceAccountName string `json:"serviceAccountName,omitempty"` | ||
|
||
// FeatureFlagSource references to a FeatureFlagSource from which the created flagd instance retrieves | ||
// the feature flag configurations | ||
FeatureFlagSource string `json:"featureFlagSource"` | ||
|
||
// Ingress | ||
// +optional | ||
Ingress IngressSpec `json:"ingress"` | ||
} | ||
|
||
// IngressSpec defines the options to be used when deploying the ingress for flagd | ||
type IngressSpec struct { | ||
// Enabled enables/disables the ingress for flagd | ||
Enabled bool `json:"enabled,omitempty"` | ||
|
||
// Annotations the annotations to be added to the ingress | ||
// +optional | ||
Annotations map[string]string `json:"annotations,omitempty"` | ||
|
||
// Hosts list of hosts to be added to the ingress | ||
// +optional | ||
Hosts []string `json:"hosts,omitempty"` | ||
|
||
// TLS configuration for the ingress | ||
TLS []networkingv1.IngressTLS `json:"tls,omitempty"` | ||
|
||
// IngressClassName defines the name if the ingress class to be used for flagd | ||
// +optional | ||
IngressClassName *string `json:"ingressClassName,omitempty"` | ||
|
||
// PathType is the path type to be used for the ingress rules | ||
// +optional | ||
PathType networkingv1.PathType `json:"pathType,omitempty"` | ||
|
||
// FlagdPath is the path to be used for accessing the flagd flag evaluation API | ||
// +optional | ||
FlagdPath string `json:"flagdPath,omitempty"` | ||
|
||
// OFREPPath is the path to be used for accessing the OFREP API | ||
// +optional | ||
OFREPPath string `json:"ofrepPath"` | ||
|
||
// SyncPath is the path to be used for accessing the sync API | ||
// +optional | ||
SyncPath string `json:"syncPath"` | ||
} | ||
|
||
// FlagdStatus defines the observed state of Flagd | ||
type FlagdStatus struct { | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
|
||
// Flagd is the Schema for the flagds API | ||
type Flagd struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec FlagdSpec `json:"spec,omitempty"` | ||
Status FlagdStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// FlagdList contains a list of Flagd | ||
type FlagdList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []Flagd `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&Flagd{}, &FlagdList{}) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.