-
Notifications
You must be signed in to change notification settings - Fork 742
Adds Config API #122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Adds Config API #122
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,4 @@ | ||
| # More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file | ||
| # Ignore build and test binaries. | ||
| bin/ | ||
| testbin/ |
This file contains hidden or 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 hidden or 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 hidden or 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,16 @@ | ||
| domain: gateway.envoyproxy.io | ||
| layout: | ||
| - go.kubebuilder.io/v3 | ||
| projectName: kube | ||
| repo: github.com/envoyproxy/gateway | ||
| resources: | ||
| - api: | ||
| crdVersion: v1 | ||
| namespaced: true | ||
| controller: true | ||
| domain: gateway.envoyproxy.io | ||
| group: config | ||
| kind: EnvoyProxy | ||
| path: github.com/envoyproxy/gateway/api/v1alpha1 | ||
| version: v1alpha1 | ||
| version: "3" |
This file contains hidden or 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,88 @@ | ||
| package v1alpha1 | ||
|
|
||
| import ( | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| ) | ||
|
|
||
| //+kubebuilder:object:root=true | ||
|
|
||
| // EnvoyGateway is the Schema for the envoygateways API. | ||
| type EnvoyGateway struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
|
|
||
| // EnvoyGatewaySpec defines the desired state of Envoy Gateway. | ||
| EnvoyGatewaySpec `json:",inline"` | ||
| } | ||
|
|
||
| // EnvoyGatewaySpec defines the desired state of Envoy Gateway. | ||
| type EnvoyGatewaySpec struct { | ||
| // Gateway defines desired Gateway API specific configuration. If unset, | ||
| // default configuration parameters will apply. | ||
| // | ||
| // +optional | ||
| Gateway *Gateway `json:"gateway,omitempty"` | ||
|
|
||
| // Provider defines the desired provider and provider-specific configuration. | ||
| // If unspecified, the Kubernetes provider is used with default configuration | ||
| // parameters. | ||
| // | ||
| // +optional | ||
| Provider *Provider `json:"provider,omitempty"` | ||
| } | ||
|
|
||
| // Gateway defines the desired Gateway API configuration of Envoy Gateway. | ||
| type Gateway struct { | ||
| // ControllerName defines the name of the Gateway API controller. If unspecified, | ||
| // defaults to "gateway.envoyproxy.io/gatewayclass-controller". See the following | ||
| // for additional details: | ||
| // | ||
| // https://gateway-api.sigs.k8s.io/v1alpha2/references/spec/#gateway.networking.k8s.io/v1alpha2.GatewayClass | ||
| // | ||
| // +optional | ||
| ControllerName string `json:"controllerName,omitempty"` | ||
| } | ||
|
|
||
| // Provider defines the desired configuration of a provider. | ||
| // +union | ||
| type Provider struct { | ||
| // Type is the type of provider to use. | ||
| // | ||
| // +unionDiscriminator | ||
| Type ProviderType `json:"type"` | ||
| // Kubernetes defines the configuration of the Kubernetes provider. Kubernetes | ||
| // provides runtime configuration via the Kubernetes API. | ||
| // | ||
| // +optional | ||
| Kubernetes *KubernetesProvider `json:"kubernetes,omitempty"` | ||
|
|
||
| // File defines the configuration of the File provider. File provides runtime | ||
| // configuration defined by one or more files. | ||
| // | ||
| // +optional | ||
| File *FileProvider `json:"file,omitempty"` | ||
| } | ||
|
|
||
| // ProviderType defines the types of providers supported by Envoy Gateway. | ||
| type ProviderType string | ||
|
|
||
| const ( | ||
| // ProviderTypeKubernetes defines the "Kubernetes" provider. | ||
| ProviderTypeKubernetes ProviderType = "Kubernetes" | ||
|
|
||
| // ProviderTypeFile defines the "File" provider. | ||
| ProviderTypeFile ProviderType = "File" | ||
| ) | ||
|
|
||
| // KubernetesProvider defines configuration for the Kubernetes provider. | ||
| type KubernetesProvider struct { | ||
| // TODO: Add config as use cases are better understood. | ||
| } | ||
|
|
||
| // FileProvider defines configuration for the File provider. | ||
| type FileProvider struct { | ||
| // TODO: Add config as use cases are better understood. | ||
| } | ||
|
|
||
| func init() { | ||
| SchemeBuilder.Register(&EnvoyGateway{}) | ||
| } |
This file contains hidden or 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,42 @@ | ||
| package v1alpha1 | ||
|
|
||
| import ( | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| ) | ||
|
|
||
| //+kubebuilder:object:root=true | ||
| //+kubebuilder:subresource:status | ||
|
|
||
| // EnvoyProxy is the Schema for the envoyproxies API | ||
| type EnvoyProxy struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
|
||
| Spec EnvoyProxySpec `json:"spec,omitempty"` | ||
| Status EnvoyProxyStatus `json:"status,omitempty"` | ||
| } | ||
|
|
||
| // EnvoyProxySpec defines the desired state of EnvoyProxy. | ||
| type EnvoyProxySpec struct { | ||
| // INSERT ADDITIONAL SPEC FIELDS - define desired state of cluster. | ||
| // Important: Run "make" to regenerate code after modifying this file. | ||
| } | ||
|
|
||
| // EnvoyProxyStatus defines the observed state of EnvoyProxy | ||
| type EnvoyProxyStatus struct { | ||
| // INSERT ADDITIONAL STATUS FIELDS - define observed state of cluster. | ||
| // Important: Run "make" to regenerate code after modifying this file. | ||
| } | ||
|
|
||
| //+kubebuilder:object:root=true | ||
|
|
||
| // EnvoyProxyList contains a list of EnvoyProxy | ||
| type EnvoyProxyList struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ListMeta `json:"metadata,omitempty"` | ||
| Items []EnvoyProxy `json:"items"` | ||
| } | ||
|
|
||
| func init() { | ||
| SchemeBuilder.Register(&EnvoyProxy{}, &EnvoyProxyList{}) | ||
| } |
This file contains hidden or 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,21 @@ | ||
| // Package v1alpha1 contains API Schema definitions for the config v1alpha1 API group. | ||
| // | ||
| //+kubebuilder:object:generate=true | ||
| //+groupName=config.gateway.envoyproxy.io | ||
| package v1alpha1 | ||
|
|
||
| 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: "config.gateway.envoyproxy.io", Version: "v1alpha1"} | ||
|
|
||
| // 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 | ||
| ) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the tools should follow the convention highlighted here https://github.com/envoyproxy/gateway/blob/main/tools/docker/Dockerfile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we expect the user to either have the tools installed locally or run the make target inside a container
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on this vote, the community has decided to focus on using the "local dev" approach and no longer support the
MAKE_IN_DOCKERapproach. @LukeShu is assigned #124 and will have a PR submitted to transition the current Docker-based linters. With that said, IMHO the targets added by this PR should be acceptable.