Skip to content

Commit ad0d480

Browse files
committed
Helm chart redesign for Quarkus-based runtimes
1 parent bc8acb4 commit ad0d480

32 files changed

+3557
-842
lines changed

.github/workflows/helm.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
if: steps.list-changed.outputs.changed == 'true'
8080
run: |
8181
helm plugin install https://github.com/helm-unittest/helm-unittest.git || true
82-
helm unittest helm/polaris
82+
helm unittest helm/polaris 2> >(grep -v 'found symbolic link' >&2)
8383
8484
- name: Run chart-testing (lint)
8585
if: steps.list-changed.outputs.changed == 'true'
@@ -99,9 +99,9 @@ jobs:
9999
if: steps.list-changed.outputs.changed == 'true'
100100
run: |
101101
eval $(minikube -p minikube docker-env)
102-
./gradlew :polaris-quarkus-server:assemble \
102+
./gradlew :polaris-quarkus-server:assemble :polaris-quarkus-admin:assemble \
103103
-Dquarkus.container-image.build=true \
104-
-PeclipseLinkDeps=com.h2database:h2:2.3.232
104+
-PeclipseLinkDeps=org.postgresql:postgresql:42.7.4
105105
minikube image ls
106106
107107
- name: Install fixtures

helm/polaris/README.md

+194-19
Large diffs are not rendered by default.

helm/polaris/README.md.gotmpl

+69-7
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
to you under the Apache License, Version 2.0 (the
77
"License"); you may not use this file except in compliance
88
with the License. You may obtain a copy of the License at
9-
9+
1010
http://www.apache.org/licenses/LICENSE-2.0
11-
11+
1212
Unless required by applicable law or agreed to in writing,
1313
software distributed under the License is distributed on an
1414
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -49,23 +49,85 @@
4949

5050
### Optional
5151

52-
When using a custom `persistence.xml`, a Kubernetes Secret must be created for `.persistenceConfigSecret`. Below is a sample command:
52+
When using a custom `persistence.xml`, a Kubernetes Secret must be created for it. Below is a sample command:
5353
```bash
5454
kubectl create secret generic polaris-secret -n polaris --from-file=persistence.xml
5555
```
5656

57-
### From local directory (for development purposes)
57+
### Running the unit tests
58+
59+
Helm unit tests do not require a Kubernetes cluster. To run the unit tests from the Polaris repo
60+
root:
61+
62+
```bash
63+
helm unittest helm/polaris 2> >(grep -v 'found symbolic link' >&2)
64+
```
65+
66+
Note: the `grep` command is used to filter out the annoying warning messages about symbolic links;
67+
see https://github.com/helm/helm/issues/7019.
68+
69+
### Running locally with a Kind cluster
70+
71+
The below instructions assume Kind and Helm are installed.
72+
73+
Simply run the `run.sh` script from the Polaris repo root, making sure to specify the
74+
`--eclipse-link-deps` option:
75+
76+
```bash
77+
./run.sh --eclipse-link-deps=org.postgresql:postgresql:42.7.4
78+
```
79+
80+
This script will create a Kind cluster, deploy a local Docker registry, build the Polaris Docker
81+
images with support for Postgres and load them into the Kind cluster. (It will also create an
82+
example Deployment and Service with in-memory storage.)
83+
84+
### Running locally with a Minikube cluster
85+
86+
The below instructions assume a Minikube cluster is already running and Helm is installed.
87+
88+
If necessary, build and load the Docker images with support for Postgres into Minikube:
89+
90+
```bash
91+
eval $(minikube -p minikube docker-env)
92+
93+
./gradlew :polaris-quarkus-server:assemble :polaris-quarkus-admin:assemble \
94+
-Dquarkus.container-image.build=true \
95+
-PeclipseLinkDeps=org.postgresql:postgresql:42.7.4
96+
```
97+
98+
### Installing the chart locally
99+
100+
The below instructions assume a local Kubernetes cluster is running and Helm is installed.
101+
102+
Create and populate the target namespace:
103+
104+
```bash
105+
kubectl create namespace polaris
106+
kubectl apply --namespace polaris -f helm/polaris/ci/fixtures/
107+
```
108+
109+
Finally, install the chart. From Polaris repo root:
110+
111+
```bash
112+
helm upgrade --install --namespace polaris \
113+
--debug --values helm/polaris/ci/simple-values.yaml \
114+
polaris helm/polaris
115+
```
116+
117+
The `helm/polaris/ci` contains a number of values files that can be used to install the chart with
118+
different configurations.
58119

59-
From Polaris repo root:
120+
You can also run `ct` (chart-testing):
60121

61122
```bash
62-
$ helm install polaris helm/polaris --namespace polaris --create-namespace
123+
ct lint --charts helm/polaris
124+
ct install --namespace polaris --debug --charts ./helm/polaris
63125
```
64126

65127
### Uninstalling the chart
66128

67129
```bash
68-
$ helm uninstall --namespace polaris polaris
130+
helm uninstall --namespace polaris polaris
69131
```
70132

