Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ SHELL = /usr/bin/env bash -o pipefail
BUILD_IMAGE ?= true
DOCKER ?= docker
MINIKUBE_PROFILE ?= minikube
DEPENDENCIES ?= ct helm helm-docs java21 git
DEPENDENCIES ?= ct helm helm-docs java21 git yamllint
OPTIONAL_DEPENDENCIES := jq kubectl minikube
VENV_DIR := .venv
PYTHON_CLIENT_DIR := client/python
Expand Down Expand Up @@ -217,7 +217,7 @@ helm-unittest: check-dependencies ## Run Helm chart unittest
@helm unittest helm/polaris
@echo "--- Helm chart unittest complete ---"

helm-lint: DEPENDENCIES := ct
helm-lint: DEPENDENCIES := ct yamllint
.PHONY: helm-lint
helm-lint: check-dependencies ## Run Helm chart lint check
@echo "--- Running Helm chart linting ---"
Expand Down
101 changes: 85 additions & 16 deletions helm/polaris/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,80 @@ A Helm chart for Apache Polaris (incubating).

## Installation

### Running locally with a Minikube cluster
The instructions below are for the local Minikube cluster. They assume Minikube and Helm are installed.

The below instructions assume Minikube and Helm are installed.
### Installing from the official repository (recommended)

Start the Minikube cluster, build and load image into the Minikube cluster:
Start the Minikube cluster, add the official Polaris Helm repository, create the target namespace, and install the chart:
```bash
minikube start
helm repo add polaris https://downloads.apache.org/incubator/polaris/helm-chart
helm repo update
kubectl create namespace polaris
helm install polaris polaris/polaris --namespace polaris --devel
```

> [!NOTE]
> The --devel flag is required while Polaris is in the incubation phase.
> Helm treats the -incubating suffix as a pre‑release by SemVer rules, and will skip charts that are not in a stable versioning scheme by default.

Now the cluster should be up and running. You can run the built-in connection test to verify:
```bash
helm test polaris --namespace polaris
```

Default Polaris Helm chart values are for a non-persistent backend. To use a persistent backend, you will need to override default values and create required resources.
Polaris Helm chart package includes a number of files that can be used as a starting point for such configuration. To use them, download the chart into a local directory:
```bash
helm pull polaris \
--repo https://downloads.apache.org/incubator/polaris/helm-chart \
--devel \
--untar \
--untardir ./helm
```

> [!WARNING]
> The examples below use values files located in the `helm/polaris/ci` directory.
> **These files are intended for testing purposes primarily, and may not be suitable for production use**.
> For production deployments, create your own values files based on the provided examples.

Create required resources:
```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
```

