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
Copy file name to clipboardExpand all lines: hips/hip-00xx-sequencing.md
+26-23Lines changed: 26 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,63 +34,66 @@ This design was chosen due to simplicity and clarity of how it works for both th
34
34
35
35
At a high level, allow Chart Developers to assign named dependencies to both their Helm templated resources and Helm chart dependencies that Helm then uses to generate a deployment sequence at installation time.
36
36
37
-
For Helm CLI, the `--wait=ordered` flag will enable sequencing where resources are applied in groups of layers. SDK users will also be able to enable sequencing by setting a `Wait` boolean flag. Without this flag being enabled, resources will all be applied all at once which is the same behaviour in Chart v2.
37
+
For Helm CLI, the `--wait=ordered` flag will enable sequencing where resources are applied in groups. SDK users will also be able to enable sequencing by setting a `WaitStrategy` field. By default, resources are all applied at once which is the same behaviour in Chart v2.
38
38
39
39
Each release will store information of whether sequencing was used or not. This information is used when performing uninstalls and rollbacks.
40
40
41
41
The following annotations would be added to enable this.
42
42
43
43
*Additions to templates*
44
-
-`helm.sh/layer`: Annotation to declare a layer that a given resource belongs to. Any number of resources can belong to a layer. A resource can only belong to one layer.
45
-
-`helm.sh/depends-on/layers`: Annotation to declare layers that must exist and in a ready state before this resource can be deployed. Order of the layers has no significance
44
+
-`helm.sh/resource-group`: Annotation to declare a resource-group that a given resource belongs to. Any number of resources can belong to a group. A resource can only belong to one group.
45
+
-`helm.sh/depends-on/resource-groups`: Annotation to declare resource-groups that must exist and in a ready state before this resource can be deployed. Order of the resource-groups has no significance
46
46
47
47
*Additions to Chart.yaml*
48
48
-`helm.sh/depends-on/subcharts`: Annotation added to `Chart.yaml` to declare chart dependencies, by name or tags, that must be deployed fully and in a ready state before the chart can be deployed. For the dependency or subchart chart to be declared ready, all of its resources, with their sequencing order taken into consideration, would need to be deployed and declared ready. Order of the charts has no significance.
49
49
-`depends-on`: A new field added to `Chart.yaml``dependencies` fields that is meant to declare a list of subcharts, by name or tag, that need to be ready before the subchart in questions get installed. This will be used to create a dependency graph for subcharts.
50
50
51
-
The installation process would group resources in the same layer and send them to the K8s API Server in one bundle, and once all resources are "ready", the next layer would be installed. A layer would not be considered "ready" and the next layer installed until all resources in that layer are considered "ready". Readiness is described in a later section. A similar process would apply for upgrades. Uninstalls would function on the same layer order, but backwards, where a layer is not uninstalled until all layers that depend on it are first uninstalled. Upgrades would follow the same order as installation.
51
+
The installation process would group resources in the same group and send them to the K8s API Server in one bundle, and once all resources are "ready", the next group would be installed. A resource-group would not be considered "ready" and the next group installed until all resources in that group are considered "ready". Readiness is described in a later section. A similar process would apply for upgrades. Uninstalls would function on the same resource-group order, but in reverse, where a resource-group is not uninstalled until all resource-groups that depend on it are first uninstalled. Upgrades would follow the same order as installation.
52
52
53
-
`helm.sh/layer` and `helm.sh/depends-on/layers` ordering annotations are only used when ordering resources in the same chart. When it comes to resources across charts one needs to declare `helm.sh/depends-on/subcharts` or `depends-on` in Chart.yaml to allow Helm to reason how to order install/upgrade/uninstall subcharts.
53
+
The `helm.sh/resource-group` and `helm.sh/depends-on/resource-groups`annotations are used exclusively to control the ordering of resources **within a single chart**. These annotations have no effect across chart boundaries and cannot be used to influence the order of resources in other charts or subcharts.
In this example, Helm would be responsible for resolving the annotations on these three resources and deploy all resources in the following order. Resources in `database` and `queue` layers would be deployed at the same time. They would need to be ready before attempting to deploy `app` layer resources:
78
+
In this example, Helm would be responsible for resolving the annotations on these three resources and deploy all resources in the following order. Resources in `database` and `queue`resource-groups would be deployed at the same time. They would need to be ready before attempting to deploy `app`resource-group:
78
79
79
80
```
80
-
"database" layer: [db-service]
81
+
"database" group: [db-service]
81
82
||
82
-
"queue" layer: || [queue-processor]
83
+
"queue" group: || [queue-processor]
83
84
|| ||
84
85
|| ||
85
86
\/ \/
86
87
\\ //
87
88
\\ //
88
89
\/ \/
89
-
"app" layer: [my-app]
90
+
"app" group: [my-app]
90
91
```
91
92
92
93
#### Chart dependencies example
93
94
95
+
To control the order in which subcharts are installed, upgraded, or uninstalled, chart authors must use the `helm.sh/depends-on/subcharts` annotation or the `depends-on` field in the `Chart.yaml`. These declarations enable Helm to determine the correct sequencing of subchart operations, as illustrated below.
96
+
94
97
```yaml
95
98
name: foo
96
99
annotations:
@@ -177,31 +180,31 @@ Resources with sequencing annotations in a chart would be deployed first followe
177
180
- Installs: Helm will install resources in the order defined by the DAG. If any of the readiness checks fail or timeout, the entire install would fail and the release marked as failed. If `--atomic`, or its SDK equivalent is used, a rollback to the last successful install would take place.
178
181
- Uninstalls: Helm would uninstall resources in the reverse order they were installed, as per the sequencing order. The logic to delete each resource will not change.
179
182
- Rollbacks: Helm will check from the release object whether the revision being rolled back to, was installed in a sequenced manner. If it was, Helm will respect and enforce this order when installing resources from that revision. When deleting unneeded resources of the revision being rolled back from, the reverse order is followed just like uninstalls.
180
-
- `helm template`would print all resources in the order they would be deployed. Groups of resources in a layer would be delimited using a `## START layer: <chart> <layer-name>` comment indicating the beginning of each layer and `END layer: <chart> <layer-name>`.
183
+
- `helm template`would print all resources in the order they would be deployed. Groups of resources in a resource-group would be delimited using a `## START resource-group: <chart>/<subchart> <group-name>` comment indicating the beginning of each resource-group and `END resource-group: <chart>/<subchart> <group-name>`.
0 commit comments