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 }}
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,10 +54,11 @@ A Framework represents an application with a set of Tasks:
54
54
2. Partitioned to different heterogeneous TaskRoles which share the same lifecycle
55
55
3. Ordered in the same homogeneous TaskRole by TaskIndex
56
56
4. With consistent identity {FrameworkName}-{TaskRoleName}-{TaskIndex} as PodName
57
-
5. With fine grained [RetryPolicy](doc/user-manual.md#RetryPolicy) for each Task and the whole Framework
58
-
6. With fine grained [FrameworkAttemptCompletionPolicy](doc/user-manual.md#FrameworkAttemptCompletionPolicy) for each TaskRole
59
-
7. With PodGracefulDeletionTimeoutSec for each Task to [tune Consistency vs Availability](doc/user-manual.md#FrameworkConsistencyAvailability)
60
-
8. With fine grained [Status](pkg/apis/frameworkcontroller/v1/types.go) for each TaskAttempt/Task, each TaskRole and the whole FrameworkAttempt/Framework
57
+
5. With fine grained [ExecutionType](doc/user-manual.md#FrameworkExecutionType) to Start/Stop the whole Framework
58
+
6. With fine grained [RetryPolicy](doc/user-manual.md#RetryPolicy) for each Task and the whole Framework
59
+
7. With fine grained [FrameworkAttemptCompletionPolicy](doc/user-manual.md#FrameworkAttemptCompletionPolicy) for each TaskRole
60
+
8. With PodGracefulDeletionTimeoutSec for each Task to [tune Consistency vs Availability](doc/user-manual.md#FrameworkConsistencyAvailability)
61
+
9. With fine grained [Status](pkg/apis/frameworkcontroller/v1/types.go) for each TaskAttempt/Task, each TaskRole and the whole FrameworkAttempt/Framework
61
62
62
63
### Controller Feature
63
64
1. Highly generalized as it is built for all kinds of applications
|[ConfigMap](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.14/#configmap-v1-core)| All operations except for [CREATE](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.14/#create-configmap-v1-core)[PUT](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.14/#replace-configmap-v1-core)[PATCH](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.14/#patch-configmap-v1-core)|
43
44
|[Pod](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.14/#pod-v1-core)| All operations except for [CREATE](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.14/#create-pod-v1-core)[PUT](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.14/#replace-pod-v1-core)[PATCH](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.14/#patch-pod-v1-core)|
44
45
@@ -55,6 +56,8 @@ Type: application/json or application/yaml
55
56
56
57
Create the specified Framework.
57
58
59
+
Any [ExecutionType](#FrameworkExecutionType) can be specified to create the Framework.
60
+
58
61
**Response**
59
62
60
63
| Code | Body | Description |
@@ -65,6 +68,38 @@ Create the specified Framework.
65
68
| Conflict(409) |[Status](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.14/#status-v1-meta)| The specified Framework already exists. |
Start the specified Framework whose [ExecutionType](#FrameworkExecutionType) should be `Create`.
93
+
94
+
Before the Start, the Framework will not start to run or complete, but the object of the Framework is created, see [Framework PreStart Example](#FrameworkExecutionTypePreStartExample).
95
+
96
+
**Response**
97
+
98
+
| Code | Body | Description |
99
+
|:---- |:---- |:---- |
100
+
| OK(200) |[Framework](../pkg/apis/frameworkcontroller/v1/types.go)| Return current Framework. |
101
+
| NotFound(404) |[Status](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.14/#status-v1-meta)| The specified Framework is not found. |
Stop the specified Framework whose [ExecutionType](#FrameworkExecutionType) should be `Create` or `Start`.
90
125
91
-
All running containers of the Framework will be stopped while the object of the Framework is still kept.
126
+
After the Stop, the Framework will start to complete, but the object of the Framework will not be deleted, see [Framework PostStop Example](#FrameworkExecutionTypePostStopExample).
92
127
93
128
**Response**
94
129
@@ -346,6 +381,100 @@ Watch the change events of all Frameworks (in the specified FrameworkNamespace).
346
381
|:---- |:---- |:---- |
347
382
| OK(200) | [WatchEvent](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.14/#watchevent-v1-meta) | Streaming the change events of all Frameworks (in the specified FrameworkNamespace). |
Framework [ExecutionType](../pkg/apis/frameworkcontroller/v1/types.go) can be specified to control the execution of the Framework:
386
+
1. You can just [Create Framework](#CREATE_Framework) with `Create` ExecutionType, which does not also start it at the same time.
387
+
- This is useful when you need to do some PreStart actions depend on the Framework object, see [Framework PreStart Example](#FrameworkExecutionTypePreStartExample). And once these actions are done, you can safely [Start Framework](#Start_Framework).
388
+
2. You can just [Stop Framework](#Stop_Framework), which does not also delete it at the same time.
389
+
- This is useful when you need to do some PostStop actions depend on the Framework object, see [Framework PostStop Example](#FrameworkExecutionTypePostStopExample). And once these actions are done, you can safely [Delete Framework](#DELETE_Framework).
In this example, you need to run a [Framework which depends on a ServiceAccount](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account), but the ServiceAccount also depends on the Framework object to be [OwnerReferences](https://kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/#owners-and-dependents), so you cannot directly [Create Framework](#CREATE_Framework) with ExecutionType `Start`.
394
+
1. [Create Framework](#CREATE_Framework) with `Create` ExecutionType and a ServiceAccount reference as below, then the Framework will stay as AttemptCreationPending:
2. Use above creation response's `metadata.uid` to override below {{FrameworkUID}}, and [Create ServiceAccount](https://v1-14.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.14/#create-serviceaccount-v1-core) with above Framework reference as below:
In this example, you need to stop a Framework whose final stopped Framework object needs to be [pushed to/pulled by external systems](#FrameworkPodHistory), so you cannot directly [Delete Framework](#DELETE_Framework).
444
+
1. [Create Framework](#CREATE_Framework) as below:
@@ -713,7 +842,7 @@ Besides these general [Framework ConsistencyGuarantees](#ConsistencyGuarantees),
713
842
To safely run large scale Framework, i.e. the total task number in a single Framework is greater than 300, you just need to enable the [LargeFrameworkCompression](../pkg/apis/frameworkcontroller/v1/config.go). However, you may also need to decompress the Framework by yourself.
714
843
715
844
## <a name="FrameworkPodHistory">Framework and Pod History</a>
716
-
By leveraging the [LogObjectSnapshot](../pkg/apis/frameworkcontroller/v1/config.go), external systems, such as [Fluentd](https://www.fluentd.org) and [ElasticSearch](https://www.elastic.co/products/elasticsearch), can collect and process Framework and Pod history snapshots even if it was retried or deleted, such as persistence, metrics conversion, visualization, alerting, acting, analysis, etc.
845
+
By leveraging the [LogObjectSnapshot](../pkg/apis/frameworkcontroller/v1/config.go), external systems, such as [Fluentd](https://www.fluentd.org) and [ElasticSearch](https://www.elastic.co/products/elasticsearch), can collect and process Framework and Pod history snapshots even if it was retried or deleted, such as for persistence, metrics conversion, visualization, alerting, acting, analysis, etc.
717
846
718
847
## <a name="FrameworkTaskStateMachine">Framework and Task State Machine</a>
719
848
### <a name="FrameworkStateMachine">Framework State Machine</a>
Copy file name to clipboardExpand all lines: example/run/README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Notes:
16
16
17
17
### Prerequisite
18
18
19
-
If the k8s cluster enforces [Authorization](https://kubernetes.io/docs/reference/access-authn-authz/authorization/#using-flags-for-your-authorization-module), you need to first create a [Service Account](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account) with granted permission for FrameworkController. For example, if the cluster enforces [RBAC](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#kubectl-create-clusterrolebinding):
19
+
If the k8s cluster enforces [Authorization](https://kubernetes.io/docs/reference/access-authn-authz/authorization/#using-flags-for-your-authorization-module), you need to first create a [ServiceAccount](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account) with granted permission for FrameworkController. For example, if the cluster enforces [RBAC](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#kubectl-create-clusterrolebinding):
Run FrameworkController with above Service Account and the [k8s inClusterConfig](https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#accessing-the-api-from-a-pod):
29
+
Run FrameworkController with above ServiceAccount and the [k8s inClusterConfig](https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#accessing-the-api-from-a-pod):
30
30
31
31
#### Run with [default config](../../example/config/default/frameworkcontroller.yaml)
32
32
```shell
@@ -51,7 +51,7 @@ spec:
51
51
labels:
52
52
app: frameworkcontroller
53
53
spec:
54
-
# Using the service account with granted permission
54
+
# Using the ServiceAccount with granted permission
55
55
# if the k8s cluster enforces authorization.
56
56
serviceAccountName: frameworkcontroller
57
57
containers:
@@ -115,7 +115,7 @@ spec:
115
115
labels:
116
116
app: frameworkcontroller
117
117
spec:
118
-
# Using the service account with granted permission
118
+
# Using the ServiceAccount with granted permission
0 commit comments