Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Run Envoy Gateway like DaemonSet #2969

Closed
zvlb opened this issue Mar 18, 2024 · 7 comments · Fixed by #4429
Closed

Run Envoy Gateway like DaemonSet #2969

zvlb opened this issue Mar 18, 2024 · 7 comments · Fixed by #4429
Labels
kind/decision A record of a decision made by the community. stale

Comments

@zvlb
Copy link
Contributor

zvlb commented Mar 18, 2024

Description:
For many use-cases need to start Kubernetes API Gateway like DaemonSet on special nodes.

We discuss it in Slack, and I found request of this feature in issue.

To start the discussion, I can suggest API-scheme for EnvoyProxyKubernetesProvider in EnvoyProxy (with Kubernetes Provider).

I propose the following architecture for implementation:

Now it's looks:

type EnvoyProxyKubernetesProvider struct {
	EnvoyDeployment *KubernetesDeploymentSpec `json:"envoyDeployment,omitempty"`

	EnvoyService *KubernetesServiceSpec `json:"envoyService,omitempty"`

	EnvoyHpa *KubernetesHorizontalPodAutoscalerSpec `json:"envoyHpa,omitempty"`
}

I think we can add field type and field for EnvoyDaemonset:

type KubernetesProviderType string

type EnvoyProxyKubernetesProvider struct {
        // By default - Deployment.
        Type KubernetesProviderType `json:"type,omitempty"`

	EnvoyDeployment *KubernetesDeploymentSpec `json:"envoyDeployment,omitempty"`

        EnvoyDaemonset *KubernetesDaemonsetSpec `json:"envoyDaemonset,omitempty"`

         // Need add logic to NOT create service
	EnvoyService *KubernetesServiceSpec `json:"envoyService,omitempty"`

        // Don't work, if type = Daemonset
	EnvoyHpa *KubernetesHorizontalPodAutoscalerSpec `json:"envoyHpa,omitempty"`
}

And:

// KubernetesDaemonsetSpec defines the desired state of the Kubernetes daemonset resource.
type KubernetesDaemonsetSpec struct {
	Patch *KubernetesPatchSpec `json:"patch,omitempty"`

	Pod *KubernetesPodSpec `json:"pod,omitempty"`

	Container *KubernetesContainerSpec `json:"container,omitempty"`

	InitContainers []corev1.Container `json:"initContainers,omitempty"`

         // Running only on special nodes
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
        Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

        // By default - false
        HostNetwork bool `json:"hostNetwork,omitempty"`
}

(And need add logic for disable metrics Ports (19001) for DaemonSet ports). I think will be better, if we add field DisableMetricsPort to EnvoyProxyKubernetesProvider struct.

Finish

I can implement all the logic after agreeing on the API schema

@zvlb zvlb added the triage label Mar 18, 2024
@ShyunnY
Copy link
Contributor

ShyunnY commented Mar 18, 2024

This feature looks great, and we probably need to discuss the design of the API.

@zvlb
Copy link
Contributor Author

zvlb commented Mar 18, 2024

@ShyunnY
When and in what format does the discussion of the API design?
I would like to start implementing this functionality as soon as possible (it's very important for my work), however, I wouldn't want to waste time on something that won't be accepted.

@arkodg
Copy link
Contributor

arkodg commented Mar 18, 2024

ptal @envoyproxy/gateway-maintainers @envoyproxy/gateway-reviewers

@arkodg arkodg added kind/decision A record of a decision made by the community. and removed triage labels Mar 18, 2024
@zirain
Copy link
Contributor

zirain commented Mar 19, 2024

SGTM, but we need to talk about the API. In most cases, you can share the configuration between DS and Deployment, so maybe we can just something like mode?

here's what OpenTelemetry Operator did:

https://github.com/open-telemetry/opentelemetry-operator/blob/eaf998f2ae9ca93ecf319d6864690a2bd7cbe0c7/apis/v1beta1/opentelemetrycollector_types.go#L88

@arkodg
Copy link
Contributor

arkodg commented Mar 19, 2024

Its looks like we've had multiple users requesting Daemonset + hostNetwork mode
mode may get tricky for 2 cases

  • we've already called it envoyDeployment
  • we want to add a field to deployment but it may not exist in daemonset
  • we may not want to spend extra cycles supporting all cases in daemonset that are supported in deployment since that is not the common case for this project

I'd suggest supporting a new envoyDameonSet knob with a single patch field, so we dont spend our efforts adding more fields into it

Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days.

@github-actions github-actions bot added the stale label Apr 19, 2024
@zvlb
Copy link
Contributor Author

zvlb commented May 6, 2024

This feature merged in another PR - #3092

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/decision A record of a decision made by the community. stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants