Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Helm chart redesign for Quarkus-based runtimes #626

Merged
merged 8 commits into from
Feb 11, 2025

Conversation

adutra
Copy link
Contributor

@adutra adutra commented Jan 8, 2025

This is a major redesign of the Helm chart to make it compliant with Quarkus, but also improving a lot of aspects of the existing chart, such as the persistence secret management and the bootstrap jobs, to name a few.

Summary of changes

Persistence

Thanks to the improvement brought by #613, it's not necessary anymore to have an init container create a conf.jar. From now on, the user provides a secret with their persistence.xml, and that file is mounted on each Polaris pod directly.

Enhanced services

The services for Polaris now are separated in 3 categories:

  1. Main service: the service that serves API requests; it is usually behind an Ingress or LoadBalancer
  2. Management service: the service for metrics and health; this is usually ClusterIP and headless
  3. Extra services: if any of the services needs to be exposed with different settings to different consumers, this section can be used.

Each service section has the same structure and allows to configure one or more ports.

Observability

New sections were added for logging, tracing, metrics, with also the ability to create a ServiceMonitor.

Bootstrap Job

The bootstrap section now configures the bootstrap job. Thanks to the Polaris Admin Tool introduced in #605, the jobs now use the tool to bootstrap realms.

I am not convinced personally that this bootstrap job has a huge value, compared to just running the admin tool directly. But I didn't want to remove it.

Advanced Config

A new advancedConfig section can be used to customize Polaris deployments in any possible way, even when the Helm chart does not expose the desired setting.

@adutra adutra force-pushed the quarkus-helm branch 4 times, most recently from 09657d1 to f66d623 Compare January 8, 2025 17:21
@adutra adutra force-pushed the quarkus-helm branch 13 times, most recently from 0ac047b to 434a847 Compare January 13, 2025 21:36
@adutra adutra force-pushed the quarkus-helm branch 3 times, most recently from 68cbdfc to acee0c9 Compare January 15, 2025 09:50
@adutra adutra changed the title [WIP] Helm chart redesign for Quarkus-based runtimes Helm chart redesign for Quarkus-based runtimes Jan 24, 2025
```

### Uninstalling the chart

```bash
$ helm uninstall --namespace polaris polaris
helm uninstall --namespace polaris polaris
```

## Values
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this is automatically generated by helm-docs.

@adutra adutra marked this pull request as ready for review January 24, 2025 16:51
@adutra adutra force-pushed the quarkus-helm branch 2 times, most recently from 8719049 to 957553e Compare February 1, 2025 15:57
@@ -79,7 +79,7 @@ jobs:
if: steps.list-changed.outputs.changed == 'true'
run: |
helm plugin install https://github.com/helm-unittest/helm-unittest.git || true
helm unittest helm/polaris
helm unittest helm/polaris 2> >(grep -v 'found symbolic link' >&2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With https://github.com/apache/polaris/pull/912/files, we will need only the original command without filter out the warning messages due to symbolic link.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! I'm just waiting for #912 to be merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#912 is merged! I removed the workaround.


```bash
$ helm install polaris helm/polaris --namespace polaris --create-namespace
helm unittest helm/polaris 2> >(grep -v 'found symbolic link' >&2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above if we should merge https://github.com/apache/polaris/pull/912/files first then remove the filter part.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

<property name="jakarta.persistence.jdbc.url" value="jdbc:h2:mem:polaris-{realm}"/>
<property name="jakarta.persistence.jdbc.user" value="sa"/>
<property name="jakarta.persistence.jdbc.password" value=""/>
<property name="jakarta.persistence.jdbc.url"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EclipseLink uses a default of 32 connections for connection pooling. For local testing, this is more than enough. If people want to use it for some load testing, this will suffer when there are many concurrent client connection. Do you think we may want to add an example or add the default value here? So for people who may not be familiar with EclipseLink, they can just change the max value etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I added the following:

          <property name="eclipselink.connection-pool.default.initial" value="1" />
          <property name="eclipselink.connection-pool.default.min" value="1" />
          <property name="eclipselink.connection-pool.default.max" value="1" />

{{- $global := . -}}
{{- range $k, $v := $map }}
{{ include "polaris.appendConfigOption" (list $k $v $global) }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits: extra space between "list $k"

tag: "latest"
# -- The path to the directory where the application.properties file, and other configuration
# files, if any, should be mounted.
configDir: /deployments/config
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a similar comment here for the file listing issue (#907)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, done

@adutra adutra force-pushed the quarkus-helm branch 2 times, most recently from 4d36036 to ac643dc Compare February 4, 2025 12:41
@flyrain
Copy link
Contributor

flyrain commented Feb 4, 2025

cc @gh-yzou

<property name="jakarta.persistence.schema-generation.database.action" value="create"/>
<property name="eclipselink.logging.level.sql" value="FINE"/>
<property name="eclipselink.logging.parameters" value="true"/>
<property name="eclipselink.persistence-context.flush-mode" value="auto"/>
<property name="eclipselink.connection-pool.default.initial" value="1" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does that mean by default we will have a connection pool with size 1? maybe we should mention this in the read me, and along with some instruction about how to adjust the size

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only for CI tests.

type: Opaque
stringData:
access-key: "my-key"
secret-key: "my-secret"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new line

stringData:
private.pem: |-
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDiae5jQnQ+Dt8Optpa4fLNuUfI
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where does the private key and public key coming from ? will we be able to generate it on fly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just for tests. They were randomly generated and do not contain any sensitive information. I will add a comment.

internalTrafficPolicy: Cluster
externalTrafficPolicy: Cluster
ports:
- name: polaris-http
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that two ports one for icebergRestCatalog service, and another one for OAuth service?

Copy link
Contributor Author

@adutra adutra Feb 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is just for tests and contains "bogus" data that does not necessarily reflect how extraServices will be used in real life, because in these tests we cannot create load balancers, ingresses, etc.

The typical use case for extraServices is:

  • User wants port 8181 to be exposed to internal clients (in the same namespace) using a ClusterIP service.
  • User also wants to expose port 8181 using a LoadBalancer service, for consumption by external clients (potentially with TLS termination, etc.)

This can be achieved by simply leaving service and managementService untouched, and adding the following config:

extraServices:
  - nameSuffix: "ext"
    type: LoadBalancer
    ports:
    - name: polaris-http
      port: 8181

Assuming the release name is my-release, the above will generate the following services:

  • my-release of type ClusterIP for port 8181;
  • my-release-ext of type LoadBalancer for port 8181;
  • my-release-mgmt service of type ClusterIP (headless) for port 8182.

@adutra
Copy link
Contributor Author

adutra commented Feb 6, 2025

@MonkeyCanCode @gh-yzou while answering a question from @gh-yzou I realized that I forgot to set ClusterIP: None (headless) by default for the management service. I just fixed it in the last commit. It's common practice to use headless services for healthchecks and metrics scraping. Let me know if you are OK.

@adutra
Copy link
Contributor Author

adutra commented Feb 7, 2025

@MonkeyCanCode @gh-yzou should we move forward with this? I would suggest to merge unless you see any blockers, then we can always keep improving the chart after the merge. It's not like we are going to do a release of the chart any time soon 😄

@gh-yzou
Copy link
Contributor

gh-yzou commented Feb 7, 2025

@adutra i don't have other further questions, but i am not familiar with this part, so I will let @MonkeyCanCode and @collado-mike to do the final approval on this. You don't have to wait for me to approve this.

@MonkeyCanCode
Copy link
Contributor

@adutra i don't have other further questions, but i am not familiar with this part, so I will let @MonkeyCanCode and @collado-mike to do the final approval on this. You don't have to wait for me to approve this.

Thought I clicked on approved earlier. Approved. Very well done.

@adutra
Copy link
Contributor Author

adutra commented Feb 11, 2025

Heads up: I am going to merge this now to unblock people looking for node port support, see #982.

@adutra adutra merged commit 08b67b7 into apache:main Feb 11, 2025
5 checks passed
@adutra adutra deleted the quarkus-helm branch February 11, 2025 12:48
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants