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
Revise Helm package requirements to best practices
Updated the title and description to reflect best practices for Helm packages in Azure Operator Service Manager. Removed redundant text and improved clarity in the document.
# Helm package requirements for Azure Operator Service Manager
13
-
14
-
Helm is a package manager for Kubernetes that helps simplify application lifecycle management. Helm packages are called *charts* and consist of YAML configuration and template files.
15
-
16
-
Upon execution of a Helm operation, the charts are rendered into Kubernetes manifest files to trigger the appropriate application lifecycle actions. For the most efficient integration with Azure Operator Service Manager, use best practices when you're developing Helm charts.
12
+
# Helm package best practices
13
+
Helm is a package manager for Kubernetes that helps simplify application lifecycle management. Helm packages are called *charts* and consist of YAML configuration and template files. Upon execution of a Helm operation, the charts are rendered into Kubernetes manifest files to trigger the appropriate application lifecycle actions. For the most efficient integration with Azure Operator Service Manager, follow these recommended best practices when developing Helm charts.
17
14
18
15
## Considerations for registryPath and imagePullSecrets
19
-
20
-
Every Helm chart generally requires `registryPath` and `imagePullSecrets` parameters. Most commonly, you expose these parameters in the `values.yaml` file.
21
-
22
-
At first, Azure Operator Service Manager depended on publishers managing these values in a strict manner (legacy approach), to be substituted for the proper Azure values during deployment. But not all publishers could easily comply with the strict management of these values. Some charts hide `registryPath` and/or `imagePullSecrets` behind conditionals, or other value restrictions, which weren't always met. Some charts declare `registryPath` and/or `imagePullSecrets` as an array instead of as the expected named string.
16
+
Every Helm chart generally requires `registryPath` and `imagePullSecrets` parameters. Most commonly, you expose these parameters in the `values.yaml` file. At first, Azure Operator Service Manager depended on publishers managing these values in a strict manner (legacy approach), to be substituted for the proper Azure values during deployment. But not all publishers could easily comply with the strict management of these values. Some charts hide `registryPath` and/or `imagePullSecrets` behind conditionals, or other value restrictions, which weren't always met. Some charts declare `registryPath` and/or `imagePullSecrets` as an array instead of as the expected named string.
23
17
24
18
To reduce the compliance requirements on publishers, Azure Operator Service Manager introduced two improved methods: `injectArtifactStoreDetail` and cluster registry. These newer methods don't depend on `registryPath` or `imagePullSecrets` appearing in the Helm package. Instead, these methods use a webhook to inject proper Azure values directly into pod operations.
25
19
26
20
### Method summary for registryPath and imagePullSecrets
27
-
28
21
All three methods are presently supported as described in this article. Choose the best option for your network function (NF) and use case.
29
22
30
23
Legacy:
31
-
32
24
* Requires you to parameterize `registryPath` and `imagePullSecrets` in Helm values and deployment templates for substitution.
33
25
* Hosts images in Azure Container Registry.
34
26
35
27
InjectArtifactStoreDetail:
36
-
37
28
* Uses a webhook to inject `registryPath` and `imagePullSecrets` directly into pod operations, with minimal dependencies on Helm.
38
29
* Hosts images in Azure Container Registry.
39
30
40
31
Cluster registry:
41
-
42
32
* Uses a webhook to inject `registryPath` and `imagePullSecrets` directly into pod operations, with no dependency on Helm.
43
33
* Hosts images in the local network function operator (NFO) extension.
44
34
45
35
In all three cases, Azure Operator Service Manager substitutes Azure values for whatever values you expose in templates. The only difference is the method of substitution.
46
36
47
37
## Legacy requirements for registryPath and imagePullSecrets
48
-
49
38
Azure Operator Service Manager uses the Azure Network Function Manager service to deploy containerized network functions (CNFs). With the legacy method, Azure Network Function Manager substitutes the Azure Operator Service Manager container's `registryPath` and `imagePullSecrets` values into the Helm operation during the deployment of network functions.
50
39
51
40
### Example of the legacy method
52
-
53
41
The following Helm deployment template shows an example of how you should expose `registryPath` and `imagePullSecrets`:
54
42
55
43
```
@@ -122,15 +110,12 @@ In the preceding examples:
122
110
*`imagePullSecrets` and `registryPath` must be provided during NFDV onboarding.
123
111
124
112
### Other considerations
125
-
126
113
Consider the following recommendations when you're using the legacy method.
127
114
128
115
#### Avoid references to an external registry
129
-
130
116
References to an external registry can cause validation problems. For example, if `deployment.yaml` uses a hard-coded registry path or external registry references, it fails validation.
131
117
132
118
#### Perform manual validations
133
-
134
119
Review the images and container specifications to ensure that the images have a prefix of `registryPath` and that `imagePullSecrets` is populated with `secretName`:
135
120
136
121
```shell
@@ -145,9 +130,7 @@ Here's another example:
145
130
```
146
131
147
132
#### Use a static image repository and tags
148
-
149
133
Each Helm chart should contain a static image repository and tags. You set the static values through one of the following methods:
150
-
151
134
* In the `image` line
152
135
* In `values.yaml`, without exposing these values in the NFDV
153
136
@@ -171,7 +154,6 @@ image:
171
154
```
172
155
173
156
## injectArtifactStoreDetails requirements for registryPath and imagePullSecrets
174
-
175
157
In some cases, third-party Helm charts might not be fully compliant with Azure Operator Service Manager requirements for `registryPath`. In these cases, you can use `injectArtifactStoreDetails` to avoid making compliance changes to Helm packages.
176
158
177
159
With `injectArtifactStoreDetails` enabled, you use a webhook method to inject the proper `registryPath` and `imagePullSecrets` dynamically during the pod operations. This method overrides the values that are configured in the Helm package. You still must use legal dummy values where `registryPath` and `imagePullSecrets` are referenced, usually in the `global` section of `values.yaml`.
@@ -188,7 +170,6 @@ global:
188
170
> If `registryPath` is left blank in the underlying Helm package, site network service (SNS) deployment fails during image download.
189
171
190
172
### Using the injectArtifactStoreDetails method
191
-
192
173
To enable `injectArtifactStoreDetails`, set the `installOptions` parameter in the NF resource's `roleOverrides` section to `true`, as shown in the following example:
> The Helm chart package must still expose properly formatted `registryPath` and `imagePullSecrets` values.
218
199
219
200
## Cluster registry requirements for registryPath and imagePullSecrets
220
-
221
201
With a cluster registry, images are copied from Azure Container Registry to a local Docker repository on the Nexus Kubernetes cluster. You use a webhook method to inject the proper `registryPath` and `imagePullSecrets` values dynamically during the pod operations. This method overrides the values that are configured in the Helm package. You still must use legal dummy values where `registryPath` and `imagePullSecrets` are referenced, usually in the `global` section of `values.yaml`.
222
202
223
203
The following `values.yaml` example shows how you can provide the `registryPath` and `imagePullSecrets` values for compatibility with the cluster registry approach:
@@ -234,19 +214,16 @@ global:
234
214
For more information on using a cluster registry, see the [concept documentation](get-started-with-cluster-registry.md).
235
215
236
216
## Recommendations for immutability restrictions
237
-
238
217
Immutability restrictions prevent changes to a file or directory. For example, an immutable file can't be changed or renamed. You should avoid using mutable tags such as `latest`, `dev`, or `stable`. For example, if `deployment.yaml` uses `latest` for `.Values.image.tag`, the deployment fails.
## Recommendations for CRD declaration and usage split
245
-
246
224
We recommend splitting the declaration and usage of customer resource definitions (CRDs) into separate Helm charts to support updates. For detailed information, see the [Helm documentation about separating charts](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#method-2-separate-charts).
247
225
248
226
## Recommendations for Image Version Tagging
249
-
250
227
To ensure consistent and predictable deployments, we recommend the following for all container images:
251
228
* Avoid using `:latest` in production environments.
252
229
* Using latest can cause unexpected behavior because the actual image behind latest can change without notice.
@@ -257,4 +234,78 @@ To ensure consistent and predictable deployments, we recommend the following for
257
234
258
235
These practices help prevent deployment issues and improve traceability, rollback safety, and security compliance.
259
236
237
+
## Recommendations for nfApplication sequential ordering
238
+
By default, CNF applications are installed or updated based on the order in which they appear in the NFDV. For the deletion operation, the CNF applications are deleted in the specified reverse order. If you need to define a specific order of CNF applications that's different from the default, use `dependsOnProfile` to define a unique sequence for installation, update, and deletion operations.
239
+
240
+
### How to use dependsOnProfile
241
+
You can use `dependsOnProfile` in the NFDV to control the sequence of Helm executions for CNF applications. In the example that follows:
242
+
- During an installation operation, the CNF applications are deployed in the following order: `dummyApplication1`, `dummyApplication2`, `dummyApplication`.
243
+
- During an update operation, the CNF applications are updated in the following order: `dummyApplication2`, `dummyApplication1`, `dummyApplication`.
244
+
- During a deletion operation, the CNF applications are deleted in the following order: `dummyApplication2`, `dummyApplication1`, `dummyApplication`.
Currently, if the `dependsOnProfile` code provided in the NFDV is invalid, the NF operation fails with a validation error. The message for the validation error appears in the operation status resource and looks similar to the following example:
0 commit comments