forked from prestodb/presto
-
Notifications
You must be signed in to change notification settings - Fork 2
docs: Add k8s setup instructions. #28
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
Draft
anlowee
wants to merge
11
commits into
y-scope:release-0.293-clp-connector
Choose a base branch
from
anlowee:xwei/add-k8s-manual-doc
base: release-0.293-clp-connector
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
5f0eb8c
Init
5bae0ce
Update docs
anlowee c82f6eb
Merge branch 'release-0.293-clp-connector' into xwei/add-k8s-manual-doc
anlowee ba8cdf6
Merge branch 'release-0.293-clp-connector' into xwei/add-k8s-manual-doc
anlowee 80ec62d
Address comments
anlowee e40f329
Update yscope-k8s/.helmignore
anlowee 6cafbfc
Delete
anlowee 17d7d31
Merge branch 'release-0.293-clp-connector' into xwei/add-k8s-manual-doc
anlowee 8aa5cc1
Update the image and templates
anlowee c8666a4
Add
anlowee d730404
Merge branch 'release-0.293-clp-connector' into xwei/add-k8s-manual-doc
kirkrodrigues 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,223 @@ | ||
# Setup | ||
|
||
## Dependency Installation | ||
|
||
### Install docker | ||
|
||
Follow the guide here: [docker] | ||
|
||
### Install kubectl | ||
|
||
`kubectl` is the command-line tool for interacting with Kubernetes clusters. You will use it to | ||
manage and inspect your k3d cluster. | ||
|
||
Follow the guide here: [kubectl] | ||
|
||
### Install k3d | ||
|
||
k3d is a lightweight wrapper to run k3s (Rancher Lab's minimal Kubernetes distribution) in docker. | ||
|
||
Follow the guide here: [k3d] | ||
|
||
### Runbook | ||
|
||
Import the images and apply them to the cluster: | ||
```shell | ||
# Create a cluster called presto | ||
# There should be two directories under /path/to/host/configs/: | ||
# - /path/to/host/configs/etc-coordinator: | ||
# - /path/to/host/configs/etc-coordinator/catalog/clp.properties | ||
# - /path/to/host/configs/etc-coordinator/config.properties | ||
# - /path/to/host/configs/etc-coordinator/jvm.config | ||
# - /path/to/host/configs/etc-coordinator/log.properties | ||
# - /path/to/host/configs/etc-coordinator/metadata-filter.json | ||
# - /path/to/host/configs/etc-coordinator/node.properties | ||
# | ||
# - /path/to/host/configs/etc-worker: | ||
# - /path/to/host/configs/etc-worker/catalog/clp.properties | ||
# - /path/to/host/configs/etc-worker/config.properties | ||
# - /path/to/host/configs/etc-worker/node.properties | ||
# - /path/to/host/configs/etc-worker/velox.properties | ||
# | ||
# There will be examples of these config files in the following sections | ||
k3d cluster create presto --servers 1 --agents 1 -v /path/to/host/configs/:/configs | ||
# Load the coordinator image | ||
k3d image import ghcr.io/y-scope/yscope-presto-with-clp-connector-coordinator:latest -c presto | ||
# Load the worker image | ||
k3d image import ghcr.io/y-scope/yscope-presto-with-clp-connector-worker:latest -c presto | ||
# Launch the container | ||
kubectl apply -f coordinator.yaml worker.yaml | ||
``` | ||
|
||
To do a sanity check: | ||
```shell | ||
kubectl port-forward svc/presto-coordinator 8080:8080 | ||
# Check is coordinator alive | ||
curl -X GET http://coordinator:8080/v1/info | ||
# Check is worker connected to the coordinator | ||
curl -X GET http://coordinator:8080/v1/nodes | ||
``` | ||
|
||
# Example Configs for Coordinator | ||
|
||
Example of k8s image YAML: | ||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
```yaml | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
labels: | ||
app: coordinator | ||
name: coordinator | ||
spec: | ||
containers: | ||
- name: coordinator | ||
image: ghcr.io/y-scope/yscope-0.293-coordinator:latest | ||
imagePullPolicy: Never | ||
volumeMounts: | ||
- name: "coordinator-config" | ||
mountPath: "/opt/presto-server/etc" | ||
volumes: | ||
- name: "coordinator-config" | ||
hostPath: | ||
path: "/configs/etc-coordinator" | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: coordinator | ||
labels: | ||
app: coordinator | ||
spec: | ||
type: NodePort | ||
ports: | ||
- port: 8080 | ||
nodePort: 30000 | ||
name: "8080" | ||
selector: | ||
app: coordinator | ||
``` | ||
|
||
Example of `/path/to/host/configs/etc-coordinator/catalog/clp.properties` (need to update `clp.metadata-db-*` fields): | ||
``` | ||
connector.name=clp | ||
clp.metadata-provider-type=mysql | ||
clp.metadata-db-url=jdbc:mysql://REPLACE_ME | ||
clp.metadata-db-name=REPLACE_ME | ||
clp.metadata-db-user=REPLACE_ME | ||
clp.metadata-db-password=REPLACE_ME | ||
clp.metadata-table-prefix=clp_ | ||
clp.split-provider-type=mysql | ||
clp.metadata-filter-config=$(pwd)/etc-coordinator/metadata-filter.json | ||
``` | ||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
Example of `/path/to/host/configs/etc-coordinator/config.properties`: | ||
``` | ||
coordinator=true | ||
node-scheduler.include-coordinator=false | ||
http-server.http.port=8080 | ||
query.max-memory=1GB | ||
query.max-memory-per-node=1GB | ||
discovery-server.enabled=true | ||
discovery.uri=http://localhost:8080 | ||
optimizer.optimize-hash-generation=false | ||
regex-library=RE2J | ||
use-alternative-function-signatures=true | ||
inline-sql-functions=false | ||
nested-data-serialization-enabled=false | ||
native-execution-enabled=true | ||
``` | ||
|
||
Example of `/path/to/host/configs/etc-coordinator/jvm.config`: | ||
``` | ||
-server | ||
-Xmx4G | ||
-XX:+UseG1GC | ||
-XX:G1HeapRegionSize=32M | ||
-XX:+UseGCOverheadLimit | ||
-XX:+ExplicitGCInvokesConcurrent | ||
-XX:+HeapDumpOnOutOfMemoryError | ||
-XX:+ExitOnOutOfMemoryError | ||
-Djdk.attach.allowAttachSelf=true | ||
``` | ||
|
||
Example of `/path/to/host/configs/etc-coordinator/log.properties`: | ||
``` | ||
com.facebook.presto=DEBUG | ||
``` | ||
|
||
Example of `/path/to/host/configs/etc-coordinator/metadata-filter.json`: | ||
``` | ||
{ | ||
"clp.default": [ | ||
{ | ||
"filterName": "msg.timestamp", | ||
"rangeMapping": { | ||
"lowerBound": "begin_timestamp", | ||
"upperBound": "end_timestamp" | ||
}, | ||
"required": true | ||
} | ||
] | ||
} | ||
``` | ||
|
||
Example of `/path/to/host/configs/etc-coordinator/node.properties`: | ||
``` | ||
node.environment=production | ||
node.id=coordinator | ||
``` | ||
|
||
# Example Configs for Worker | ||
|
||
Example of k8s image YAML: | ||
🚧This is still in progress. | ||
```yaml | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
labels: | ||
app: worker | ||
name: worker | ||
spec: | ||
containers: | ||
- name: worker | ||
image: ubuntu:22.04 | ||
# imagePullPolicy: Never | ||
command: | ||
- /bin/bash | ||
- -c | ||
args: | ||
- sleep infinity | ||
``` | ||
|
||
Example of `/path/to/host/configs/etc-worker/catalog/clp.properties`: | ||
``` | ||
connector.name=clp | ||
``` | ||
|
||
Example of `/path/to/host/configs/etc-worker/config.properties` (need to replace the `presto.version` to make it the same as coordinator`s): | ||
``` | ||
discovery.uri=http://127.0.0.1:8080 | ||
presto.version=REPLACE_ME | ||
http-server.http.port=7777 | ||
shutdown-onset-sec=1 | ||
register-test-functions=false | ||
runtime-metrics-collection-enabled=false | ||
``` | ||
|
||
Example of `/path/to/host/configs/etc-worker/node.properties`: | ||
``` | ||
node.environment=production | ||
node.internal-address=127.0.0.1 | ||
node.location=testing-location | ||
node.id=worker-1 | ||
``` | ||
|
||
Example of `/path/to/host/configs/etc-worker/velox.properties`: | ||
``` | ||
mutable-config=true | ||
``` | ||
|
||
[docker]: https://docs.docker.com/engine/install | ||
[k3d]: https://k3d.io/stable/#installation | ||
[kubectl]: https://kubernetes.io/docs/tasks/tools/#kubectl |
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.
💡 Verification agent
🧩 Analysis chain
Service name mismatch breaks the port-forward sanity-check
The manifest defines the Service as
coordinator
, but the runbook forwardssvc/presto-coordinator
and the subsequentcurl
targetscoordinator:8080
. Neither will resolve on the host.Align the names and use
localhost
after port-forwarding:Also consider renaming the Service in the YAML to
presto-coordinator
if that better matches your conventions; just keep the doc and manifest consistent.Also applies to: 84-88
To confirm the Service name defined in your Kubernetes manifest, let’s search for all Service resources under yscope-k8s:
🏁 Script executed:
Length of output: 263
Let’s verify the actual Kubernetes Service resource names in your manifests (not just the README) under
yscope-k8s
:🏁 Script executed:
Length of output: 54
To locate where your Kubernetes Service manifests are defined, let’s list all YAML files under
yscope-k8s
:🏁 Script executed:
Length of output: 67
Align README port-forward commands with the Service name
The Service in your README snippet is defined as
name: coordinator
(lines 85–88), but the port-forward and curl commands targetpresto-coordinator
andcoordinator
directly. This will fail at runtime. Update the commands to use the actual Service name and localhost:• File: yscope-k8s/README.md
• Sections: lines 54–58 and 84–88
Alternatively, if you prefer the Service to be named
presto-coordinator
, update itsmetadata.name
in the manifest snippet—and keep the docs in sync.📝 Committable suggestion
🤖 Prompt for AI Agents