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

feat: add ditto operator support #19

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 4 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
17 changes: 4 additions & 13 deletions charts/big-peer/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
dependencies:
- name: hades
repository: oci://quay.io/ditto-external
version: 1.39.2-4b6e4e
- name: hydra-consul
repository: oci://quay.io/ditto-external
- name: ditto-operator
repository: file://../../../ditto/charts/operator
Copy link
Contributor

Choose a reason for hiding this comment

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

We should update this to a public source.

version: 0.1.0
- name: hydra-store
repository: oci://quay.io/ditto-external
version: 1.39.2-4b6e4e
- name: hydra-subscription
repository: oci://quay.io/ditto-external
version: 1.39.2-4b6e4e
- name: service-token-validator
repository: oci://quay.io/ditto-external
version: 0.2.1
Expand All @@ -32,5 +23,5 @@ dependencies:
- name: kafka
repository: https://getditto.github.io/helm-charts/
version: 0.3.5
digest: sha256:32d2472e3b0c018b3fdfd462273c02adb7117b54a714ba13ce9be2a0888f663d
generated: "2025-01-10T10:55:30.13758089-06:00"
digest: sha256:c339f05abb1a9ec15d474bf62acd2e0054a3d3c6a6451ab904136c09d0b1990c
generated: "2025-01-10T17:20:20.622934-05:00"
31 changes: 7 additions & 24 deletions charts/big-peer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,13 @@ maintainers:
email: [email protected]
dependencies:
# Both longhorn and minio are used for storage, longhorn seems to be more robust
- name: hades
version: "1.39.2-4b6e4e"
repository: "oci://quay.io/ditto-external"
condition: hades.enabled
tags:
- hades
- name: hydra-consul
- name: ditto-operator
version: "0.1.0"
repository: "oci://quay.io/ditto-external"
condition: hydra-consul.enabled
tags:
- hydra-consul
- name: hydra-store
version: "1.39.2-4b6e4e"
repository: "oci://quay.io/ditto-external"
condition: hydra-store.enabled
tags:
- hydra-store
- name: hydra-subscription
version: "1.39.2-4b6e4e"
repository: "oci://quay.io/ditto-external"
condition: hydra-subscription.enabled
#repository: "oci://quay.io/ditto-external"
repository: "file://../../../ditto/charts/operator"
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

condition: ditto-operator.enabled
tags:
- hydra-subscription
- ditto-operator
- name: service-token-validator
version: "0.2.1"
repository: "oci://quay.io/ditto-external"
Expand Down Expand Up @@ -83,10 +66,10 @@ dependencies:
- kafka
- name: dummy-auth-webhook
repository: "oci://quay.io/ditto-external"
condition: dummy-auth-webhook.enabled
condition: big-peer-auth-webhook.enabled
version: "0.1.1"
tags:
- dummy-auth-webhook
- big-peer-auth-webhook
- name: live-query-resource-controller
alias: live-query
repository: "oci://quay.io/ditto-external"
Expand Down
10,214 changes: 0 additions & 10,214 deletions charts/big-peer/crds/ditto_v1alpha3_hydracluster_crd.yaml

This file was deleted.

9,208 changes: 0 additions & 9,208 deletions charts/big-peer/crds/ditto_v1alpha3_hydrapartition_crd.yaml

This file was deleted.

1 change: 1 addition & 0 deletions charts/big-peer/templates/bigpeer.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "common.bigpeer" . }}
104 changes: 104 additions & 0 deletions charts/big-peer/templates/classes/_ditto_deployment.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{{- define "common.bigpeer" -}}
{{- /* Generate big peer deployment config driven by ditto operator */ -}}
{{- $fullname := include "common.names.fullname" . -}}
{{- $values := index .Values "ditto-deployment" -}}
{{- $storageClassName := default "local-path" $values.storage.storage_class_name -}}
Copy link
Contributor

Choose a reason for hiding this comment

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

StorageClass should be left blank by default, so that the cluster default is used.
local-path will not be compatible with most clusters.

---
apiVersion: ditto.live/v1alpha1
kind: DittoDeployment
metadata:
name: {{ $values.name | default "big-peer" }}
spec:
version: {{ $values.version | default "1.40.3" }}
image:
namePrefix: {{ $values.image.namePrefix }}
pullPolicy: {{ $values.image.pullPolicy | default "IfNotPresent" }}
pullSecrets: {{ $values.image.pullSecrets | default "[]" }}
network:
hostname: {{ if (($values.network).hostname) }}{{ $values.network.hostname }}{{ else }}localhost{{ end }}
auth:
keys:
ca:
secretRef:
name: {{ tpl $values.pki.device.secretName . }}
certificate: tls.crt
key: tls.key
optional: true
inBand:
secretRef:
name: {{ tpl $values.pki.inband.secretName . }}
certificate: tls.crt
key: tls.key
optional: true
jwt:
secretRef:
name: {{ tpl $values.pki.jwt.secretName . }}
certificate: tls.crt
key: tls.key
optional: true
providers:
{{- toYaml $values.providers | nindent 6 }}
api:
image: {{ $values.image.namePrefix }}/big-peer-subscription:{{ $values.version }}
imagePullPolicy: {{ $values.image.pullPolicy }}
imagePullSecrets: []
resources:
limits:
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we expose these resource settings as values instead of hardcoding.

cpu: 2000m
memory: 4Gi
requests:
cpu: 100m
memory: 256Mi
storage:
storage_class_name: {{ $storageClassName }}
size: 10Gi
replicas: 1
subscriptions:
image: {{ $values.image.namePrefix }}/big-peer-subscription:{{ $values.version }}
imagePullPolicy: {{ $values.image.pullPolicy }}
imagePullSecrets: []
resources:
limits:
cpu: 2000m
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

memory: 4Gi
requests:
cpu: 100m
memory: 256Mi
storage:
storage_class_name: {{ $storageClassName }}
size: 10Gi
replicas: 1
store:
image: {{ $values.image.namePrefix }}/big-peer-store:{{ $values.version }}
imagePullPolicy: {{ $values.image.pullPolicy }}
imagePullSecrets: []
resources:
limits:
cpu: 2000m
memory: 4Gi
requests:
cpu: 100m
memory: 256Mi
storage:
storage_class_name: {{ $storageClassName }}
size: 10Gi
partitions: 2
replicas: 1
hashingScheme: ByDocumentId
transactions:
kafka:
bootstrapHost: {{ $values.transactions.kafka.bootstrapHost }}
---
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaTopic
metadata:
name: {{ $values.transactions.kafka.topic.name }}
labels:
strimzi.io/cluster: {{ tpl .Release.Name . }}-kafka
spec:
partitions: {{ $values.transactions.kafka.topic.partitions }}
replicas: {{ $values.transactions.kafka.topic.replicas }}
config:
cleanup.policy: delete
max.message.bytes: 104857600
{{- end }}
Loading
Loading