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

Allow to deploy Zeebe workers with zbchaos #247

Merged
merged 4 commits into from
Nov 22, 2022
Merged

Conversation

ChrisKujawa
Copy link
Member

@ChrisKujawa ChrisKujawa commented Nov 22, 2022

Add new sub-command to deploy Zeebe workers into a Zeebe cluster, which can be used for several chaos experiments. This allows completing process instances etc.

closes #235


Example:

Non-verbose: Deploy worker:

$ ./zbchaos deploy worker
Worker successfully deployed to the current namespace: zell-chaos

Verbose: Deploy worker

$ ./zbchaos deploy worker -v
Connecting to zell-chaos
Running experiment in self-managed environment.
Deploy worker deployment to the current namespace: zell-chaos
Worker successfully deployed to the current namespace: zell-chaos
$ k get deployments.apps 
NAME                       READY   UP-TO-DATE   AVAILABLE   AGE
worker                     3/3     3            3           107s

Error when deployment already exists:

$ ./zbchaos deploy worker -v
Connecting to zell-chaos
Running experiment in self-managed environment.
Deploy worker deployment to the current namespace: zell-chaos
panic: deployments.apps "worker" already exists

Copy link
Member

@lenaschoenburg lenaschoenburg left a comment

Choose a reason for hiding this comment

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

Nice, the embedding of manifests and decoding into k8s deployment manifests was new to me 👍

// k8Deployments holds our static k8 manifests, which are copied with the go:embed directive
//
//go:embed manifests/*
var k8Deployments embed.FS
Copy link
Member

Choose a reason for hiding this comment

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

🤩

@ChrisKujawa ChrisKujawa removed the request for review from deepthidevaki November 22, 2022 12:25
@ChrisKujawa ChrisKujawa merged commit 7130a14 into main Nov 22, 2022
@ChrisKujawa ChrisKujawa deleted the zell-deploy-workers branch November 22, 2022 12:26
ChrisKujawa added a commit that referenced this pull request Nov 22, 2022
With #247 we are able to deploy zeebe workers with zbchaos. With this PR
we are able to restart and terminate workers, either one or all existing
ones.

In this PR I also iterated over the terminate an restart commands and
realized that gateway restart was missing. I added this.

Furthermore a new subcommand is added on terminate and restart for the
broker, this makes it more understandable what is restarted, instead of
using the root restart/terminate command for that.

I plan to do some more refactoring like extracting the duplicated code
and reusing logic, but I will do this in a separate PR.


--------

**Example:** 

Terminate one:

```
$ ./zbchaos terminate worker -v
Connecting to zell-chaos
Running experiment in self-managed environment.
Terminated worker-99cd57f8b-hmhb5
```

Terminate all:

```
$ ./zbchaos terminate worker -v --all
Connecting to zell-chaos
Running experiment in self-managed environment.
Terminated worker-99cd57f8b-lfbck
Terminated worker-99cd57f8b-vjb9l
```

Restart one
```
$ ./zbchaos restart worker 
Restart worker-99cd57f8b-4ght7
```

Restart all
```
$ ./zbchaos restart worker --all
Restart worker-99cd57f8b-4ght7
Restart worker-99cd57f8b-7t2d9
Restart worker-99cd57f8b-kmrhv
```

New restart sub-commands:

```
$ ./zbchaos restart broker
Deleted zell-chaos-zeebe-2
$ ./zbchaos restart gateway
Restarted zell-chaos-zeebe-gateway-5f5c7cb8d6-9529r
$ ./zbchaos restart worker
Restart worker-99cd57f8b-cr6bs
```

New terminate sub-commands:
```
$ ./zbchaos terminate broker
Terminated zell-chaos-zeebe-0
$ ./zbchaos terminate gateway
Terminated zell-chaos-zeebe-gateway-5f5c7cb8d6-6jlxn
$ ./zbchaos terminate worker
Terminated worker-99cd57f8b-55tt2
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

I can deploy workers via zbchaos
2 participants