Skip to content

Commit cbad9cb

Browse files
committed
Update readme and add crd ci
1 parent 05a9baa commit cbad9cb

3 files changed

Lines changed: 82 additions & 142 deletions

File tree

‎.github/workflows/crd.yml‎

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: CRD
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'api/**'
8+
- 'hack/**'
9+
pull_request:
10+
paths:
11+
- 'api/**'
12+
- 'hack/**'
13+
14+
jobs:
15+
generate-crd:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: write
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: '1.25'
26+
27+
- name: Install controller-gen
28+
run: go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.13.0
29+
30+
- name: Generate CRD
31+
run: |
32+
controller-gen crd paths=./api/... output:crd:artifacts:config=config/crd/bases
33+
34+
- name: Verify CRD is up to date (PR)
35+
if: github.event_name == 'pull_request'
36+
run: |
37+
git diff --exit-code config/crd || \
38+
(echo "CRD is out of date. Run: task manifests" && exit 1)
39+
40+
- name: Commit and push CRD (push to main)
41+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
42+
run: |
43+
git config user.name "github-actions"
44+
git config user.email "github-actions@github.com"
45+
git add config/crd
46+
git diff --staged --quiet || git commit -m "chore: regenerate CRD" && git push
47+
48+
- name: Create MR in helm-charts
49+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
50+
env:
51+
# Use HELM_CHARTS_TOKEN for cross-repo (PAT with repo scope). If unset, uses GITHUB_TOKEN (works when helm-charts is in same repo).
52+
GH_TOKEN: ${{ secrets.HELM_CHARTS_TOKEN || secrets.GITHUB_TOKEN }}
53+
run: |
54+
set -e
55+
HELM_REPO="dataflow-operator/helm-charts"
56+
BRANCH="crd-sync-$(date +%Y%m%d-%H%M%S)"
57+
mkdir -p helm-charts
58+
git clone "https://x-access-token:${GH_TOKEN}@github.com/${HELM_REPO}.git" helm-charts
59+
cd helm-charts
60+
git config user.name "github-actions"
61+
git config user.email "github-actions@github.com"
62+
mkdir -p charts/dataflow-operator/crds
63+
cp "$GITHUB_WORKSPACE/dataflow/config/crd/bases/dataflow.dataflow.io_dataflows.yaml" charts/dataflow-operator/crds/
64+
git checkout -b "$BRANCH"
65+
git add charts/dataflow-operator/crds
66+
if git diff --staged --quiet; then
67+
echo "CRD unchanged in helm-charts, skipping MR"
68+
exit 0
69+
fi
70+
git commit -m "chore: sync CRD from dataflow-operator"
71+
git push -u origin "$BRANCH"
72+
gh pr create --repo "$HELM_REPO" \
73+
--title "chore: sync CRD from dataflow-operator" \
74+
--body "CRD regenerated from dataflow-operator after api/hack changes."

‎README.md‎

Lines changed: 7 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,7 @@
22

33
Kubernetes operator for streaming data between different sources (Kafka, PostgreSQL, Trino) with support for message transformations.
44

