Skip to content
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

Add support for using Oxia as the metadata store for Pulsar and BookKeeper #544

Merged
merged 68 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
4de4f7e
change oxia templates
yuweisung Nov 6, 2024
8b2eff2
add oxia templates
yuweisung Nov 6, 2024
b9532b8
change to Apache license.
yuweisung Nov 8, 2024
205eaf6
add oxia to pulsar-init-job
yuweisung Nov 11, 2024
782988c
licenses
yuweisung Nov 11, 2024
496daa4
fix comment space
yuweisung Nov 12, 2024
79927af
add namespace and name
yuweisung Nov 12, 2024
d325c12
fix pvc name
yuweisung Nov 12, 2024
4438a4f
fix doublequotes
yuweisung Nov 13, 2024
33bfdc1
fix more doublequotes
yuweisung Nov 13, 2024
5f6fcd3
remove outputfile
yuweisung Nov 13, 2024
8c09109
fix init container
yuweisung Nov 13, 2024
3b3280e
fixing init job
yuweisung Nov 14, 2024
6d8ded4
fixing init job
yuweisung Nov 14, 2024
2cbedf5
fixed init script
yuweisung Nov 14, 2024
6baf0c0
fix syntax
yuweisung Nov 14, 2024
1a2437a
add oxia values example
yuweisung Nov 14, 2024
c8750a1
rollback gitignore
yuweisung Nov 14, 2024
989172f
fix bookie common tpl
yuweisung Nov 14, 2024
24fa456
add metastore timeout
yuweisung Nov 14, 2024
817803e
Test Oxia in CI
lhotari Nov 20, 2024
c94546d
Make the default for configurationStorePort to be 6648 when oxia is e…
lhotari Nov 20, 2024
31579ff
Add license header and minimize the example
lhotari Nov 20, 2024
1ee80a2
Disable wait-zookeeper-ready init containers when zookeeper isn't ena…
lhotari Nov 20, 2024
27e4d73
Fix template name
lhotari Nov 20, 2024
826eaff
Fix TLS issue in pulsar-cluster-initialize.yaml template
lhotari Nov 20, 2024
b094b1a
Fix oxia-server-statefulset volume name
lhotari Nov 20, 2024
5476ee2
Fix issue: sh: nslookuppulsar-ci-oxia-svc: not found
lhotari Nov 20, 2024
c7b4406
Don't run zookeeper-shell in bookkeeper-cluster-initialize unless zoo…
lhotari Nov 20, 2024
02ce2f0
Set export BOOKIE_MEM="-Xmx128M" in all verify_cluster_id init contai…
lhotari Nov 20, 2024
e02ca57
Configure Oxia for BookKeeper
lhotari Nov 20, 2024
2a549a1
Start adding Oxia config for broker and bookkeeper
lhotari Nov 20, 2024
e501e20
Use pulsar.oxia.connect template
lhotari Nov 20, 2024
4e0b4c2
Configure broker and bookkeeper namespaces in Oxia
lhotari Nov 21, 2024
491dae9
Rename template oxia.coordinator.CMProperties to oxia.coordinator.con…
lhotari Nov 21, 2024
bc7fe2e
Improve oxia configuration
lhotari Nov 21, 2024
491ecd2
Limit configurationStore, configurationStoreMetadataPrefix and config…
lhotari Nov 21, 2024
414ca4c
Merge remote-tracking branch 'origin/master' into add-oxia-subchart
lhotari Nov 21, 2024
a9fa703
Improve condition for wait timeout
lhotari Nov 21, 2024
e525de2
Improve clarity of Oxia configuration for memory limits
lhotari Nov 21, 2024
8cad538
Revert changes to _configurationstore.tpl
lhotari Nov 21, 2024
3308274
Add missing space
lhotari Nov 21, 2024
598d5d4
Make broker startup work for Oxia
lhotari Nov 21, 2024
21fd39d
Revert changes to .gitignore
lhotari Nov 21, 2024
fc319c9
Remove invalid rules in oxia-coordinator-role
lhotari Nov 21, 2024
650cdfe
Add "Limit" postfix to coordinator limits in values.yaml
lhotari Nov 21, 2024
50d4986
Use podmonitor to enable metrics for Oxia coordinator and server comp…
lhotari Nov 21, 2024
682a51f
Remove redundant servicemonitor templates
lhotari Nov 21, 2024
e57c050
Enable oxia podmonitors only when oxia is enabled
lhotari Nov 21, 2024
cd4b293
fix oxia tpl
yuweisung Nov 21, 2024
2ec9cd5
Use similar solution for matchLabels and labels in Oxia components as…
lhotari Nov 21, 2024
4564332
Validate Oxia templates with kubeconform
lhotari Nov 21, 2024
1255018
Fix extra args logging
lhotari Nov 21, 2024
3d9abca
Wait for Oxia in initialization
lhotari Nov 21, 2024
ea2f387
Wait for Oxia before bookkeeper initialization
lhotari Nov 21, 2024
c26126b
Add waiting for Oxia before broker and proxy get started
lhotari Nov 21, 2024
c4ec6bf
Use most recent Oxia version
lhotari Nov 21, 2024
f1bbc4f
Add default shard
lhotari Nov 21, 2024
39319b5
Downgrade Oxia to 0.8.0 to match oxia-java 0.4.5
lhotari Nov 21, 2024
7f2909f
Use public port for connecting
lhotari Nov 21, 2024
d58676c
Add mandatory configuration-store parameter to initialization
lhotari Nov 21, 2024
8a0bd8f
Revert "Downgrade Oxia to 0.8.0 to match oxia-java 0.4.5"
lhotari Nov 21, 2024
214a8b0
Add support for nodeSelector, tolerations, topologySpreadConstraints,…
lhotari Nov 21, 2024
02c7f98
Trim trailing whitespace
lhotari Nov 21, 2024
053a4e3
Specify configurationMetadataStoreUrl
lhotari Nov 21, 2024
7740a2d
Don't enable state store unless Zookeeper is used
lhotari Nov 22, 2024
bf3ee75
Revert "Don't enable state store unless Zookeeper is used"
lhotari Nov 22, 2024
9c78dfb
Disable testing functions with Oxia
lhotari Nov 22, 2024
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
2 changes: 1 addition & 1 deletion charts/pulsar/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,4 @@ Lookup pull policy, default to defaultPullPolicy
*/}}
{{- define "pulsar.imagePullPolicy" -}}
{{- printf "%s" (.image.pullPolicy | default .root.Values.defaultPullPolicy) -}}
{{- end -}}
{{- end -}}
87 changes: 87 additions & 0 deletions charts/pulsar/templates/_oxia.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{{/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/}}

