Skip to content

Commit

Permalink
docs: finish the summary
Browse files Browse the repository at this point in the history
  • Loading branch information
sujuka99 committed Jan 16, 2024
1 parent eea0554 commit 1c9ce84
Showing 1 changed file with 98 additions and 90 deletions.
188 changes: 98 additions & 90 deletions docs/docs/user/migration-guide/v2-v3.md
Original file line number Diff line number Diff line change
@@ -1,95 +1,6 @@
# Migrate from V2 to V3

## Summary

??? example "pipeline.yaml"

```diff
- - type: kubernetes-app
+ - type: helm-app
name: foo
...
- type: kafka-app
app:
streams:
- brokers: ${brokers}
+ brokers: ${config.kafka_brokers}
labels:
- app_type: "${component_type}"
- app_name: "${component_name}"
- app_schedule: "${component_app_schedule}"
+ app_type: "${component.type}"
+ app_name: "${component.name}"
+ app_schedule: "${component.app.schedule}"
...
+ - type: streams-bootstrap:
repo_config: ...
version: ...
...
- type: kafka-connector:
- namespace: my-namespace
+ resetter_namespace: my-namespace
...
```

??? example "config.yaml"

```diff
- environment: development

+ components_module: components
+ pipeline_base_dir: pipelines

- brokers: "http://k8kafka-cp-kafka-headless.kpops.svc.cluster.local:9092"
- kafka_rest_host: "http://my-custom-rest.url:8082"
- kafka_connect_host: "http://my-custom-connect.url:8083"
- schema_registry_url: "http://my-custom-sr.url:8081"
+ kafka_brokers: "http://k8kafka-cp-kafka-headless.kpops.svc.cluster.local:9092"
+ kafka_rest:
+ url: "http://my-custom-rest.url:8082"
+ kafka_connect:
+ url: "http://my-custom-connect.url:8083"
+ schema_registry:
+ enabled: true
+ url: "http://my-custom-sr.url:8081"

topic_name_config:
- default_error_topic_name: "${pipeline_name}-${component_name}-dead-letter-topic"
- default_output_topic_name: "${pipeline_name}-${component_name}-topic"
+ default_error_topic_name: "${pipeline.name}-${component.name}-dead-letter-topic"
+ default_output_topic_name: "${pipeline.name}-${component.name}-topic"
...
```

??? example "custom_module.py"

```diff
- from kpops.components import KubernetesApp
+ from kpops.components import HelmApp
from kpops.components.base_components.models.resource import Resource

- class CustomHelmApp(KubernetesApp):
+ class CustomHelmApp(HelmApp):

@override
- def template(self) -> None:
+ def manifest(self) -> Resource:
"""Render final component resources, e.g. Kubernetes manifests."""
return [] # list of manifests
...
```

#### github_ci_workflow.yaml

```diff
steps:
- name: kpops deploy
- uses: bakdata/kpops/actions/kpops-runner@main
+ uses: bakdata/kpops@main
with:
command: deploy --execute
# ...
```
[**Jump to the summary**](#summary)

## [Use hash and trim long Helm release names instead of only trimming](https://github.com/bakdata/kpops/pull/390)

Expand Down Expand Up @@ -327,3 +238,100 @@ This would make it more uniform with the existing `${component.<key>}` variables
+ brokers: ${config.kafka_brokers}
+ schemaRegistryUrl: ${config.schema_registry.url}
```

## Summary

!!! warning

[**Helm will not find your (long) old release names anymore.**](#use-hash-and-trim-long-helm-release-names-instead-of-only-trimming)

??? example "defaults.yaml"

```diff
kafka-app:
app:
streams: ...

+ streams-bootstrap:
repo_config: ...
version: ...
```

??? example "pipeline.yaml"

```diff
- - type: kubernetes-app
+ - type: helm-app
...
- type: kafka-app
app:
- brokers: ${brokers}
+ brokers: ${config.kafka_brokers}
labels:
- app_schedule: "${component_app_schedule}"
+ app_schedule: "${component.app.schedule}"
...
- type: kafka-connector:
- namespace: my-namespace
+ resetter_namespace: my-namespace
...
```

??? example "config.yaml"

```diff
- environment: development

+ components_module: components

+ pipeline_base_dir: pipelines

- brokers: "http://k8kafka-cp-kafka-headless.kpops.svc.cluster.local:9092"
+ kafka_brokers: "http://k8kafka-cp-kafka-headless.kpops.svc.cluster.local:9092"

- kafka_rest_host: "http://my-custom-rest.url:8082"
+ kafka_rest:
+ url: "http://my-custom-rest.url:8082"

- kafka_connect_host: "http://my-custom-connect.url:8083"
+ kafka_connect:
+ url: "http://my-custom-connect.url:8083"

- schema_registry_url: "http://my-custom-sr.url:8081"
+ schema_registry:
+ enabled: true
+ url: "http://my-custom-sr.url:8081"

topic_name_config:
- default_error_topic_name: "${pipeline_name}-${component_name}-dead-letter-topic"
+ default_error_topic_name: "${pipeline.name}-${component.name}-dead-letter-topic"
...
```

??? example "custom_module.py"

```diff
- from kpops.components import KubernetesApp
+ from kpops.components import HelmApp
+ from kpops.components.base_components.models.resource import Resource

- class CustomHelmApp(KubernetesApp):
+ class CustomHelmApp(HelmApp):

@override
- def template(self) -> None:
+ def manifest(self) -> Resource:
"""Render final component resources, e.g. Kubernetes manifests."""
return [] # list of manifests
...
```

??? example "github_ci_workflow.yaml"

```diff
steps:
- name: ...
- uses: bakdata/kpops/actions/kpops-runner@main
+ uses: bakdata/kpops@main
...
```

0 comments on commit 1c9ce84

Please sign in to comment.