-
Notifications
You must be signed in to change notification settings - Fork 1
WIP [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.
{{- else }} | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "scalardb-cluster.fullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "scalardb-cluster.labels" . | nindent 4 }} | ||
annotations: | ||
{{- toYaml .Values.scalardbCluster.service.annotations | nindent 4 }} | ||
spec: | ||
type: {{ .Values.scalardbCluster.service.type }} | ||
ports: | ||
{{- range $key, $value := .Values.scalardbCluster.service.ports }} | ||
- name: {{ $key }} | ||
{{- toYaml $value | nindent 6 }} | ||
{{- end }} | ||
selector: | ||
{{- include "scalardb-cluster.selectorLabels" . | nindent 4 }} | ||
{{- end }} |
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.
When envoy.enabled
is false
, the service created in the {{- else }}
block is not headless (it lacks spec.clusterIP: None
). 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.
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.
ScalarDB Cluster's pod discovery feature utilizes the Endpoint resource behind the Service directly. It doesn't depend on the Headless Service. Therefore, it works if we create a Service resource even if whether it's Headless or not.
{{- if .Values.envoy.enabled }} | ||
- name: SCALAR_DB_CLUSTER_MEMBERSHIP_KUBERNETES_ENDPOINT_NAME | ||
value: {{ include "scalardb-cluster.fullname" . }}-headless | ||
{{- else }} | ||
- name: SCALAR_DB_CLUSTER_MEMBERSHIP_KUBERNETES_ENDPOINT_NAME | ||
value: {{ include "scalardb-cluster.fullname" . }} | ||
{{- end }} |
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.
Description
Related issues and/or PRs
Changes made
Checklist
Additional notes (optional)
Release notes