{{/*
Coordinator labels
*/}}
{{- define "oxia-cluster.coordinator.labels" -}}
{{ include "oxia-cluster.coordinator.selectorLabels" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/part-of: oxia
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Coordinator selector labels
*/}}
{{- define "oxia-cluster.coordinator.selectorLabels" -}}
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/component: coordinator
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Server labels
*/}}
{{- define "oxia-cluster.server.labels" -}}
{{ include "oxia-cluster.server.selectorLabels" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Server selector labels
*/}}
{{- define "oxia-cluster.server.selectorLabels" -}}
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/component: server
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Probe
*/}}
{{- define "oxia-cluster.probe" -}}
exec:
command: ["oxia", "health", "--port={{ . }}"]
initialDelaySeconds: 10
timeoutSeconds: 10
{{- end }}


{{/*
Probe
*/}}
{{- define "oxia-cluster.readiness-probe" -}}
exec:
command: ["oxia", "health", "--port={{ . }}", "--service=oxia-readiness"]
initialDelaySeconds: 10
timeoutSeconds: 10
{{- end }}

{{/*
Probe
*/}}
{{- define "oxia-cluster.startup-probe" -}}
exec:
command: ["oxia", "health", "--port={{ . }}"]
initialDelaySeconds: 60
timeoutSeconds: 10
{{- end }}

37 changes: 37 additions & 0 deletions charts/pulsar/templates/oxia-coordinator-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{{/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/}}

apiVersion: v1
kind: ConfigMap
metadata:
labels:
{{- include "oxia-cluster.coordinator.labels" . | nindent 4 }}
name: {{ .Release.Name }}-coordinator
data:
config.yaml: |
namespaces:
- name: default
initialShardCount: {{ .Values.oxia.initialShardCount }}
replicationFactor: {{ .Values.oxia.replicationFactor }}
servers:
{{- $vars := dict "name" .Release.Name "namespace" .Release.Namespace "public" .Values.oxia.server.ports.public "internal" .Values.oxia.server.ports.internal }}
{{- range until (int .Values.oxia.server.replicas) }}
- public: {{ $vars.name }}-{{ . }}.{{ $vars.name }}-svc.{{ $vars.namespace }}.svc.cluster.local:{{ $vars.public }}
internal: {{ $vars.name }}-{{ . }}.{{ $vars.name }}-svc:{{ $vars.internal }}
{{- end }}
71 changes: 71 additions & 0 deletions charts/pulsar/templates/oxia-coordinator-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{{/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/}}

