You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ef5f673
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+97-17Lines changed: 97 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,23 +4,46 @@ A Kubernetes operator for managing Activity resources with distributed worker ex
4
4
5
5
## Overview
6
6
7
-
KubeActivityEngine is a Kubernetes controller that manages custom `Activity` resources. It provides a framework for orchestrating activities with configurable inputs and tracking the status of multiple workers executing those activities. The operator maintains state information for each worker (READY, RUNNING, COMPLETED, FAILED) and provides a declarative way to manage distributed activity execution in Kubernetes clusters.
7
+
KubeActivityEngine is a Kubernetes operator that manages custom `Activity`and `ActivityWorker`resources. It provides a framework for orchestrating activities with configurable inputs and automatically creating workers to execute those activities. When an Activity enters the Initialization state, the controller creates ActivityWorker resources that define job specifications. The operator provides a declarative way to manage distributed activity execution in Kubernetes clusters with full lifecycle tracking.
8
8
9
9
## Features
10
10
11
-
-**Custom Resource Definition (CRD)**: Define activities as Kubernetes resources
11
+
-**Dual Custom Resource Definitions (CRDs)**: Define activities and workers as Kubernetes resources
12
+
-**Activity CRD**: Orchestrates activity lifecycle with configurable inputs
13
+
-**ActivityWorker CRD**: Defines job specifications with ActivityJob structure
-**Worker Status Tracking**: Monitor the state of multiple workers processing activities
13
-
-**Configurable Inputs**: Pass key-value input parameters to activities
14
17
-**Kubernetes-Native**: Built using the Kubebuilder framework with full Kubernetes API integration
15
18
-**Status Conditions**: Track activity lifecycle with standard Kubernetes condition types
16
19
-**RBAC Support**: Fine-grained access control with admin, editor, and viewer roles
17
20
18
21
## Architecture
19
22
20
-
The operator watches for `Activity`custom resources and manages their lifecycle. Each Activity resource contains:
23
+
The operator manages two custom resource types that work together:
21
24
22
-
-**Spec**: Desired state including activity name and input parameters
23
-
-**Status**: Observed state with worker statuses and conditions
25
+
### Activity Resource
26
+
27
+
The `Activity` CRD represents a unit of work to be executed. Each Activity contains:
28
+
29
+
-**Spec**: Desired state including activity name and input parameters (key-value pairs)
30
+
-**Status**: Observed state with conditions tracking the activity lifecycle
31
+
32
+
When an Activity is created and reaches the "Initialization" condition state, the controller automatically creates ActivityWorker resources.
33
+
34
+
### ActivityWorker Resource
35
+
36
+
The `ActivityWorker` CRD defines the execution specification for workers. Each ActivityWorker contains:
37
+
38
+
-**Spec**: Job specification using the `ActivityJob` structure
39
+
-**Name**: Unique identifier for the job
40
+
-**Image**: Container image to run (e.g., `bash:5.0`)
41
+
-**Command**: Command array to execute (e.g., `["bash", "-c"]`)
42
+
-**Args**: Arguments array for the command (e.g., `["echo done!"]`)
43
+
-**Env**: Environment variables for the container
44
+
-**ImagePullPolicy**: Pull policy for the container image
45
+
-**Status**: Observed state with conditions tracking the worker lifecycle
46
+
-**Labels**: Automatically labeled with `kube-activity-engine.algatux.dev/activity` to link to parent Activity
24
47
25
48
### Activity States
26
49
@@ -108,6 +131,48 @@ View detailed information:
108
131
kubectl describe activity my-activity
109
132
```
110
133
134
+
### Quick Demo
135
+
136
+
After applying an Activity, the controller automatically creates an **ActivityWorker** resource that defines a job specification. The ActivityWorker uses the new `ActivityJob` CRD structure:
kubectl get activityworkers -l kube-activity-engine.algatux.dev/activity=my-activity
150
+
```
151
+
152
+
View ActivityWorker details:
153
+
```sh
154
+
kubectl describe activityworker <worker-name>
155
+
```
156
+
157
+
Check the ActivityWorker spec:
158
+
```sh
159
+
kubectl get activityworker <worker-name> -o yaml
160
+
```
161
+
162
+
**Expected Output:**
163
+
The ActivityWorker will show the job configuration including the bash command that echoes "done!". The worker's status conditions will track its lifecycle state.
164
+
165
+
**Troubleshooting the demo:**
166
+
- If no ActivityWorkers are created, check the Activity status conditions:
167
+
```sh
168
+
kubectl get activity my-activity -o jsonpath='{.status.conditions}'
0 commit comments