MonkeyCanCode commented on code in PR #1243:
URL: https://github.com/apache/polaris/pull/1243#discussion_r2011299640
##########
helm/polaris/README.md:
##########
@@ -96,35 +96,90 @@ eval $(minikube -p minikube docker-env)
The below instructions assume a local Kubernetes cluster is running and Helm
is installed.
+#### Common setup
+
Create and populate the target namespace:
```bash
kubectl create namespace polaris
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
+```
+
+The `helm/polaris/ci` contains a number of values files that can be used to
install the chart with
+different configurations.
+
+You can also run `ct` (chart-testing):
+
+```bash
+ct lint --charts helm/polaris
+ct install --namespace polaris --debug --charts ./helm/polaris
```
-Finally, install the chart. From Polaris repo root:
+Below are two sample deployment models for installing the chart: one with a
non-persistent backend and another with a persistent backend.
+
+#### Non-persistent backend
+
+Install the chart with a non-persistent backend. From Polaris repo root:
```bash
helm upgrade --install --namespace polaris \
--debug --values helm/polaris/ci/simple-values.yaml \
polaris helm/polaris
```
-The `helm/polaris/ci` contains a number of values files that can be used to
install the chart with
-different configurations.
+#### Persistent backend
-You can also run `ct` (chart-testing):
+> [!WARNING]
+> The Postgres deployment set up in the fixtures directory is intended for
testing purposes only and is not suitable for production use. For production
deployments, use a managed Postgres service or a properly configured and
secured Postgres instance.
+
+Install the chart with a persistent backend. From Polaris repo root:
```bash
-ct lint --charts helm/polaris
-ct install --namespace polaris --debug --charts ./helm/polaris
+helm upgrade --install --namespace polaris \
+ --debug --values helm/polaris/ci/persistence-values.yaml \
+ polaris helm/polaris
+
+kubectl wait --namespace polaris --for=condition=ready pod
--selector=app.kubernetes.io/name=polaris --timeout=120s
+```
+
+After deploying the chart with a persistent backend, the `persistence.xml`
file, originally loaded into the Kubernetes pod via a secret, can be accessed
locally if needed. This file contains the persistence configuration required
for the next steps. Use the following command to retrieve it:
+
+```bash
+kubectl exec -it -n polaris $(kubectl get pod -n polaris -l
app.kubernetes.io/name=polaris -o jsonpath='{.items[0].metadata.name}') -- cat
/deployments/config/persistence.xml > persistence.xml
+```
+
+The `persistence.xml` file references the Postgres hostname as postgres.
Update it to localhost to enable local connections:
+
+```bash
+sed -i .bak 's/postgres:/localhost:/g' persistence.xml
Review Comment:
We can't. This is because when this file got loaded into the pod, it is via
k8s secret. Then this file uses the internal DNS record of Postges's SVC to do
the routing. Thus, within the k8s pod, postgres will resolve thus being able to
route traffic from Polaris pod to Postgres pod. Alternative will have a diff
file but set to localhost (a bit duplicate). The whole reason on localhost is
because the port forwarding piece where we are port forwarding k8s Postgres pod
to local.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]