Creating an Upgrade Group
The Upgrade Group is the entity that represents the upgrade configuration for a group of System Inventories.
The WRCP plugin and its blueprint named “wrcp-blueprint” must be uploaded prior to the creation of any System Inventory.
The Upgrade Policy that defines the behavior of the upgrade tasks also must be created prior to the Upgrade Group.
Upgrade Policies and Upgrade Groups are Kubernetes resources which means they can be created by using any supported procedure to create Kubernetes resources. This guide describes how to create them using the kubectl create CLI.
Creating an Upgrade Policy
- Prepare the YAML file containing the description of a valid Upgrade Policy (see Upgrade Policy in Upgrade Operator and Entity Model.
Example:
apiVersion: wrcp.windriver.com/v1
kind: UpgradePolicy
metadata:
name: my-upgrade-policy
namespace: wrcp
spec:
batch-size:
upgrade: 100
prestage: 100
execution-limit:
upgrade: 360
prestage: 360
max-retry:
upgrade: 60
prestage: 60
rollback-scope: system
rollback-threshold :
retry: 3
abort: 1
- Create the resource from the YAML file:
kubectl create -f <upgrade-policy>.yaml
After completing these steps, the new upgrade policy can be inspected with:
$ kubectl describe upgradepolicy my-upgrade-policy -n wrcp
Name: my-upgrade-policy
Namespace: wrcp
Labels: <none>
Annotations: kopf.zalando.org/last-handled-configuration:
{"spec":{"batch-size":{"prestage":100,"upgrade":100},"execution-limit":{"prestage":3600,"upgrade":3600}...
API Version: wrcp.windriver.com/v1
Kind: UpgradePolicy
Metadata:
Creation Timestamp: 2024-12-10T14:39:37Z
Finalizers:
kopf.zalando.org/KopfFinalizerMarker
wrcp.windriver.com/policy-deletion-prevention-block
Generation: 1
Resource Version: 412714
UID: 026ba5a4-9937-47a5-951c-f867d6832e6e
Spec:
Batch - Size:
Prestage: 100
Upgrade: 100
Execution - Limit:
Prestage: 3600
Upgrade: 3600
Max - Retry:
Prestage: 60
Upgrade: 60
Rollback - Scope: system
Rollback - Threshold:
Abort: 1
Retry: 3
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Logging 19s kopf Creation is processed: 1 succeeded; 0 failed.
Normal Logging 19s kopf Setting a finalizer to policy my-upgrade-policy.
Normal Logging 19s kopf Handler 'create_policy' succeeded.
An upgrade policy can be used by one or more Upgrade Groups.
Creating an Upgrade Group
Note: It is not mandatory but it is desired that one or more System Inventories eligible to be selected by the Upgrade Group are created before creating it. Refer to Creating a System Inventory.
- Prepare the YAML file pointing to the Upgrade Policy created in the step above. Refer to (Upgrade Group in Upgrade Operator and Entity Model for guideance on upgrade group specification and Upgrade and Prestage subclouds for information regarding scheduling.
Example:
apiVersion: wrcp.windriver.com/v1
kind: UpgradeGroup
metadata:
name: my-upgrade-group
namespace: wrcp
spec:
state: enabled
policy: my-upgrade-policy
selector:
testing-label: testing-value
release-version: "21.12"
components:
release-version: "22.12"
schedule:
upgrade:
execution-date:
start: "2100-07-30"
end: "2100-08-30"
execution-time:
start: "10:30"
end: "11:30"
recurrence: "1d"
count: 5
- Create the resource from the YAML file:
kubectl create -f <upgrade-group>.yaml
After these steps, the created upgrade group can be inspected with:
$ kubectl describe upgradegroup my-upgrade-group -n wrcp
Name: my-upgrade-group
Namespace: wrcp
Labels: <none>
Annotations: kopf.zalando.org/last-handled-configuration:
{"spec":{"components":{"release-version":"22.12"},"policy":"my-upgrade-policy","schedule":{"upgrade":{"count":5,"execution-date":{"end":"2...
API Version: wrcp.windriver.com/v2
Kind: UpgradeGroup
Metadata:
Creation Timestamp: 2024-12-10T14:41:38Z
Finalizers:
kopf.zalando.org/KopfFinalizerMarker
Generation: 1
Resource Version: 412996
UID: 8ee78471-92b7-46e5-ba87-d360cc2e50ea
Spec:
Components:
Release - Version: 22.12
Policy: my-upgrade-policy
Schedule:
Upgrade:
Execution - Date:
End: 2100-08-30
Start: 2100-07-30
Execution - Time:
End: 11:30
Start: 10:30
Selector:
Release - Version: 21.12
Testing - Label: testing-value
State: enabled
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Logging 12s kopf Handler 'verify_change_policy/spec.policy' succeeded.
Normal Logging 12s kopf Creation is processed: 3 succeeded; 0 failed.
Normal Logging 12s kopf Handler 'on_change_upgrp_state/spec.state' succeeded.
Normal Logging 12s kopf Handler 'handle_upgrade_group_spec_changes/spec' succeeded.
The successful creation of an upgrade group will trigger the schedule in Conductor of execution of the workflows specified in “schedule” for the System Inventories that match the Upgrade Group selector. Scheduled executions can be listed using the cfy
command:
$ cfy deployments schedule list
Debugging
Errors are shown in the Events section of describe’s output. Example:
$ kubectl describe upgradegroup upgrp-error -n wrcp
Name: upgrp-error
Namespace: wrcp
Labels: <none>
Annotations: kopf.zalando.org/handle_overall_status_changes.spec.status:
{"started":"2024-12-05T12:51:37.018947","delayed":"2024-12-10T16:10:51.710771","purpose":"delete","retries":1021,"success":false,"failure"...
kopf.zalando.org/handle_upgrade_group_delete:
{"started":"2024-12-05T12:51:44.317719","stopped":"2024-12-05T12:54:44.707760","purpose":"delete","retries":4,"success":false,"failure":tr...
kopf.zalando.org/handle_upgrade_group_spec_changes.spec:
{"started":"2024-12-05T12:51:36.771730","stopped":"2024-12-05T12:51:37.020683","purpose":"delete","retries":1,"success":true,"failure":fal...
kopf.zalando.org/on_change_upgrp_state.spec.state:
{"started":"2024-12-05T12:51:36.771726","stopped":"2024-12-05T12:51:36.911935","purpose":"delete","retries":1,"success":true,"failure":fal...
kopf.zalando.org/verify_change_policy.spec.policy:
{"started":"2024-12-05T12:51:36.771716","stopped":"2024-12-05T12:51:36.791637","purpose":"delete","retries":1,"success":true,"failure":fal...
scheduled-executions: {}
API Version: wrcp.windriver.com/v2
Kind: UpgradeGroup
Metadata:
Creation Timestamp: 2024-12-05T12:51:36Z
Deletion Grace Period Seconds: 0
Deletion Timestamp: 2024-12-05T12:51:44Z
Finalizers:
kopf.zalando.org/KopfFinalizerMarker
Generation: 4
Resource Version: 424622
UID: d5f65768-b1d0-400c-b52c-d2d492910fc0
Spec:
Components:
Release - Version: 12.34
Overall - Status: completed
Policy: upgrp-error
Schedule:
Prestage:
Count: 1
Execution - Date:
End: 1970-01-01
Start: 1970-01-01
Execution - Time:
End: 00:01
Start: 00:00
Selector:
Release - Version: 99.99
State: disabled
Status:
Completed: 0
In - Progress: 0
Reconciled: 0
Scheduled: 0
Total: 0
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Error Logging 60m kopf Handler 'handle_overall_status_changes/spec.status' failed with an exception. Will retry.
Logs can also be inspected in the operator pod’s logs with:
$ kubectl logs <podname> -n <namespace>