71133
{{ template "chart.valuesSection" . }}
+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
image:
21+
pullPolicy: Never
22+
23+
service:
24+
type: ClusterIP
25+
sessionAffinity: ClientIP
26+
internalTrafficPolicy: Cluster
27+
externalTrafficPolicy: Cluster
28+
ports:
29+
- name: polaris-http
30+
port: 18181
31+
targetPort: 8181
32+
protocol: TCP
33+
- name: polaris-http2
34+
port: 28181
35+
targetPort: 8181
36+
protocol: TCP
37+
38+
extraServices:
39+
- nameSuffix: "ext"
40+
type: ClusterIP
41+
sessionAffinity: None
42+
internalTrafficPolicy: Local
43+
externalTrafficPolicy: Local
44+
ports:
45+
- name: polaris-http2
46+
port: 38181
47+
targetPort: 8181

helm/polaris/ci/fixtures/persistence.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ stringData:
3838
<class>org.apache.polaris.jpa.models.ModelSequenceId</class>
3939
<shared-cache-mode>NONE</shared-cache-mode>
4040
<properties>
41-
<property name="jakarta.persistence.jdbc.url" value="jdbc:h2:mem:polaris-{realm}"/>
42-
<property name="jakarta.persistence.jdbc.user" value="sa"/>
43-
<property name="jakarta.persistence.jdbc.password" value=""/>
41+
<property name="jakarta.persistence.jdbc.url"
42+
value="jdbc:postgresql://postgres:5432/{realm}"/>
43+
<property name="jakarta.persistence.jdbc.user" value="postgres"/>
44+
<property name="jakarta.persistence.jdbc.password" value="postgres"/>
4445
<property name="jakarta.persistence.schema-generation.database.action" value="create"/>
4546
<property name="eclipselink.logging.level.sql" value="FINE"/>
4647
<property name="eclipselink.logging.parameters" value="true"/>
+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
apiVersion: apps/v1
21+
kind: Deployment
22+
metadata:
23+
name: postgres
24+
spec:
25+
replicas: 1
26+
selector:
27+
matchLabels:
28+
app: postgres
29+
template:
30+
metadata:
31+
labels:
32+
app: postgres
33+
spec:
34+
containers:
35+
- name: postgres
36+
image: postgres:17.2
37+
ports:
38+
- containerPort: 5432
39+
resources:
40+
limits:
41+
memory: "128Mi"
42+
env:
43+
- name: POSTGRES_USER
44+
value: "postgres"
45+
- name: POSTGRES_PASSWORD
46+
value: "postgres"
47+
- name: POSTGRES_DB
48+
value: "POLARIS"
49+
- name: POSTGRES_INITDB_ARGS
50+
value: "--encoding UTF8 --data-checksums"
51+
readinessProbe:
52+
exec:
53+
command:
54+
- pg_isready
55+
- -U
56+
- postgres
57+
initialDelaySeconds: 5
58+
periodSeconds: 5
59+
timeoutSeconds: 2
60+
failureThreshold: 15
61+
---
62+
apiVersion: v1
63+
kind: Service
64+
metadata:
65+
name: postgres
66+
spec:
67+
selector:
68+
app: postgres
69+
ports:
70+
- protocol: TCP
71+
port: 5432
72+
targetPort: 5432

helm/polaris/ci/fixtures/storage.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
apiVersion: v1
21+
kind: Secret
22+
metadata:
23+
name: polaris-storage
24+
type: Opaque
25+
stringData:
26+
access-key: "my-key"
27+
secret-key: "my-secret"
+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
apiVersion: v1
21+
kind: Secret
22+
metadata:
23+
name: polaris-token-broker
24+
type: Opaque
25+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xGFaTVdZWlXQPFCdm+SNT4jZ1b8dZuIBYvwnpWuO/RDurfgAvmtX
58+
s/jMUwIDAQAB
59+
-----END PUBLIC KEY-----

helm/polaris/ci/persistence-values.yaml

+25-6
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,29 @@
2020
image:
2121
pullPolicy: Never
2222

23-
persistenceConfigSecret: polaris-persistence
23+
authentication:
24+
tokenBroker:
25+
secret:
26+
name: polaris-token-broker
2427

25-
polarisServerConfig:
26-
metaStoreManager:
27-
type: eclipse-link
28-
persistence-unit: polaris
29-
conf-file: /eclipselink-config/conf.jar!/persistence.xml
28+
logging:
29+
file:
30+
enabled: true
31+
json: true
32+
storage:
33+
size: 50Mi
34+
35+
persistence:
36+
type: eclipse-link
37+
eclipseLink:
38+
secret:
39+
name: polaris-persistence
40+
41+
bootstrap:
42+
enabled: true
43+
realms:
44+
- POLARIS
45+
credentials:
46+
- POLARIS,root,secret
47+
image:
48+
pullPolicy: Never

helm/polaris/ci/simple-values.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,13 @@
1919

2020
image:
2121
pullPolicy: Never
22+
23+
storage:
24+
secret:
25+
name: polaris-storage
26+
awsAccessKeyId: access-key
27+
awsSecretAccessKey: secret-key
28+
29+
extraEnv:
30+
- name: POLARIS_BOOTSTRAP_CREDENTIALS
31+
value: root,root,secret

0 commit comments

Comments
 (0)