Skip to content

Commit b4ea32c

Browse files
Merge pull request #294266 from msftadam/patch-52
Update helm-requirements.md
2 parents 498ff85 + 5d84add commit b4ea32c

File tree

1 file changed

+33
-19
lines changed

1 file changed

+33
-19
lines changed

articles/operator-service-manager/helm-requirements.md

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,35 @@ ms.service: azure-operator-service-manager
1212
Helm is a package manager for Kubernetes that helps to 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 action. For most efficient integration with Azure Operator Service Manager (AOSM), publisher's should consider certain best-practice considerations when developing Helm charts.
1313

1414
## Considerations for registryUrl and imagePullSecrets
15-
Every Helm chart generally requires a declared registryUrl and imagePullSecrets. Best practice recommends that the publisher defines these two parameters consistently as variables in the values.yaml. At first, AOSM depended upon the publisher exposing these values in a strict manner, so they could be ingested and then injected during deployment. This approach is known as the legacy method. Overtime, many complications arose, as not all publishers charts complied with the strict definition of registryUrl and imagePullSecrets required by AOSM.
15+
Every Helm chart generally requires a registryUrl and imagePullSecrets. Most commonly, a publisher exposes these parameters in the values.yaml. At first, AOSM depended upon the publisher exposing these values in a strict manner, so they could be substituted for the proper Azure values during deployment. Overtime, not all publishers could easily comply with the strict handling of these values required by AOSM.
1616
* Some charts hide registryUrl and/or imagePullSecrets behind conditionals, or other values restrictions, which were not always met.
1717
* Some charts don't declare registryUrl and/or imagePullSecrets as the expected named string, instead as an array.
1818

19-
To reduce the strict compliance requirements on publishers for registryUrl and imagePullSecrets, AOSM later introduced two improved methods of handling these values. First injectArtifactStoreDetail and finally Cluster Registry. These two newer methods do not depend upon the registryUrl or imagePullSecrets appearing in the Helm package, at all. Instead these methods derive and inject these values on behalf of the network function.
19+
To reduce the strict compliance requirements on publishers, AOSM later introduced two improved methods of handling these values. First injectArtifactStoreDetail and finally Cluster Registry. These two newer methods do not depend upon valid registryUrl or imagePullSecrets appearing in the Helm package. Instead, these methods inject these values directly into pod operations, on behalf of the network function.
2020

2121
### Method summary for registryUrl and imagePullSecrets
22+
All three methods are supported and described in this article. A publisher should choose the best option for their Network Function and use-case.
2223

2324
**Legacy.**
24-
* Required publisher to parameterize registryUrl & imagePullSecrets correctly in helm values and templates for substitution.
25-
* Images hosted in publisher Azure Container Registry (ACR).
25+
* Requires publisher to compliantly parameterize registryUrl & imagePullSecrets in helm values and deployment templates for substitution.
26+
* Images are hosted in the publisher Azure Container Registry (ACR).
2627

2728
**InjectArtifactStoreDetail.**
28-
* Uses a webhook to inject registryUrl & imagePullSecrets directly into pod without any dependency on helm.
29-
* Images still hosted in publisher ACR.
29+
* Uses a webhook to inject registryUrl & imagePullSecrets directly into pod operations, with minimal dependencies on helm.
30+
* Images are still hosted in the publisher ACR.
3031

3132
**Cluster Registry.**
32-
* Same as InjectArtifactStoreDetail, except now the images are hosted in the local cluster registry.
33+
* Uses a webhook to inject registryUrl & imagePullSecrets directly into pod operations, with no dependency on helm.
34+
* Images are hosted in the local NFO extension cluster registry.
3335

3436
> [!NOTE]
35-
> In all three cases, AOSM is substituting AOSM derived secrets with whatever secrets a publisher exposes in templates. The only difference is Legacy and InjectArtifactStoreDetail, the secret is bound to publisher ACR, while in Cluster Registry, the secret is bound to cluster registry.
37+
> In all three cases, AOSM is substituting AOSM values for whatever values a publisher exposes in templates. The only difference is method for substitution.
3638
3739
## Legacy requirements for registryUrl and imagePullSecrets
38-
Azure Operator Service Manager (AOSM) uses the Network Function Manager (NFM) service to deploy Containerized Network Function (CNF). The NFM injects container registryUrl and imagePullSecrets dynamically into the helm values during Network Function (NF) deployment. The following helm deployment template shows an example of how a publisher should expose registryPath and imagePullSecrets for compatibility with AOSM legacy approach.
40+
Azure Operator Service Manager (AOSM) uses the Network Function Manager (NFM) service to deploy Containerized Network Functions (CNFs). With the legacy method, NFM substitutes the AOSM container registryUrl and imagePullSecrets values into the helm operation during Network Function (NF) deployment.
41+
42+
### Using legacy method
43+
The following helm deployment template shows an example of how a publisher should expose registryPath and imagePullSecrets for compatibility with AOSM legacy approach.
3944

