Skip to content

Commit

Permalink
Update docs of word-count example for v3 & new folder structure (#423)
Browse files Browse the repository at this point in the history
Co-authored-by: Ivan Yordanov <i.p.yordanov@proton.me>
  • Loading branch information
disrupted and sujuka99 authored Jan 18, 2024
1 parent 7c05165 commit 0fca481
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 32 deletions.
4 changes: 2 additions & 2 deletions docs/docs/resources/examples/defaults.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@

<!-- dprint-ignore-end -->

## [Word-count Pipeline](https://github.com/bakdata/kpops-examples/tree/main/word-count/deployment/kpops){target=_blank}
## [Word-count Pipeline](https://github.com/bakdata/kpops-examples/tree/main/word-count){target=_blank}

<!-- dprint-ignore-start -->

??? example "defaults.yaml"
```yaml
--8<--
https://raw.githubusercontent.com/bakdata/kpops-examples/main/word-count/deployment/kpops/defaults.yaml
https://raw.githubusercontent.com/bakdata/kpops-examples/main/word-count/defaults.yaml
--8<--
```

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/resources/examples/pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@

<!-- dprint-ignore-end -->

## [Word-count Pipeline](https://github.com/bakdata/kpops-examples/tree/main/word-count/deployment/kpops){target=_blank}
## [Word-count Pipeline](https://github.com/bakdata/kpops-examples/tree/main/word-count){target=_blank}

<!-- dprint-ignore-start -->

??? example "pipeline.yaml"
```yaml
--8<--
https://raw.githubusercontent.com/bakdata/kpops-examples/main/word-count/deployment/kpops/pipeline.yaml
https://raw.githubusercontent.com/bakdata/kpops-examples/main/word-count/pipeline.yaml
--8<--
```

Expand Down
34 changes: 11 additions & 23 deletions docs/docs/user/getting-started/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Word-count

Word-count is a demo pipeline which consists of a producer producing words to Kafka, a Kafka streams app counting the number of times each word occurs and finally a Redis database into which the words are exported.
Word-count is a demo pipeline consisting of a producer producing words to Kafka, a Kafka streams app counting the number of times each word occurs, and finally a Redis database into which the words are exported.

## What this will demonstrate

Expand Down Expand Up @@ -69,33 +69,22 @@ kubectl port-forward --namespace kpops service/k8kafka-cp-kafka-connect 8083:808

<!-- dprint-ignore-start -->

1. Copy the [configuration](https://github.com/bakdata/kpops-examples/tree/main/word-count/deployment/kpops){target=_blank} from the [kpops-examples repository](https://github.com/bakdata/kpops-examples/tree/main/word-count){target=_blank} into `kpops>examples>bakdata>word-count` like so:
1. Clone the [kpops-examples repository](https://github.com/bakdata/kpops-examples){target=_blank} and `cd` into the directory.

```
kpops
├── examples
| ├── bakdata
| | ├── word-count
| | | ├── config.yaml
| | | ├── defaults
| | | │   └── defaults.yaml
| | | └── pipeline.yaml
| | |
```
2. Install KPOps `pip install -r requirements.txt`.

2. Export environment variables in your terminal:
3. Export environment variables in your terminal:

```shell
export DOCKER_REGISTRY=bakdata && \
export NAMESPACE=kpops
```

3. Deploy the pipeline
4. Deploy the pipeline

```shell
kpops deploy ./examples/bakdata/word-count/pipeline.yaml \
--pipeline-base-dir ./examples \
--config ./examples/bakdata/word-count/config.yaml \
kpops deploy word-count/pipeline.yaml \
--defaults word-count/defaults.yaml \
--execute
```

Expand Down Expand Up @@ -156,9 +145,8 @@ helm --namespace kpops uninstall redis
2. Remove the pipeline

```shell
kpops clean ./examples/bakdata/word-count/pipeline.yaml \
--pipeline-base-dir ./examples \
--config ./examples/bakdata/word-count/config.yaml \
kpops clean word-count/pipeline.yaml \
--defaults word-count/defaults.yaml \
--verbose \
--execute
```
Expand All @@ -178,13 +166,13 @@ helm --namespace kpops uninstall redis

- `deploy` fails:
1. Read the error message.
2. Try to correct the mistakes if there were any. Likely the configuration is not correct or the port-forwarding is not working as intended.
2. Try to correct the mistakes if there were any. Likely the configuration is incorrect, or the port-forwarding is not working as intended.
3. Run `clean`.
4. Run `deploy --dry-run` to avoid having to `clean` again. If an error is dropped, start over from step 1.
5. If the dry-run is successful, run `deploy`.
- `clean` fails:
1. Read the error message.
2. Try to correct the indicated mistakes if there were any. Likely the configuration is not correct or the port-forwarding is not working as intended.
2. Try to correct the indicated mistakes if there were any. Likely the configuration is incorrect, or the port-forwarding is not working as intended.
3. Run `clean`.
4. If `clean` fails, follow the steps in [teardown](../teardown).

Expand Down
8 changes: 3 additions & 5 deletions docs/docs/user/what-is-kpops.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# What is KPOps?

With a couple of easy commands in the shell and a [`pipeline.yaml`](#example) of under 30 lines, KPOps can not only [`deploy`](./references/cli-commands.md#kpops-deploy) a Kafka pipeline[^1] to a Kubernetes cluster, but also [`reset`](./references/cli-commands.md#kpops-reset), [`clean`](./references/cli-commands.md#kpops-clean) or [`destroy`](./references/cli-commands.md#kpops-destroy) it!
With a couple of easy commands in the shell, and a [`pipeline.yaml`](#example) of under 30 lines, KPOps can not only [`deploy`](./references/cli-commands.md#kpops-deploy) a Kafka pipeline[^1] to a Kubernetes cluster, but also [`reset`](./references/cli-commands.md#kpops-reset), [`clean`](./references/cli-commands.md#kpops-clean) or [`destroy`](./references/cli-commands.md#kpops-destroy) it!

[^1]: A Kafka pipeline can consist of consecutive [streaming applications](./core-concepts/components/streams-app.md),
[producers](./core-concepts/components/producer-app.md),
and [connectors](./core-concepts/components/kafka-connector.md).
[^1]: A Kafka pipeline can consist of consecutive [streaming applications](./core-concepts/components/streams-app.md), [producers](./core-concepts/components/producer-app.md), and [connectors](./core-concepts/components/kafka-connector.md).

## Key features

Expand All @@ -24,6 +22,6 @@ and [connectors](./core-concepts/components/kafka-connector.md).

```yaml title="Word-count pipeline.yaml"
--8<--
https://raw.githubusercontent.com/bakdata/kpops-examples/main/word-count/deployment/kpops/pipeline.yaml
https://raw.githubusercontent.com/bakdata/kpops-examples/main/word-count/pipeline.yaml
--8<--
```

0 comments on commit 0fca481

Please sign in to comment.