-
Notifications
You must be signed in to change notification settings - Fork 328
Docs: update Helm Chart page to show usage without cloning Polaris github repo #2939
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?
Changes from all commits
7cf6797
28a9eef
0176a6d
63741e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,36 +22,22 @@ type: docs | |
| weight: 675 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For this file, you can use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @MonkeyCanCode, I did not know it was automatically copied. But I see that there are already merged changes that diverge helm.md from helm/polaris/readme.md - markup for blockquotes was changed in #2656. It was my motivation to remove the header from page version for the site. As a sidenote, we have other pages on the site that are copies from getting-started docs (e.g. Keycloak setup page, Telemetry setup page), but they are not copied automatically. It would be good to have some unified approach for such cases.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. That is correct. If u run local, it will all show up. Either we will need to update the policy or have a better way to handle these. Manually edit those can be fairly tedious. @flyrain
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed with @MonkeyCanCode to rely on automation. Can we also add a post-process step to
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would love to see this automated, but unfortunately the two pages are different, especially the warning box style. I think we would need two different templates.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FWIW, I think this needs to be addressed separately, in a follow-up PR.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree it is a good idea to converge helm.md back with helm chart readme and sync them automatically. |
||
| --- | ||
|
|
||
| <!--- | ||
| This README.md file was generated with: | ||
| https://github.com/norwoodj/helm-docs | ||
| Do not modify the README.md file directly, please modify README.md.gotmpl instead. | ||
| To re-generate the README.md file, install helm-docs then run from the repo root: | ||
| helm-docs --chart-search-root=helm | ||
| --> | ||
|
|
||
|    | ||
|
|
||
| A Helm chart for Apache Polaris (incubating). | ||
|
|
||
| **Homepage:** <https://polaris.apache.org/> | ||
|
|
||
| ## Source Code | ||
|
|
||
| * <https://github.com/apache/polaris> | ||
| This page documents the Polaris Helm chart, which can be used to deploy Polaris on Kubernetes. | ||
|
|
||
| ## Installation | ||
|
|
||
| ### Running locally with a Minikube cluster | ||
|
|
||
| The below instructions assume Minikube and Helm are installed. | ||
|
|
||
| Start the Minikube cluster, build and load image into the Minikube cluster: | ||
|
|
||
| Start the Minikube cluster: | ||
| ```bash | ||
| minikube start | ||
| eval $(minikube docker-env) | ||
| ``` | ||
|
|
||
| If you have cloned Polaris git repository, you may want to build and load image into the Minikube cluster: | ||
| ```bash | ||
| ./gradlew \ | ||
| :polaris-server:assemble \ | ||
| :polaris-server:quarkusAppPartsBuild --rerun \ | ||
|
|
@@ -60,10 +46,25 @@ eval $(minikube docker-env) | |
| -Dquarkus.container-image.build=true | ||
| ``` | ||
|
|
||
| Otherwise load ready images from Docker Hub: | ||
| ```bash | ||
| minikube image pull apache/polaris:latest | ||
| minikube image pull apache/polaris-admin-tool:latest | ||
| ``` | ||
|
|
||
| ### Installing the chart locally | ||
|
|
||
| The below instructions assume a local Kubernetes cluster is running and Helm is installed. | ||
|
|
||
| {{< alert note >}} | ||
| The examples below assume that you have cloned Polaris git repository, which contains the Polaris Helm chart in the `helm/polaris` directory. | ||
| If you do not want to clone the repository or want to use an official Helm chart release, you can download it from the [Apache Polaris Helm Chart repository](https://downloads.apache.org/incubator/polaris/helm-chart/): | ||
| ```bash | ||
| helm pull polaris --repo https://downloads.apache.org/incubator/polaris/helm-chart --version 1.2.0-incubating --untar --untardir ./helm | ||
| ``` | ||
| It will unpack the chart into `./helm/polaris` directory, so that scripts below can be used as is. | ||
| {{< /alert >}} | ||
|
|
||
| #### Common setup | ||
|
|
||
| Create the target namespace: | ||
|
|
@@ -75,7 +76,11 @@ Create all the required resources in the `polaris` namespace. This usually inclu | |
| database, Kubernetes secrets, and service accounts. The Polaris chart does not create | ||
| these resources automatically, as they are not required for all Polaris deployments. The chart will | ||
| fail if these resources are not created beforehand. You can find some examples in the | ||
| `helm/polaris/ci/fixtures` directory, but beware that these are primarily intended for tests. | ||
| `helm/polaris/ci/fixtures` directory, but beware that these are primarily intended for tests. E.g. you can run the command: | ||
| ```bash | ||
| kubectl apply --namespace polaris -f helm/polaris/ci/fixtures/ | ||
| kubectl wait --namespace polaris --for=condition=ready pod --selector=app.kubernetes.io/name=postgres --timeout=120s | ||
| ``` | ||
|
|
||
| Below are two sample deployment models for installing the chart: one with a non-persistent backend and another with a persistent backend. | ||
|
|
||
|
|
@@ -107,26 +112,29 @@ helm upgrade --install --namespace polaris \ | |
| kubectl wait --namespace polaris --for=condition=ready pod --selector=app.kubernetes.io/name=polaris --timeout=120s | ||
| ``` | ||
|
|
||
| To access Polaris and Postgres locally, set up port forwarding for both services (This is needed for bootstrap processes): | ||
| To access Polaris and Postgres locally, set up port forwarding for both services (this might be needed if you want to use Polaris command line tool or if you want to bootstrap the catalog by calling Polaris admin tool locally): | ||
| ```bash | ||
| kubectl port-forward -n polaris $(kubectl get pod -n polaris -l app.kubernetes.io/name=polaris -o jsonpath='{.items[0].metadata.name}') 8181:8181 | ||
| kubectl port-forward -n polaris $(kubectl get pod -n polaris -l app.kubernetes.io/name=polaris -o jsonpath='{.items[0].metadata.name}') 8181:8181 & | ||
|
|
||
| kubectl port-forward -n polaris $(kubectl get pod -n polaris -l app.kubernetes.io/name=postgres -o jsonpath='{.items[0].metadata.name}') 5432:5432 | ||
| kubectl port-forward -n polaris $(kubectl get pod -n polaris -l app.kubernetes.io/name=postgres -o jsonpath='{.items[0].metadata.name}') 5432:5432 & | ||
| ``` | ||
|
|
||
| Run the catalog bootstrap using the Polaris admin tool. This step initializes the catalog with the required configuration: | ||
| Run the catalog bootstrap using the Polaris admin tool in minikube docker environment. This step initializes the catalog with the required configuration: | ||
| ```bash | ||
| container_envs=$(kubectl exec -it -n polaris $(kubectl get pod -n polaris -l app.kubernetes.io/name=polaris -o jsonpath='{.items[0].metadata.name}') -- env) | ||
| export QUARKUS_DATASOURCE_USERNAME=$(echo "$container_envs" | grep quarkus.datasource.username | awk -F '=' '{print $2}' | tr -d '\n\r') | ||
| export QUARKUS_DATASOURCE_PASSWORD=$(echo "$container_envs" | grep quarkus.datasource.password | awk -F '=' '{print $2}' | tr -d '\n\r') | ||
| export QUARKUS_DATASOURCE_JDBC_URL=$(echo "$container_envs" | grep quarkus.datasource.jdbc.url | sed 's/postgres/localhost/2' | awk -F '=' '{print $2}' | tr -d '\n\r') | ||
|
|
||
| java -jar runtime/admin/build/quarkus-app/quarkus-run.jar bootstrap -c POLARIS,root,pass -r POLARIS | ||
| container_envs=$(kubectl exec -n polaris $(kubectl get pod -n polaris -l app.kubernetes.io/name=polaris -o jsonpath='{.items[0].metadata.name}') -- env) && \ | ||
| docker run --rm \ | ||
| -e QUARKUS_DATASOURCE_USERNAME="$(echo "$container_envs" | grep quarkus.datasource.username | awk -F '=' '{print $2}' | tr -d '\n\r')" \ | ||
| -e QUARKUS_DATASOURCE_PASSWORD="$(echo "$container_envs" | grep quarkus.datasource.password | awk -F '=' '{print $2}' | tr -d '\n\r')" \ | ||
| -e QUARKUS_DATASOURCE_JDBC_URL="jdbc:postgresql://$(kubectl get svc -n polaris postgres -o jsonpath='{.spec.clusterIP}'):5432/POLARIS" \ | ||
| apache/polaris-admin-tool:latest \ | ||
| bootstrap -c POLARIS,root,pass -r POLARIS | ||
| ``` | ||
|
|
||
| ### Uninstalling | ||
|
|
||
| ```bash | ||
| kill $(lsof -ti :8181) $(lsof -ti :5432) | ||
|
|
||
| helm uninstall --namespace polaris polaris | ||
|
|
||
| kubectl delete --namespace polaris -f helm/polaris/ci/fixtures/ | ||
|
|
@@ -144,11 +152,13 @@ The following tools are required to run the tests: | |
|
|
||
| * [Helm Unit Test](https://github.com/helm-unittest/helm-unittest) | ||
| * [Chart Testing](https://github.com/helm/chart-testing) | ||
| * [yamllint](https://github.com/adrienverge/yamllint) | ||
|
|
||
| Quick installation instructions for these tools: | ||
| ```bash | ||
| helm plugin install https://github.com/helm-unittest/helm-unittest.git | ||
| brew install chart-testing | ||
| brew install yamllint | ||
| ``` | ||
|
|
||
| The integration tests also require some fixtures to be deployed. The `ci/fixtures` directory | ||
|
|
||

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.
Explicitly pulling isn't needed, Helm will pull images automatically if
imagePullPolicy:IfNotPresentorAlwaysis configured in the chart (which it is by default for most charts). All we need here is: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 isn't for Helm, but for the kubelet inside Minikube. The kubelet can only download images if they are publicly available.
If the image is from a private registry, or only present locally in the host machine (e.g. because you built a custom
apache/polaris:latestimage from sources and you want to use it), then this instruction is necessary.All in all, I think it's fine to leave the instructions.
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.
Thanks for the clarification, that makes sense. Good point about the kubelet behavior inside Minikube. I agree it’s fine to keep the
minikube image pullinstructions for users running with private or locally built images.That said, I still think it’d be clearer to separate the doc into two sections, one for the standard “Helm install from the official repo” path, and another “advanced / from source” section for developers. This way, most users can follow the simple flow without extra steps, while contributors still have the detailed Minikube setup if needed. More details are in this comment, #2939 (review).
Uh oh!
There was an error while loading. Please reload this page.
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.
Thanks @flyrain for your comments. I agree that clear separation of "user" and "dev" flows is a good thing - I remember there was even an initiative to clearly split all of Polaris documentation that way.
Regarding this particular document, there is a couple of things to consider:
So maybe it makes sense to create a separate document for a standard path and add a link to advanced path to it, wdyt?
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.
Thanks for the reply. I think it's more reasonable to put them in one place. Even helm chart was downloaded or github repo was cloned, user don't need or want to rebuild docker image, etc. In fact, helm chart can be downloaded separately without other Polaris source code, users won't be able to build the docker image in that case.