Skip to content

Commit 5ca5a9c

Browse files
authored
Update helm-requirements.md
guidance updates.
1 parent 0b46f22 commit 5ca5a9c

File tree

1 file changed

+70
-26
lines changed

1 file changed

+70
-26
lines changed

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

Lines changed: 70 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,43 @@
11
---
22
title: About 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 lifecyce action. For most effecient integration with Azure Operator Service Manager (AOSM), publisher 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+
## Critical Considerations for registryUrl and imagePullSecrets
15+
Every Helm chart generally requires a declared registryUrl and imagePullSecrets. It's recommended that the pubisher define these two parameters consistantly as variables in the values.yaml. At first, AOSM depended upon the publisher exposing these as values in a very 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 don't expose registryUrl and/or imagePullSecrets correctly, hiding them behind conditionals, or other values restrictions, which were not always met.
17+
* Some charts don't expose 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 Reigstry. These two methods do not depend upone the registryUrl or imagePullSecrets appearing in the Helm package, instead these values are derived and injected by AOSM on behalf of the network function.
20+
21+
### Summary of approach options for registryUrl and imagePullSecrets
22+
**Legacy.**
23+
* Required publisher to parameterize registryUrl & imagePullSecrets correctly in helm values and templates for substitution.
24+
* Images hosted in publisher ACR.
25+
26+
**InjectArtifactStoreDetail.**
27+
* Uses a webhook to inject registryUrl & imagePullSecrets directly into pod w/o helm dependency.
28+
* Images hosted in publisher ACR.
29+
30+
**Cluster Registry.**
31+
* Same as InjectArtifactStoreDetail except now the images are now hosted in a local cluster registry.
32+
33+
> [!NOTE]
34+
> In all three cases, AOSM is substituting AOSM derived secrets with whatever secrets a publisher may have had in templates. The only difference is Legeacy and InjectArtifactStoreDetail, the secret is bound to publisher ACR, while in Cluster Registry, the secret is bound to cluster registry.
35+
36+
### Legacy approach for registryUrl and imagePullSecrets
37+
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 registryUrl and imagePullSecrets dynamically into the helm values during Network Function (NF) deployment.
38+
39+
#### How to enable
40+
The following helm deployment template shows an example of how a publisher should expose registryPath and imagePullSecrets for compatibility with AOSM legacy approach.
1641

1742
```json
1843
apiVersion: apps/v1
@@ -41,7 +66,7 @@ spec:
4166
- containerPort: 80
4267
```
4368

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.
69+
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.
4570

4671
```json
4772
{
@@ -63,23 +88,13 @@ spec:
6388

6489
```
6590

66-
The NFDVersion request payload provides the following values in the registryValuesPaths:
91+
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.
6792

6893
```json
6994
"registryValuesPaths": [ "global.registryPath" ],
7095
"imagePullSecretsValuesPaths": [ "global.imagePullSecrets" ],
7196
```
72-
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.
97+
The following `values.yaml` shows an example of how a publisher can provide the registryPath and imagePullSecretsvalue values for compatibility with AOSM legacy approach. This filecontains the default values for a Helm chart. TWo types of variables must be present; imagePullSecrets and registryPath.
8398

8499
```json
85100
global:
@@ -92,11 +107,40 @@ global:
92107
| imagePullSecrets | String | imagePullSecrets are an array of secret names, which are used to pull container images |
93108
| registryPath | String | registryPath is the `AzureContainerRegistry` server location |
94109

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.
110+
> [!NOTE]
111+
> * 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.
112+
> * imagePullSecrets and registryPath must be provided in the create NFDVersion onboarding step.
113+
114+
### injectArtifactStoreDetails approach for registryUrl and imagePullSecrets
115+
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.
116+
117+
#### How to enable
118+
To use injectArtifactStoreDetails, set the installOptions parameter in the NF resource roleOverrides section to true, then use whatever registryURL value is needed to keep the registry URL valid. See following example of injectArtifactStoreDetails parameter enabled.
119+
120+
```bash
121+
resource networkFunction 'Microsoft.HybridNetwork/networkFunctions@2023-09-01' = {
122+
name: nfName
123+
location: location
124+
properties: {
125+
nfviType: 'AzureArcKubernetes'
126+
networkFunctionDefinitionVersionResourceReference: {
127+
id: nfdvId
128+
idType: 'Open'
129+
}
130+
allowSoftwareUpdate: true
131+
nfviId: nfviId
132+
deploymentValues: deploymentValues
133+
configurationType: 'Open'
134+
roleOverrideValues: [
135+
// Use inject artifact store details feature on test app 1
136+
'{"name":"testapp1", "deployParametersMappingRuleProfile":{"helmMappingRuleProfile":{"options":{"installOptions":{"atomic":"false","wait":"false","timeout":"60","injectArtifactStoreDetails":"true"},"upgradeOptions": {"atomic": "false", "wait": "true", "timeout": "100", "injectArtifactStoreDetails": "true"}}}}}'
137+
]
138+
}
139+
}
140+
```
98141

99-
For more information, see: [pull-image-private-registry](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry)
142+
### Cluster Registry approach for registryUrl and imagePullSecrets
143+
TBD
100144

101145
## Immutability restrictions
102146
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.
@@ -115,7 +159,7 @@ Users should avoid using references to an external registry. For example, if dep
115159
image: http://myURL/{{ .Values.image.repository }}:{{ .Values.image.tag}}
116160
```
117161

118-
## Recommendations
162+
## Other Recommendations
119163
Splitting the Custom Resource Definitions (CRDs) declaration and usage plus using manual validations are recommended practices. Each is described in the following sections.
120164

121165
### Split CRD declaration and usage
@@ -154,4 +198,4 @@ YAML values.yaml
154198
image:
155199
repository: contosoapp
156200
tag: 1.14.2
157-
```
201+
```

0 commit comments

Comments
 (0)