Skip to content

Commit 9fde7fb

Browse files
authored
Merge pull request #299269 from msftadam/patch-72
Update safe-upgrade-practices.md
2 parents ed82b77 + ebd44da commit 9fde7fb

File tree

1 file changed

+56
-15
lines changed

1 file changed

+56
-15
lines changed

articles/operator-service-manager/safe-upgrade-practices.md

Lines changed: 56 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,15 @@ After fixing the failed nfApp, but before attempting an upgrade retry, consider
107107
By default, the reput retries nfApps in the declared update order, unless they're skipped using `applicationEnablement` flag.
108108

109109
## Skip nfApps using applicationEnablement
110-
In the NFDV resource, under `deployParametersMappingRuleProfile` there's the property `applicationEnablement` of type enum, which takes values: Unknown, Enabled, or disabled. It can be used to exclude nfApp operations during network function (NF) deployment.
110+
In the NFDV resource, under `deployParametersMappingRuleProfile` there's a supported property `applicationEnablement` of type enum, which takes values of Unknown, Enabled, or disabled. It can be used to manually exclude nfApp operations during network function (NF) deployment. The following example demonstrates a generic method to parameterize `applicationEnablement` as an included value in `roleOverrideValues` property.
111111

112-
### Publisher changes
113-
For the `applicationEnablement` property, the publisher has two options: either provide a default value or parameterize it. The following example sets `enabled` as the default value for `hellotest` which can later be changed via override.
112+
### Template changes
113+
While no NFDV changes are necessarily required, optionally the publisher can use the NFDV to set a default value for the `applicationEnablement` property. The default value will be used, unless its changed via `roleOverrideValues`.
114+
115+
#### NFDV Template
116+
Use the NFDV template to set a default value for `applicationEnablement`. The following example sets `enabled` state as the default value for `hellotest` networkfunctionApplication.
114117

115118
```json
116-
{
117119
"location":"<location>",
118120
"properties": {
119121
"networkFunctionTemplate": {
@@ -122,27 +124,66 @@ For the `applicationEnablement` property, the publisher has two options: either
122124
"applicationEnablement": "Enabled"
123125
},
124126
"name": "hellotest"
125-
}
126127
],
127128
"nfviType": "AzureArcKubernetes"
128-
},
129+
},
130+
}
131+
```
132+
133+
To manage the `applicationEnablement` value more dynamically, the Operator can pass a realtime value using the NF template `roleOverrideValues` property. While it's possible for the operator to manipulate the NF template directly, instead it's suggested to parameterize the `roleOverrideValues`, so that values can be passed via a CGV template at runtime. This requires the following modifications to the CGS, NF templates and finally the CGV.
134+
135+
#### CGS Template
136+
The CGS template must be updated to include one variable declaration for each line to parameterize under `roleOverrideValues`. The below example demonstrates three override values, one to for nfConfiguration [0] and two for nfApplication options [1,2].
137+
138+
```json
139+
"roleOverrideValues0": {
140+
"type": "string"
141+
},
142+
"roleOverrideValues1": {
143+
"type": "string"
144+
},
145+
"roleOverrideValues2": {
146+
"type": "string"
147+
}
148+
```
149+
150+
#### NF Template
151+
The NF template must be update three ways. First, the implicit config parameter must be defined as type object. Second, roleOverrideValues0, roleOverrideValues1 and roleOverrideValues2 must be declared as variables mapped to config parameter. Third, roleOverrideValues0, roleOverrideValues1 and roleOverrideValues2 must be referenced for substitution under `roleOverrideValues` in proper order and following proper syntax.
152+
153+
```json
154+
"parameters": {
155+
"config": {
156+
"type": "object",
157+
"defaultValue": {}
129158
}
130-
}
159+
}
160+
"variables": {
161+
"roleOverrideValues0": "[string(parameters('config').roleOverrideValues1)]",
162+
"roleOverrideValues1": "[string(parameters('config').roleOverrideValues1)]",
163+
"roleOverrideValues2": "[string(parameters('config').roleOverrideValues2)]"
164+
},
165+
"resources": [
166+
{
167+
<snip>
168+
"roleOverrideValues": [
169+
"[variables('roleOverrideValues0')]",
170+
"[variables('roleOverrideValues1')]",
171+
"[variables('roleOverrideValues2')]"
172+
]
173+
}
131174
```
132175

133-
### Operator changes
134-
Operators inherit default `applicationEnablement` values as defined by the NFDV. If `applicationEnablement` is parameterized, then it can be passed through the `deploymentValues` property at runtime using the CGV. `roleOverrideValues` specifies a nondefault setting for `applicationEnablement`.
176+
#### CGV Template
177+
The CGV template can now be updated to include the content for each variable to be substituted into `roleOverrideValues` property at run-time. The below example sets `rollbackEnabled` to true, followed by override sets for `hellotest` and `hellotest1` nfApplications.
135178

136179
```json
137180
{
138-
"location": "<location>",
139-
"nfviType": "AzureArcKubernetes",
140-
"nfdvId": "<nfdv_id>",
141-
"helloworld-cnf-config": {
142-
"roleOverrideValues1": "{\"name\":\"hellotest\",\"deployParametersMappingRuleProfile\":{\"applicationEnablement\":\"Disable\"}}",
143-
}
181+
"roleOverrideValues0": "{\"nfConfiguration\":{\"rollbackEnabled\":true}}",
182+
"roleOverrideValues1": "{\"name\":\"hellotest\",\"deployParametersMappingRuleProfile\":{\"applicationEnablement\":\"Enabled\",\"helmMappingRuleProfile\":{\"releaseName\":\"override-release\",\"releaseNamespace\":\"override-namespace\",\"helmPackageVersion\":\"1.0.0\",\"values\":\"\",\"options\":{\"installOptions\":{\"atomic\":\"true\",\"wait\":\"true\",\"timeout\":\"30\",\"injectArtifactStoreDetails\":\"true\"},\"upgradeOptions\":{\"atomic\":\"true\",\"wait\":\"true\",\"timeout\":\"30\",\"injectArtifactStoreDetails\":\"true\"}}}}}",
183+
"roleOverrideValues2": "{\"name\":\"hellotest1\",\"deployParametersMappingRuleProfile\":{\"applicationEnablement\" : \"Enabled\"}}"
144184
}
145185
```
186+
With this framework in place, the Operator can manage any of the `roleOverrideValues` via simple updates to the CGV, followed by attaching that CGV to the desired SNS operation.
146187

147188
## Skip nfApps which have no change
148189
The `skipUpgrade` feature is designed to optimize the time taken for CNF upgrades. When the publisher enables this flag in the `roleOverrideValues` under `upgradeOptions`, the AOSM service layer performs certain prechecks, to determine whether an upgrade for a specific `nfApplication` can be skipped. If all precheck criteria are met, the upgrade is skipped for that application. Otherwise, an upgrade is executed at the cluster level.

0 commit comments

Comments
 (0)