> [!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:
```bash
helm upgrade --install --namespace polaris \
--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
```

Run the catalog bootstrap using the Polaris admin tool to initialize the catalog with the required configuration.
For example, to run it as a new pod in the Minikube cluster (the polaris-admin-tool image will be pulled automatically from Docker Hub):
```bash
kubectl run polaris-bootstrap \
-n polaris \
--image=apache/polaris-admin-tool:latest \
--restart=Never \
--rm -it \
--env="quarkus.datasource.username=$(kubectl get secret polaris-persistence -n polaris -o jsonpath='{.data.username}' | base64 --decode)" \
--env="quarkus.datasource.password=$(kubectl get secret polaris-persistence -n polaris -o jsonpath='{.data.password}' | base64 --decode)" \
--env="quarkus.datasource.jdbc.url=$(kubectl get secret polaris-persistence -n polaris -o jsonpath='{.data.jdbcUrl}' | base64 --decode)" \
-- \
bootstrap -r POLARIS -c POLARIS,root,pass -p
```

### Build and install from source (advanced)

Here it is assumed that you have cloned the Polaris Git repository and set up prerequisites to build the project (see [Quickstart Guide](https://polaris.apache.org/in-dev/unreleased/getting-started/install-dependencies/) for details).

Start the Minikube cluster, then build and load the image into the Minikube cluster:

```bash
minikube start
Expand All @@ -60,12 +129,6 @@ eval $(minikube docker-env)
-Dquarkus.container-image.build=true
```

### Installing the chart locally

The below instructions assume a local Kubernetes cluster is running and Helm is installed.

#### Common setup

Create the target namespace:
```bash
kubectl create namespace polaris
Expand All @@ -75,7 +138,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. For example, you can run the following commands:
```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.

Expand All @@ -86,7 +153,7 @@ Below are two sample deployment models for installing the chart: one with a non-

#### Non-persistent backend

Install the chart with a non-persistent backend. From Polaris repo root:
Install the chart with a non-persistent backend. From the Polaris repo root:
```bash
helm upgrade --install --namespace polaris \
polaris helm/polaris
Expand All @@ -97,19 +164,19 @@ helm upgrade --install --namespace polaris \
> [!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:
Install the chart with a persistent backend. From the Polaris repo root:
```bash
helm upgrade --install --namespace polaris \
--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
```

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 is needed for bootstrap processes):
```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:
Expand Down Expand Up @@ -142,11 +209,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
Expand All @@ -156,7 +225,7 @@ 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 will be used to install the chart with
The `helm/polaris/ci` directory contains a number of values files that will be used to install the chart with
different configurations.

### Running the unit tests
Expand Down
104 changes: 87 additions & 17 deletions helm/polaris/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,81 @@ weight: 675

## Installation

### Running locally with a Minikube cluster
The instructions below are for the local Minikube cluster. They assume Minikube and Helm are installed.

The below instructions assume Minikube and Helm are installed.
### Installing from the official repository (recommended)

Start the Minikube cluster, build and load image into the Minikube cluster:
Start the Minikube cluster, add the official Polaris Helm repository, create the target namespace, and install the chart:
```bash
minikube start
helm repo add polaris https://downloads.apache.org/incubator/polaris/helm-chart
helm repo update
kubectl create namespace polaris
helm install polaris polaris/polaris --namespace polaris --devel
```

> [!NOTE]
> The --devel flag is required while Polaris is in the incubation phase.
> Helm treats the -incubating suffix as a pre‑release by SemVer rules, and will skip charts that are not in a stable versioning scheme by default.

Now the cluster should be up and running. You can run the built-in connection test to verify:
```bash
helm test polaris --namespace polaris
```

Default Polaris Helm chart values are for a non-persistent backend. To use a persistent backend, you will need to override default values and create required resources.
Polaris Helm chart package includes a number of files that can be used as a starting point for such configuration. To use them, download the chart into a local directory:
```bash
helm pull polaris \
--repo https://downloads.apache.org/incubator/polaris/helm-chart \
--devel \
--untar \
--untardir ./helm
```

> [!WARNING]
> The examples below use values files located in the `helm/polaris/ci` directory.
> **These files are intended for testing purposes primarily, and may not be suitable for production use**.
> For production deployments, create your own values files based on the provided examples.

Create required resources:
```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
```

> [!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:
```bash
helm upgrade --install --namespace polaris \
--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
```

Run the catalog bootstrap using the Polaris admin tool to initialize the catalog with the required configuration.
For example, to run it as a new pod in the Minikube cluster (the polaris-admin-tool image will be pulled automatically from Docker Hub):
```bash
kubectl run polaris-bootstrap \
-n polaris \
--image=apache/polaris-admin-tool:latest \
--restart=Never \
--rm -it \
--env="quarkus.datasource.username=$(kubectl get secret polaris-persistence -n polaris -o jsonpath='{.data.username}' | base64 --decode)" \
--env="quarkus.datasource.password=$(kubectl get secret polaris-persistence -n polaris -o jsonpath='{.data.password}' | base64 --decode)" \
--env="quarkus.datasource.jdbc.url=$(kubectl get secret polaris-persistence -n polaris -o jsonpath='{.data.jdbcUrl}' | base64 --decode)" \
-- \
bootstrap -r POLARIS -c POLARIS,root,pass -p
```


### Build and install from source (advanced)

Here it is assumed that you have cloned the Polaris Git repository and set up prerequisites to build the project (see [Quickstart Guide](https://polaris.apache.org/in-dev/unreleased/getting-started/install-dependencies/) for details).

Start the Minikube cluster, then build and load the image into the Minikube cluster:

```bash
minikube start
Expand All @@ -62,12 +132,6 @@ eval $(minikube docker-env)
-Dquarkus.container-image.build=true
```

### Installing the chart locally

The below instructions assume a local Kubernetes cluster is running and Helm is installed.

#### Common setup

Create the target namespace:
```bash
kubectl create namespace polaris
Expand All @@ -76,8 +140,12 @@ kubectl create namespace polaris
Create all the required resources in the `polaris` namespace. This usually includes a Postgres
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.
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. For example, you can run the following commands:
```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.

Expand All @@ -88,7 +156,7 @@ Below are two sample deployment models for installing the chart: one with a non-

#### Non-persistent backend

Install the chart with a non-persistent backend. From Polaris repo root:
Install the chart with a non-persistent backend. From the Polaris repo root:
```bash
helm upgrade --install --namespace polaris \
polaris helm/polaris
Expand All @@ -99,19 +167,19 @@ helm upgrade --install --namespace polaris \
> [!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:
Install the chart with a persistent backend. From the Polaris repo root:
```bash
helm upgrade --install --namespace polaris \
--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
```

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 is needed for bootstrap processes):
```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:
Expand Down Expand Up @@ -144,11 +212,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
Expand All @@ -158,7 +228,7 @@ 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 will be used to install the chart with
The `helm/polaris/ci` directory contains a number of values files that will be used to install the chart with
different configurations.

### Running the unit tests
Expand Down
Loading