Skip to content

Commit d90478e

Browse files
Merge pull request #293856 from msftadam/patch-51
Update helm-requirements.md
2 parents 0bb9fd8 + 6236ff8 commit d90478e

File tree

1 file changed

+83
-51
lines changed

1 file changed

+83
-51
lines changed
Lines changed: 83 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,41 @@
11
---
2-
title: About Helm package requirements for Azure Operator Service Manager
2+
title: Helm package requirements for Azure Operator Service Manager
33
description: Learn about the Helm package requirements for Azure Operator Service Manager.
4-
author: sherrygonz
5-
ms.author: sherryg
6-
ms.date: 09/07/2023
4+
author: msftadam
5+
ms.author: adamdor
6+
ms.date: 01/30/2025
77
ms.topic: concept-article
88
ms.service: azure-operator-service-manager
99
---
1010

11-
# Helm package requirements
12-
Helm is a package manager for Kubernetes that helps you manage Kubernetes applications. Helm packages are called charts, and they consist of a few YAML configuration files and some templates that are rendered into Kubernetes manifest files. Charts are reusable by anyone for any environment, which reduces complexity and duplicates.
11+
# Helm requirements overview
12+
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

14-
## Registry URL path and imagepullsecrets requirements
15-
When developing a helm package, it's common to keep the container registry server URL in the values. Keeping the container registry server URL in the values is useful for moving artifacts between each environment container registry. Azure Operator Service Manager (AOSM) uses the Network Function Manager (NFM) service to deploy Containerized Network Function (CNF). The Network Function Manager (NFM) contains features to inject container registry server location and imagepullsecrets into the helm values during Network Function (NF) deployment. An imagePullSecret is an authorization token, also known as a secret, that stores Docker credentials that are used for accessing a registry. For example, if you need to deploy an application via Kubernetes deployment, you can define a deployment like the following example:
14+
## 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.
16+
* Some charts hide registryUrl and/or imagePullSecrets behind conditionals, or other values restrictions, which were not always met.
17+
* Some charts don't declare registryUrl and/or imagePullSecrets as the expected named string, instead as an array.
18+
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.
20+
21+
### Method summary for registryUrl and imagePullSecrets
22+
23+
**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).
26+
27+
**InjectArtifactStoreDetail.**
28+
* Uses a webhook to inject registryUrl & imagePullSecrets directly into pod without any dependency on helm.
29+
* Images still hosted in publisher ACR.
30+
31+
**Cluster Registry.**
32+
* Same as InjectArtifactStoreDetail, except now the images are hosted in the local cluster registry.
33+
34+
> [!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.
36+
37+
## 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.
1639

1740
```json
1841
apiVersion: apps/v1
@@ -41,7 +64,7 @@ spec:
4164
- containerPort: 80
4265
```
4366

44-
`values.schema.json` is a file that allows you to easily set value requirements and constraints in a single location for Helm charts. In this file, define registryPath and imagePullSecrets as required properties.
67+
The following `values.schema.json` file shows an example of how a publisher can easily set registryPath and imagePullSecretsvalue requirements for compatibility with AOSM legacy approach.
4568

4669
```json
4770
{
@@ -63,23 +86,14 @@ spec:
6386

6487
```
6588

66-
The NFDVersion request payload provides the following values in the registryValuesPaths:
89+
The following `NFDVersion request payload` shows an example of how a publisher can provide the registryPath and imagePullSecretsvalue values for compatibility with AOSM legacy approach.
6790

6891
```json
6992
"registryValuesPaths": [ "global.registryPath" ],
7093
"imagePullSecretsValuesPaths": [ "global.imagePullSecrets" ],
7194
```
7295

73-
During an NF deployment, the Network Function Operator (NFO) sets the registryPath to the correct Azure Container Registry (ACR) server location. For example, the NFO runs the following equivalent command:
74-
75-
```shell
76-
$ helm install --set "global.registryPath=<registryURL>" --set "global.imagePullSecrets[0].name=<secretName>" releasename ./releasepackage
77-
```
78-
79-
> [!NOTE]
80-
> The registryPath is set without any prefix such as https:// or oci://. If a prefix is required in the helm package, publishers need to define this in the package.
81-
82-
`values.yaml` is a file that contains the default values for a Helm chart. It's a YAML file that defines the default values for a chart. In the values.yaml file, two types of variables must be present; imagePullSecrets and registryPath. Each is described in the table.
96+
The following `values.yaml` shows an example of how a publisher can provide the registryPath and imagePullSecretsvalue values for compatibility with AOSM legacy approach.
8397

8498
```json
8599
global:
@@ -92,36 +106,13 @@ global:
92106
| imagePullSecrets | String | imagePullSecrets are an array of secret names, which are used to pull container images |
93107
| registryPath | String | registryPath is the `AzureContainerRegistry` server location |
94108

95-
imagePullSecrets and registryPath must be provided in the create NFDVersion onboarding step.
96-
97-
An NFO running in the cluster populates these two variables (imagePullSecrets and registryPath) during a helm release using the helm install –set command.
98-
99-
For more information, see: [pull-image-private-registry](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry)
100-
101-
## Immutability restrictions
102-
Immutability restrictions prevent changes to a file or directory. For example, an immutable file can't be changed or renamed, and a file that allows append operations can't be deleted, modified, or renamed.
103-
104-
### Avoid use of mutable tags
105-
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.
106-
107-
```json
108-
image: "{{ .Values.global.registryPath }}/{{ .Values.image.repository }}:{{ .Values.image.tag}}“
109-
```
109+
> [!NOTE]
110+
> * The registryPath is set without any prefix such as `https://` or `oci://`. If needed, publisher must define a prefix in the helm package.
111+
> * imagePullSecrets and registryPath must be provided in the create NFDVersion onboarding step.
110112
111113
### Avoid references to external registry
112114
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.
113115

114-
```json
115-
image: http://myURL/{{ .Values.image.repository }}:{{ .Values.image.tag}}
116-
```
117-
118-
## Recommendations
119-
Splitting the Custom Resource Definitions (CRDs) declaration and usage plus using manual validations are recommended practices. Each is described in the following sections.
120-
121-
### Split CRD declaration and usage
122-
We recommend splitting the declaration and usage of CRDs into separate helm charts to support
123-
updates. For detailed information see: [method-2-separate-charts](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#method-2-separate-charts)
124-
125116
### Manual validations
126117
Review the images and container specs created to ensure the images have prefix of registryURL and the imagePullSecrets are populated with secretName.
127118

@@ -135,17 +126,19 @@ OR
135126
helm install --set "global.imagePullSecrets[0].name=<secretName>" --set "global.registry.url=<registryURL>" <release-name> <chart-name> --dry-run
136127
kubectl create secret <secretName> regcred --docker-server=<registryURL> --dockerusername=<regusername> --docker-password=<regpassword>
137128
```
129+
138130
### Static image repository and tags
139-
Each helm chart should contain static image repository and tags. Users should set the image repository and tag to static values. The static values can be set by:
140-
- By hard-coding them in the image line or,
141-
- Setting the Values in values.yaml and not exposing these values in the Network Function Design Version (NFDV).
131+
Each helm chart should contain static image repository and tags. The static values are set as follows:
132+
- Setting them in the image line or,
133+
- Setting them in values.yaml and not exposing these values in the Network Function Design Version (NFDV).
142134

143135
A Network Function Design Version (NFDV) should map to a static set of helm charts and images. The charts and images are only updated by publishing a new Network Function Design Version (NFDV).
144136

145137
```json
146138
image: "{{ .Values.global.registryPath }}/contosoapp:1.14.2“
147139
```
148-
or
140+
141+
Or
149142

150143
```json
151144
image: "{{ .Values.global.registryPath }}/{{ .Values.image.repository }}:{{ .Values.image.tag}}“
@@ -154,4 +147,43 @@ YAML values.yaml
154147
image:
155148
repository: contosoapp
156149
tag: 1.14.2
157-
```
150+
```
151+
152+
```json
153+
image: http://myURL/{{ .Values.image.repository }}:{{ .Values.image.tag}}
154+
```
155+
156+
## 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.
158+
159+
```bash
160+
resource networkFunction 'Microsoft.HybridNetwork/networkFunctions@2023-09-01' = {
161+
name: nfName
162+
location: location
163+
properties: {
164+
nfviType: 'AzureArcKubernetes'
165+
networkFunctionDefinitionVersionResourceReference: {
166+
id: nfdvId
167+
idType: 'Open'
168+
}
169+
allowSoftwareUpdate: true
170+
nfviId: nfviId
171+
deploymentValues: deploymentValues
172+
configurationType: 'Open'
173+
roleOverrideValues: [
174+
// Use inject artifact store details feature on test app 1
175+
'{"name":"testapp1", "deployParametersMappingRuleProfile":{"helmMappingRuleProfile":{"options":{"installOptions":{"atomic":"false","wait":"false","timeout":"60","injectArtifactStoreDetails":"true"},"upgradeOptions": {"atomic": "false", "wait": "true", "timeout": "100", "injectArtifactStoreDetails": "true"}}}}}'
176+
]
177+
}
178+
}
179+
```
180+
181+
## Chart immutability restrictions
182+
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.
183+
184+
```json
185+
image: "{{ .Values.global.registryPath }}/{{ .Values.image.repository }}:{{ .Values.image.tag}}“
186+
```
187+
188+
## Chart CRD declaration and usage split
189+
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)