qdrant-operator 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,284 @@
1
+ Metadata-Version: 2.4
2
+ Name: qdrant-operator
3
+ Version: 0.2.0
4
+ Summary: Kubernetes operator for Qdrant vector database
5
+ Keywords: kubernetes,operator,qdrant,kopf,vector-database
6
+ Author: Mohamed Tahrioui
7
+ License-Expression: MIT
8
+ License-File: LICENSE
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Environment :: No Input/Output (Daemon)
11
+ Classifier: Framework :: AsyncIO
12
+ Classifier: Intended Audience :: System Administrators
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Topic :: Database
18
+ Classifier: Topic :: System :: Clustering
19
+ Classifier: Typing :: Typed
20
+ Requires-Dist: kopf[uvloop]>=1.40.0
21
+ Requires-Dist: kubernetes-asyncio>=31.0.0
22
+ Requires-Dist: httpx>=0.28.0
23
+ Requires-Dist: aioboto3>=13.0.0
24
+ Requires-Dist: croniter>=5.0.0
25
+ Requires-Dist: loguru>=0.7.3
26
+ Requires-Python: >=3.12
27
+ Project-URL: Homepage, https://github.com/4thel00z/qdrant-operator
28
+ Project-URL: Repository, https://github.com/4thel00z/qdrant-operator
29
+ Project-URL: Issues, https://github.com/4thel00z/qdrant-operator/issues
30
+ Project-URL: Changelog, https://github.com/4thel00z/qdrant-operator/releases
31
+ Description-Content-Type: text/markdown
32
+
33
+ <div align="center">
34
+
35
+ <img src="assets/logo.svg" alt="Qdrant Operator logo" width="160">
36
+
37
+ # Qdrant Operator
38
+
39
+ **A Kubernetes operator for managing Qdrant vector database clusters**
40
+
41
+ [![CI](https://github.com/4thel00z/qdrant-operator/actions/workflows/ci.yml/badge.svg)](https://github.com/4thel00z/qdrant-operator/actions/workflows/ci.yml)
42
+ [![PyPI](https://img.shields.io/pypi/v/qdrant-operator.svg)](https://pypi.org/project/qdrant-operator/)
43
+ [![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
44
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
45
+ [![Kubernetes](https://img.shields.io/badge/kubernetes-%3E%3D1.26-326ce5.svg)](https://kubernetes.io/)
46
+
47
+ [Features](#features) •
48
+ [Installation](#installation) •
49
+ [Usage](#usage) •
50
+ [Configuration](#configuration) •
51
+
52
+ </div>
53
+
54
+ ---
55
+
56
+ ## Features
57
+
58
+ - **Cluster Management** - Deploy and manage Qdrant clusters via Helm
59
+ - **Automated Backups** - Per-node snapshots streamed to S3-compatible storage, with a manifest
60
+ - **Scheduled Backups** - CronJob-style schedules with concurrency and retention policies
61
+ - **Disaster Recovery** - Restore collections node-by-node from presigned URLs, with optional remapping
62
+ - **Async-First** - Built on kopf with fully async adapters for performance
63
+
64
+ ## Installation
65
+
66
+ ### Prerequisites
67
+
68
+ - Kubernetes cluster (v1.26+)
69
+ - Helm 3.x installed
70
+ - kubectl configured with cluster access
71
+
72
+ ### Install with Helm (Recommended)
73
+
74
+ ```bash
75
+ # From the OCI registry (published on every release)
76
+ helm install qdrant-operator oci://ghcr.io/4thel00z/charts/qdrant-operator -n qdrant-system --create-namespace
77
+
78
+ # Or from the local chart
79
+ helm install qdrant-operator ./charts/qdrant-operator
80
+
81
+ # Or install in a specific namespace
82
+ helm install qdrant-operator ./charts/qdrant-operator -n qdrant-system --create-namespace
83
+
84
+ # Verify installation
85
+ kubectl get pods -l app.kubernetes.io/name=qdrant-operator
86
+ ```
87
+
88
+ ### Configuration
89
+
90
+ Override default values:
91
+
92
+ ```bash
93
+ helm install qdrant-operator ./charts/qdrant-operator \
94
+ --set operator.logLevel=DEBUG \
95
+ --set resources.limits.memory=512Mi
96
+ ```
97
+
98
+ Or use a values file:
99
+
100
+ ```bash
101
+ helm install qdrant-operator ./charts/qdrant-operator -f my-values.yaml
102
+ ```
103
+
104
+ ### Install from PyPI
105
+ The operator is also a Python package; the `qdrant-operator` command runs it against your kubeconfig,
106
+ forwarding any extra flags to `kopf run` (for example `--namespace team-a`).
107
+ ```bash
108
+ uv tool install qdrant-operator # or: pipx install qdrant-operator
109
+ qdrant-operator --help
110
+ ```
111
+ Container images: `ghcr.io/4thel00z/qdrant-operator:<version>` (linux/amd64, linux/arm64, signed provenance).
112
+ ### Build Docker Image (Optional)
113
+
114
+ ```bash
115
+ # Replace with your registry
116
+ docker build -t ghcr.io/YOUR_ORG/qdrant-operator:0.1.0 .
117
+ docker push ghcr.io/YOUR_ORG/qdrant-operator:0.1.0
118
+ ```
119
+
120
+ ### Local Development
121
+
122
+ ```bash
123
+ # Install dependencies
124
+ uv sync
125
+
126
+ # Apply CRDs to cluster
127
+ kubectl apply -f manifests/crds/
128
+
129
+ # Run operator locally against your kubeconfig
130
+ make dev
131
+ ```
132
+
133
+ ## Usage
134
+
135
+ ### Create a Qdrant Cluster
136
+
137
+ ```yaml
138
+ apiVersion: qdrant.io/v1alpha1
139
+ kind: QdrantCluster
140
+ metadata:
141
+ name: my-qdrant
142
+ namespace: default
143
+ spec:
144
+ replicas: 3
145
+ version: v1.16.3
146
+ resources:
147
+ requests:
148
+ cpu: "500m"
149
+ memory: "1Gi"
150
+ limits:
151
+ cpu: "2"
152
+ memory: "4Gi"
153
+ persistence:
154
+ size: 10Gi
155
+ storageClassName: standard
156
+ cluster:
157
+ enabled: true
158
+ ```
159
+
160
+ ### Create a Backup
161
+
162
+ ```yaml
163
+ apiVersion: qdrant.io/v1alpha1
164
+ kind: QdrantBackup
165
+ metadata:
166
+ name: my-backup
167
+ namespace: default
168
+ spec:
169
+ clusterRef:
170
+ name: my-qdrant
171
+ storage:
172
+ s3:
173
+ bucket: my-backups
174
+ prefix: qdrant
175
+ region: us-east-1
176
+ credentialsSecretRef:
177
+ name: s3-credentials
178
+ accessKeyIdKey: AWS_ACCESS_KEY_ID
179
+ ```
180
+
181
+ ### Schedule Automated Backups
182
+
183
+ ```yaml
184
+ apiVersion: qdrant.io/v1alpha1
185
+ kind: QdrantBackupSchedule
186
+ metadata:
187
+ name: daily-backup
188
+ namespace: default
189
+ spec:
190
+ schedule: "0 2 * * *" # Daily at 2 AM
191
+ clusterRef:
192
+ name: my-qdrant
193
+ storage:
194
+ s3:
195
+ bucket: my-backups
196
+ prefix: scheduled
197
+ region: us-east-1
198
+ credentialsSecretRef:
199
+ name: s3-credentials
200
+ accessKeyIdKey: AWS_ACCESS_KEY_ID
201
+ retentionPolicy:
202
+ keepLast: 7
203
+ keepDaily: 30
204
+ concurrencyPolicy: Forbid
205
+ ```
206
+
207
+ ### Restore from Backup
208
+
209
+ ```yaml
210
+ apiVersion: qdrant.io/v1alpha1
211
+ kind: QdrantRestore
212
+ metadata:
213
+ name: my-restore
214
+ namespace: default
215
+ spec:
216
+ backupRef:
217
+ name: my-backup
218
+ targetClusterRef:
219
+ name: my-qdrant-new
220
+ collectionMapping:
221
+ old_collection: new_collection
222
+ ```
223
+
224
+ ## Configuration
225
+
226
+ ### Environment Variables
227
+
228
+ | Variable | Description | Default |
229
+ |----------|-------------|---------|
230
+ | `KUBECONFIG` | Path to kubeconfig file | In-cluster config |
231
+ | `LOG_LEVEL` | Logging level | `INFO` |
232
+ | `LOG_FORMAT` | `json` or `text` | `json` |
233
+
234
+ ### S3 Credentials Secret
235
+
236
+ ```yaml
237
+ apiVersion: v1
238
+ kind: Secret
239
+ metadata:
240
+ name: s3-credentials
241
+ type: Opaque
242
+ stringData:
243
+ AWS_ACCESS_KEY_ID: "your-access-key"
244
+ AWS_SECRET_ACCESS_KEY: "your-secret-key"
245
+ ```
246
+
247
+ ## Development
248
+
249
+ ```bash
250
+ # Install dependencies
251
+ uv sync
252
+
253
+ # Run tests
254
+ uv run pytest
255
+
256
+ # Run integration tests (requires k8s cluster + helm)
257
+ make test-integration
258
+
259
+ # Lint and format
260
+ uv run ruff check src tests
261
+ uv run ruff format src tests
262
+
263
+ # Type checking
264
+ uv run pyright src tests
265
+ ```
266
+
267
+ ## Releasing
268
+ CI (`.github/workflows/ci.yml`) runs lint, pyright, unit tests, chart lint, a wheel/image build and the
269
+ kind-based end-to-end suite on every push and pull request.
270
+
271
+ Releases are driven by [release-please](https://github.com/googleapis/release-please) from the
272
+ conventional commit history, all inside `.github/workflows/release.yml` on pushes to `main`:
273
+
274
+ 1. A release PR is kept up to date that bumps `pyproject.toml` and `Chart.yaml`, refreshes `uv.lock`
275
+ and updates `CHANGELOG.md`.
276
+ 2. Merging that PR creates the `vX.Y.Z` tag and the GitHub release, and the same run publishes the
277
+ wheel and sdist to PyPI (trusted publishing, no token), pushes the multi-arch image and the Helm
278
+ chart to ghcr.io, and attaches the artifacts and CRDs to the release.
279
+
280
+ No secrets are involved beyond the default `GITHUB_TOKEN`; the repository setting *Allow GitHub
281
+ Actions to create and approve pull requests* must be on for the release PR to appear.
282
+ ## License
283
+
284
+ MIT License - see [LICENSE](LICENSE) for details.
@@ -0,0 +1,17 @@
1
+ qdrant_operator/__init__.py,sha256=KNRoZ_JhjN5XJ_WJmtyfl3mEaAB5v4gZuwkLxpBQxYo,34
2
+ qdrant_operator/container.py,sha256=8z_ZzHOs0MIoKa094TtX2KSIicXYbvITyMO_wpRTz8Q,2043
3
+ qdrant_operator/domain.py,sha256=9XuarAjaYrq47Y8NQqWHvDJ4qbQuHJHUA6IJqXOiGK4,41945
4
+ qdrant_operator/handlers.py,sha256=PTHppPoDqh1lEvsbntAHQyRCjIdMPgMDFpfZl2gAS80,7209
5
+ qdrant_operator/helm_adapter.py,sha256=QZj3QRrMRW6HnNNxn4kwkDtsKW8ijqWV3USIjkNJimE,2787
6
+ qdrant_operator/kubernetes_adapter.py,sha256=VFy6rIh-rnUgi7KMab9HkGCFOex2zfqIkEMx2rf-a4A,5715
7
+ qdrant_operator/main.py,sha256=OWe5jj0Qsqw_sSZN0wdmBMggH2Kr-paCEEQsPu8OKCo,1463
8
+ qdrant_operator/ports.py,sha256=KHKc8t__i-8ekX2rzSkpPeMoO6A5J87Cz6jSXHygZi8,3681
9
+ qdrant_operator/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ qdrant_operator/qdrant_adapter.py,sha256=2oVTuMRufPZt9No6I_kHsHOUCUQKT41E458ezsPAA70,4625
11
+ qdrant_operator/s3_adapter.py,sha256=WVvUTFESAX8FmDzTQpSgOvKkcxy9ZDu0YGbILvLozOc,4025
12
+ qdrant_operator/usecases.py,sha256=lwCAosiTq3bASnwJoDJ3_7U_g3N-5mFmNo75gRdIFU4,22975
13
+ qdrant_operator-0.2.0.dist-info/licenses/LICENSE,sha256=a8XVpLKlcwfdk5ThTJ8JjwM10gxL90A9M0hFNbd5Dy0,1081
14
+ qdrant_operator-0.2.0.dist-info/WHEEL,sha256=7hzKWg-J8I3Buqyw5tBii5z_MmAVsDYXXijd_QAtNZ8,81
15
+ qdrant_operator-0.2.0.dist-info/entry_points.txt,sha256=gX3QOwxTWETSBi6mJMC-Pp9VwIi4M4bGVOczJbavadI,62
16
+ qdrant_operator-0.2.0.dist-info/METADATA,sha256=MWyMZjkvDyIJta6bMdwQVLX8JbbVNFOlkuyXTp2oZvc,7639
17
+ qdrant_operator-0.2.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: uv 0.12.18
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ qdrant-operator = qdrant_operator.main:run
3
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mohamed Mustapha Tahrioui
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.