-
Notifications
You must be signed in to change notification settings - Fork 1
[scalardb-cluster] Make Envoy optional #302
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
base: main
Are you sure you want to change the base?
Conversation
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.
Summary of Changes
Hello @kota2and3kan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request introduces the capability to deploy ScalarDB Cluster without requiring Envoy as a mandatory component. It achieves this by making the underlying Kubernetes service configurations conditional based on an envoy.enabled
flag, allowing the cluster to be exposed via a standard service instead of a headless service when Envoy is not in use. This change provides greater flexibility for users who do not need Envoy's features in their ScalarDB Cluster deployments.
Highlights
- Conditional Service Deployment: The Kubernetes Service definition for ScalarDB Cluster is now conditional. If
.Values.envoy.enabled
is true, a headless service (clusterIP: None
) is deployed. Otherwise, a standard Kubernetes Service (ClusterIP type, or whatever is specified by.Values.scalardbCluster.service.type
) is deployed. - Dynamic Endpoint Configuration: The
SCALAR_DB_CLUSTER_MEMBERSHIP_KUBERNETES_ENDPOINT_NAME
environment variable within the deployment is now dynamically set. It will point to the headless service name when Envoy is enabled, and to the standard service name when Envoy is disabled, ensuring correct cluster membership discovery.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request makes Envoy optional in the scalardb-cluster
Helm chart. The service created for a non-Envoy setup is not headless, which is a requirement for Kubernetes-based cluster membership discovery. The deployment.yaml
is configured to use this service for cluster membership discovery. ScalarDB's Kubernetes discovery mechanism requires a headless service to get the individual pod IPs. A regular service with a cluster IP will not work for discovery, causing the cluster formation to fail.
charts/scalardb-cluster/templates/scalardb-cluster/service.yaml
Outdated
Show resolved
Hide resolved
charts/scalardb-cluster/templates/scalardb-cluster/deployment.yaml
Outdated
Show resolved
Hide resolved
/gemini review |
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.
Code Review
This pull request aims to make Envoy optional in the scalardb-cluster
Helm chart. The changes introduce a new Kubernetes Service named ...-endpoint
that is created when Envoy is disabled, serving as the main entry point to the cluster. This is a logical approach. Additionally, the existing headless service is correctly modified to have a hardcoded type: ClusterIP
, which improves the chart's robustness. My review identified a minor formatting issue in the service definitions where the use of nindent
for port specifications will introduce unwanted newlines into the generated YAML. I've provided suggestions to correct this.
charts/scalardb-cluster/templates/scalardb-cluster/service.yaml
Outdated
Show resolved
Hide resolved
charts/scalardb-cluster/templates/scalardb-cluster/service.yaml
Outdated
Show resolved
Hide resolved
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "scalardb-cluster.fullname" . }}-headless |
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.
This headless service is used not only for the service discovery of Envoy but also for pod detection of Scalar Admin for Kubernetes. Therefore, we need to deploy this headless service always, even if we don't deploy Envoy.
{{- range $key, $value := .Values.scalardbCluster.service.ports }} | ||
- name: {{ $key }} | ||
{{ toYaml $value | indent 6 }} | ||
{{- toYaml $value | nindent 6 }} |
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.
This is just a minor refactoring. This does not change any behaviors.
kind: Service | ||
metadata: | ||
name: {{ include "scalardb-cluster.fullname" . }}-headless | ||
name: {{ include "scalardb-cluster.fullname" . }}-endpoint |
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.
This is a newly added service resource to provide the endpoint to access ScalarDB Cluster directly without Envoy.
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.
LGTM! Thank you!
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.
LGTM! 👍
Description
This PR add a new service resource
scalardb-cluster-endpoint
to access ScalarDB Cluster directly from clients without Envoy.Previously, the Envoy proxy is mandatory if users access ScalarDB Cluster from the outside of Kubernetes by using
indirect
mode.However, the additional 1 hop (i.e., Envoy proxy) from the network perspective, it might have a performance impact.
Therefore, we decided to make the Envoy proxy optional even if users use the
indirect
mode of ScalarDB Cluster.In such a case, we need to add a new service to access ScalarDB Cluster directly from clients without Envoy.
Please take a look!
Related issues and/or PRs
N/A
Changes made
scalardb-cluster-endpoint
to access ScalarDB Cluster directly without Envoy.Checklist
Additional notes (optional)
If you set
envoy.enabled
totrue
in the values file, you can see the Envoy pod and Envoy service as follows. This is the same behavior as the previous one. In other words, this is a backward-compatible behavior.Pods (
envoy.enabled=true
)Services (
envoy.enabled=true
)If you set
envoy.enabled
tofalse
in the values file (this is a default behavior), you can see the new servicescalardb-cluster-endpoint
, and the Envoy pods and services disappear as follows. This is a new behavior that has been added in this PR.Pods (
envoy.enabled=false
)Services (
envoy.enabled=false
)Also, I checked whether we can execute queries via this
scalardb-cluster-endpoint
from the client (SQL CLI) as follows, just in case.Release notes
Added a new service. Now, you can access ScalarDB Cluster directly without Envoy.