apiVersion: apps/v1
kind: Deployment
metadata:
labels:
{{- include "oxia-cluster.coordinator.labels" . | nindent 4 }}
name: {{ .Release.Name }}-coordinator
spec:
replicas: 1
selector:
matchLabels:
{{- include "oxia-cluster.coordinator.selectorLabels" . | nindent 6 }}
strategy:
type: Recreate
template:
metadata:
annotations:
prometheus.io/port: "{{ .Values.oxia.coordinator.ports.metrics }}"
prometheus.io/scrape: "{{ .Values.oxia.monitoringEnabled }}"
labels:
oxia_cluster: {{ .Release.Name }}
{{- include "oxia-cluster.coordinator.labels" . | nindent 8 }}
name: {{ .Release.Name }}-coordinator
spec:
serviceAccountName: {{ .Release.Name }}-coordinator
containers:
- command:
- "oxia"
- "coordinator"
- "--conf=configmap:{{ .Release.Namespace }}/{{ .Release.Name }}-coordinator"
- "--log-json"
- "--metadata=configmap"
- "--k8s-namespace={{ .Release.Namespace }}"
- "--k8s-configmap-name={{ .Release.Name }}-status"
{{- if .Values.oxia.pprofEnabled }}
- "--profile"
{{- end}}
image: "{{ .Values.images.oxia.repository }}:{{ .Values.images.oxia.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.images.oxia.pullPolicy }}
name: coordinator
ports:
{{- range $key, $value := .Values.oxia.coordinator.ports }}
- containerPort: {{ $value | int }}
name: {{ $key }}
{{- end}}
resources:
limits:
cpu: {{ .Values.oxia.coordinator.cpu }}
memory: {{ .Values.oxia.coordinator.memory }}
livenessProbe:
{{- include "oxia-cluster.probe" .Values.oxia.coordinator.ports.internal | nindent 12 }}
readinessProbe:
{{- include "oxia-cluster.probe" .Values.oxia.coordinator.ports.internal | nindent 12 }}
32 changes: 32 additions & 0 deletions charts/pulsar/templates/oxia-coordinator-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/}}

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
{{- include "oxia-cluster.coordinator.labels" . | nindent 4 }}
name: {{ .Release.Name }}-coordinator
rules:
- apiGroups: [ "" ]
resources: [ "configmaps" ]
verbs: [ "*" ]
- apiGroups: [ "oxia.streamnative.io" ]
resources: [ "oxiaclusters" ]
verbs: [ "get", "update" ]
33 changes: 33 additions & 0 deletions charts/pulsar/templates/oxia-coordinator-rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/}}

apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
{{- include "oxia-cluster.coordinator.labels" . | nindent 4 }}
name: {{ .Release.Name }}-coordinator
subjects:
- kind: ServiceAccount
name: {{ .Release.Name }}-coordinator
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: ""
kind: Role
name: {{ .Release.Name }}-coordinator
35 changes: 35 additions & 0 deletions charts/pulsar/templates/oxia-coordinator-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/}}

apiVersion: v1
kind: Service
metadata:
labels:
oxia_cluster: {{ .Release.Name }}
{{- include "oxia-cluster.coordinator.labels" . | nindent 4 }}
name: {{ .Release.Name }}-coordinator
spec:
ports:
{{- range $key, $value := .Values.oxia.coordinator.ports }}
- name: {{ $key }}
port: {{ $value }}
targetPort: {{ $key }}
{{- end}}
selector:
{{- include "oxia-cluster.coordinator.selectorLabels" . | nindent 4 }}
29 changes: 29 additions & 0 deletions charts/pulsar/templates/oxia-coordinator-serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/}}

apiVersion: v1
kind: ServiceAccount
metadata:
labels:
{{- include "oxia-cluster.coordinator.labels" . | nindent 4 }}
name: {{ .Release.Name }}-coordinator
{{- if .Values.images.imagePullSecrets }}
imagePullSecrets:
- name: {{ .Values.images.imagePullSecrets.secretName }}
{{- end}}
34 changes: 34 additions & 0 deletions charts/pulsar/templates/oxia-coordinator-servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/}}
{{- if .Values.monitoringEnabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
{{- include "oxia-cluster.coordinator.labels" . | nindent 4 }}
name: {{ .Release.Name }}-coordinator
spec:
endpoints:
- port: metrics
selector:
matchLabels:
{{- include "oxia-cluster.coordinator.selectorLabels" . | nindent 6 }}
targetLabels:
- oxia_cluster
{{- end }}
Loading
Loading