5-
## Features
6-
7-
- **Multiple Data Sources**: Kafka, PostgreSQL, Trino
8-
- **Message Transformations**:
9-
- Timestamp - add timestamp to messages
10-
- Flatten - expand arrays into separate messages
11-
- Filter - filter by conditions
12-
- Mask - mask sensitive data
13-
- Router - route to different sinks
14-
- Select - select specific fields
15-
- Remove - remove fields
16-
- SnakeCase - convert field names to snake_case
17-
- CamelCase - convert field names to CamelCase
18-
- **Kubernetes Secrets Support**: Configure connectors using `SecretRef` for secure credential management
19-
- **Per-Resource Pod Deployment**: Each DataFlow resource creates a separate pod (Deployment) for processing
20-
- **Resource Management**: Configure CPU and memory resources for processor pods
21-
- **Pod Placement Control**: Configure nodeSelector, affinity, and tolerations for fine-grained pod placement
5+
**[Online documentation](https://dataflow-operator.github.io/docs/)**
226

237
## Quick Start
248

@@ -30,71 +14,11 @@ Kubernetes operator for streaming data between different sources (Kafka, Postgre
3014
- Go 1.21+ (for local development)
3115
- Docker and docker-compose (for local development)
3216

33-
### Installation
34-
35-
#### Installing CRD
36-
37-
Before installing the operator, you need to install the Custom Resource Definition (CRD):
38-
39-
```bash
40-
kubectl apply -f https://raw.githubusercontent.com/dataflow-operator/dataflow/refs/heads/main/config/crd/bases/dataflow.dataflow.io_dataflows.yaml
41-
```
42-
43-
Or use a local file:
44-
45-
```bash
46-
kubectl apply -f config/crd/bases/dataflow.dataflow.io_dataflows.yaml
47-
```
48-
49-
#### Installation via Helm (Recommended)
50-
51-
1. Install the operator from OCI registry:
52-
```bash
53-
helm install dataflow-operator oci://ghcr.io/dataflow-operator/helm-charts/dataflow-operator
54-
```
55-
56-
2. For installation with custom settings:
57-
```bash
58-
helm install dataflow-operator oci://ghcr.io/dataflow-operator/helm-charts/dataflow-operator \
59-
--set image.repository=your-registry/controller \
60-
--set image.tag=v1.0.0 \
61-
--set replicaCount=2
62-
```
63-
64-
3. For installation in a specific namespace:
65-
```bash
66-
helm install dataflow-operator oci://ghcr.io/dataflow-operator/helm-charts/dataflow-operator \
67-
--namespace dataflow-system \
68-
--create-namespace
69-
```
70-
71-
4. Check installation status:
72-
```bash
73-
kubectl get pods -l app.kubernetes.io/name=dataflow-operator
74-
```
75-
76-
**Note**: For local development, you can also use the local chart:
77-
```bash
78-
helm install dataflow-operator ./helm-charts/dataflow-operator
79-
```
80-
81-
#### Updating
82-
83-
```bash
84-
helm upgrade dataflow-operator oci://ghcr.io/dataflow-operator/helm-charts/dataflow-operator
85-
```
86-
87-
#### Uninstallation
88-
89-
```bash
90-
helm uninstall dataflow-operator
91-
```
92-
9317
#### Local Development
9418

9519
For local development, you can run the operator locally:
9620
```bash
97-
make run
21+
task run
9822
```
9923

10024
Or use the script:
@@ -115,93 +39,34 @@ Available UIs:
11539

11640
2. Run the operator:
11741
```bash
118-
make run
119-
```
120-
121-
### Usage Examples
122-
123-
See `config/samples/` for CRD manifest examples.
124-
125-
#### Example with Kubernetes Secrets
126-
127-
For secure credential storage, use Kubernetes Secrets:
128-
129-
```bash
130-
kubectl apply -f config/samples/kafka-to-postgres-secrets.yaml
131-
```
132-
133-
This example demonstrates using `SecretRef` for connector configuration. All connectors support configuration from Kubernetes Secrets.
134-
135-
## Project Structure
136-
137-
```
138-
dataflow/
139-
├── api/v1/ # CRD definitions
140-
├── internal/
141-
│ ├── connectors/ # Connectors for sources/sinks
142-
│ ├── transformers/ # Message transformations
143-
│ ├── processor/ # Message processor
144-
│ └── controller/ # Kubernetes controller
145-
├── config/samples/ # CRD examples
146-
├── docs/ # MkDocs documentation
147-
├── test/ # Tests and utilities
148-
└── scripts/ # Helper scripts
149-
```
150-
151-
## Documentation
152-
153-
Full documentation is available in `docs/`. To view:
154-
155-
```bash
156-
mkdocs serve
42+
task run
15743
```
15844

159-
Or from the project root:
160-
161-
```bash
162-
cd docs && mkdocs serve
163-
```
164-
165-
Documentation is available in two languages:
166-
- **English**: Default language
167-
- **Russian**: Available in the navigation menu
168-
16945
## Development
17046

17147
### Code Generation
17248

173-
If you encounter issues with `make generate`, try:
49+
If you encounter issues with `task generate`, try:
17450

17551
```bash
17652
# Update controller-gen
17753
go install sigs.k8s.io/controller-tools/cmd/controller-gen@latest
17854

17955
# Then
180-
make generate
56+
task generate
18157
```
18258

18359
### Testing
18460

18561
```bash
18662
# Unit tests
187-
make test
63+
task test
18864

18965
# Integration tests (requires kind)
19066
./scripts/setup-kind.sh
191-
make test-integration
67+
task test-integration
19268
```
19369

194-
## Security
195-
196-
DataFlow Operator supports configuring connectors from Kubernetes Secrets through `SecretRef` fields. This allows:
197-
198-
- Secure storage of sensitive data (passwords, tokens, connection strings)
199-
- Centralized credential management
200-
- Secret rotation without changing DataFlow resources
201-
- Access control through Kubernetes RBAC
202-
203-
See the [Connectors documentation](docs/en/connectors.md#using-kubernetes-secrets) for details.
204-
20570
## License
20671

20772
Apache License 2.0

‎api/v1/dataflow_types.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17+
1718
package v1
1819

1920
import (

0 commit comments

Comments
 (0)