Skip to content

Commit 4099ae7

Browse files
authored
Update helm-requirements.md
1 parent b44ccce commit 4099ae7

File tree

1 file changed

+53
-65
lines changed

1 file changed

+53
-65
lines changed

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

Lines changed: 53 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@ ms.topic: concept-article
88
ms.service: azure-operator-service-manager
99
---
1010

11-
# Helm Requirements Overview
11+
# Helm requirements overview
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 should consider certain best-practice considerations when developing Helm charts.
1313

14-
## Requirements for registryUrl and imagePullSecrets
15-
Every Helm chart generally requires a declared registryUrl and imagePullSecrets. Best practice recommends that the publisher define 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 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.
14+
## Considerations for registryUrl and imagePullSecrets
15+
Every Helm chart generally requires a declared registryUrl and imagePullSecrets. Best practice recommends that the publisher define 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 hid registryUrl and/or imagePullSecrets behind conditionals, or other values restrictions, which were not always met.
17+
* Some charts didnt declare registryUrl and/or imagePullSecrets as the expected named string, instead as an array.
1818

1919
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 methods do not depend upon the registryUrl or imagePullSecrets appearing in the Helm package, instead AOSM derives and injects these values on behalf of the network function.
2020

21-
## Approach for registryUrl and imagePullSecrets
21+
### Method summary for registryUrl and imagePullSecrets
22+
2223
**Legacy.**
2324
* Required publisher to parameterize registryUrl & imagePullSecrets correctly in helm values and templates for substitution.
2425
* Images hosted in publisher Azure Container Registry (ACR).
@@ -33,11 +34,8 @@ To reduce the strict compliance requirements on publishers for registryUrl and i
3334
> [!NOTE]
3435
> 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.
3536
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.
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 Network Function Manager (NFM) contains features to inject 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.
4139

4240
```json
4341
apiVersion: apps/v1
@@ -108,63 +106,13 @@ global:
108106
| registryPath | String | registryPath is the `AzureContainerRegistry` server location |
109107

110108
> [!NOTE]
111-
> * The registryPath is set without any prefix such as `https://` or `oci://`. If needed, publisher must defined a prefix in the helm 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-
```
141-
142-
## Cluster Registry approach for registryUrl and imagePullSecrets
143-
TBD
144-
145-
## Immutability restrictions
146-
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.
147-
148-
### Avoid use of mutable tags
149-
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.
150-
151-
```json
152-
image: "{{ .Values.global.registryPath }}/{{ .Values.image.repository }}:{{ .Values.image.tag}}“
153-
```
109+
> * The registryPath is set without any prefix such as `https://` or `oci://`. If needed, publisher must define a prefix in the helm package.
110+
> * imagePullSecrets and registryPath must be provided in the create NFDVersion onboarding step.
154111
155112
### Avoid references to external registry
156113
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.
157114

158-
```json
159-
image: http://myURL/{{ .Values.image.repository }}:{{ .Values.image.tag}}
160-
```
161-
162-
163-
## Split CRD declaration and usage
164-
We recommend splitting the declaration and usage of CRDs into separate helm charts to support
165-
updates. For detailed information see: [method-2-separate-charts](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#method-2-separate-charts)
166-
167-
## Manual validations
115+
### Manual validations
168116
Review the images and container specs created to ensure the images have prefix of registryURL and the imagePullSecrets are populated with secretName.
169117

170118
```shell
@@ -178,7 +126,7 @@ OR
178126
kubectl create secret <secretName> regcred --docker-server=<registryURL> --dockerusername=<regusername> --docker-password=<regpassword>
179127
```
180128

181-
## Static image repository and tags
129+
### Static image repository and tags
182130
Each helm chart should contain static image repository and tags. Users should set the image repository and tag to static values. The static values are set as follows:
183131
- Setting them in the image line or,
184132
- Setting the Values in values.yaml and not exposing these values in the Network Function Design Version (NFDV).
@@ -199,3 +147,43 @@ image:
199147
repository: contosoapp
200148
tag: 1.14.2
201149
```
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 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+
## Chart immutability restrictions
181+
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. 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.
182+
183+
```json
184+
image: "{{ .Values.global.registryPath }}/{{ .Values.image.repository }}:{{ .Values.image.tag}}“
185+
```
186+
187+
## Chart CRD declaration and usage split
188+
We recommend splitting the declaration and usage of CRDs into separate helm charts to support
189+
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)