4045
```json
4146
apiVersion: apps/v1
@@ -101,19 +106,20 @@ global:
101106
registryPath: “”
102107
```
103108

104-
| Name | Type | Description |
105-
| :--- | :----: | :--- |
106-
| imagePullSecrets | String | imagePullSecrets are an array of secret names, which are used to pull container images |
107-
| registryPath | String | registryPath is the `AzureContainerRegistry` server location |
108-
109109
> [!NOTE]
110110
> * The registryPath is set without any prefix such as `https://` or `oci://`. If needed, publisher must define a prefix in the helm package.
111111
> * imagePullSecrets and registryPath must be provided in the create NFDVersion onboarding step.
112112
113-
### Avoid references to external registry
113+
### Other considerations with Legacy method
114+
Publisher should additional consider the following recommendations when using the legacy method:
115+
* Avoid references to external registry
116+
* Performa manual validations
117+
* Ensure static image repository and tags
118+
119+
#### Avoid references to external registry
114120
Users should avoid using references to an external registry. For example, if deployment.yaml uses a hardcoded registry path or external registry references it fails validation.
115121

116-
### Manual validations
122+
#### Perform manual validations
117123
Review the images and container specs created to ensure the images have prefix of registryURL and the imagePullSecrets are populated with secretName.
118124

119125
```shell
@@ -127,7 +133,7 @@ OR
127133
kubectl create secret <secretName> regcred --docker-server=<registryURL> --dockerusername=<regusername> --docker-password=<regpassword>
128134
```
129135

130-
### Static image repository and tags
136+
#### Ensure static image repository and tags
131137
Each helm chart should contain static image repository and tags. The static values are set as follows:
132138
- Setting them in the image line or,
133139
- Setting them in values.yaml and not exposing these values in the Network Function Design Version (NFDV).
@@ -154,7 +160,10 @@ image:
154160
```
155161

156162
## injectArtifactStoreDetails requirements for registryUrl and imagePullSecrets
157-
In some cases, third-party helm charts may not be fully compliant with AOSM requirements for registryURL. In this case, the injectArtifactStoreDetails feature can be used to avoid making changes to helm packages. To use injectArtifactStoreDetails, set the installOptions parameter in the NF resource roleOverrides section to true, then in the helm chart package, use whatever registryURL value is needed to keep the registry URL valid. See following example of injectArtifactStoreDetails parameter enabled.
163+
In some cases, third-party helm charts may not be fully compliant with AOSM requirements for registryURL. In this case, the injectArtifactStoreDetails feature can be used to avoid making compliance changes to helm packages. With injectArtifactStoreDetails enabled, a webhook method is used to inject the proper registryUrl and imagePullSecrets dynamically during the pod operations. This overrides the values which are configured in the helm package.
164+
165+
### Using injectArtifactStoreDetails method
166+
To enable injectArtifactStoreDetails, set the installOptions parameter in the NF resource roleOverrides section to true, as shown in the following example.
158167

159168
```bash
160169
resource networkFunction 'Microsoft.HybridNetwork/networkFunctions@2023-09-01' = {
@@ -178,12 +187,17 @@ resource networkFunction 'Microsoft.HybridNetwork/networkFunctions@2023-09-01' =
178187
}
179188
```
180189

190+
> [!NOTE]
191+
> The helm chart package must still expose properly formatted registryURL and imagePullSecrets values.
192+
193+
## Cluster registry requirements for registryUrl and imagePullSecrets
194+
For information on using cluster registry, please see the [concept documentation](get-started-with-cluster-registry.md).
195+
181196
## Chart immutability restrictions
182197
Immutability restrictions prevent changes to a file or directory. For example, an immutable file can't be changed or renamed. Users should avoid using mutable tags such as latest, dev, or stable. For example, if deployment.yaml used 'latest' for the .Values.image.tag the deployment would fail.
183198

184199
```json
185200
image: "{{ .Values.global.registryPath }}/{{ .Values.image.repository }}:{{ .Values.image.tag}}“
186201
```
187-
188202
## Chart CRD declaration and usage split
189203
We recommend splitting the declaration and usage of customer resource definitions (CRD) into separate helm charts to support updates. For detailed information see: [method-2-separate-charts](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#method-2-separate-charts)

0 commit comments

Comments
 (0)