Schedule a recurring backup
Task Information : Create a daily backup schedule for namespace orders at 01:00.
Explanation:
* Create the schedule
* velero schedule create orders-daily \
* --schedule "0 1 * * *" \
* --include-namespaces orders \
* --snapshot-volumes
* Cron format: minute hour day month weekday.
* Verify schedule exists
* velero schedule get
* Confirm backups are created by the schedule
* velero backup get | grep orders-daily
* Scheduled backups usually have names derived from the schedule.
Configure BackupStorageLocation and VolumeSnapshotLocation
Task Information : Configure OADP/Velero storage locations and confirm they show as Available.
Explanation:
* Create a secret for cloud credentials (S3-compatible example)
* oc -n openshift-adp create secret generic cloud-credentials \
* --from-file=cloud=/path/to/credentials
* Velero uses this secret to authenticate to object storage.
* Create/Update the DataProtectionApplication (DPA)
* Apply a DPA CR that defines:
* backupLocations (bucket, endpoint URL, region, etc.)
* snapshotLocations (if using snapshots)
* Verify BackupStorageLocation and SnapshotLocation
* velero backup-location get
* velero snapshot-location get
* Status should be Available, meaning storage config is valid.
==========
Configure RBAC roles with users and groups
Task Information : Grant edit to group dev-team in namespace payments, and grant view to user auditor1.
Explanation:
* Create (or switch to) the project
* oc new-project payments
* Namespace must exist before applying rolebindings.
* Grant edit to the group
* oc -n payments policy add-role-to-group edit dev-team
* Members of dev-team can modify most resources in payments.
* Grant view to a user
* oc -n payments policy add-role-to-user view auditor1
* auditor1 can read resources but not change them.
* Verify rolebindings
* oc -n payments get rolebinding
Dedicate nodes to a workload using labels and nodeSelector
Task Information : Label two nodes with workload=payments and schedule a deployment only onto those nodes.
Explanation:
* Label the chosen worker nodes
* oc label node worker-1 workload=payments
* oc label node worker-2 workload=payments
* Node labels are key/value metadata used by the scheduler.
* Add a nodeSelector to the deployment
* oc -n payments patch deploy api --type=merge -p '{
* "spec":{"template":{"spec":{"nodeSelector":{"workload":"payments"}}}}
* }'
* Forces pods to schedule only to nodes that match the label.
* Verify placement
* oc -n payments get pods -o wide
* Confirms pods are running on the intended nodes.
GitOps and MachineConfig - Trigger Argo CD Synchronization by Repository Update
Explanation:
Step 1: Confirm that the repository being pushed to is the same repository watched by the GitOps/Argo CD application.
This linkage is essential because GitOps acts only on configured source repositories and paths.
Step 2: Commit the MachineConfig changes.
The lab uses:
git commit -am "Add MachineConfig for motd"
Step 3: Push the changes to the tracked branch.
The lab uses:
git push origin main
Step 4: Allow Argo CD to detect the repository change and begin synchronization.
In a standard GitOps model, the controller compares the Git repository to the cluster state and applies drift correction or new desired resources.
Detailed explanation:
This sub Task SIMULATION is the operational purpose behind the previous Git command Task SIMULATION . The point is not merely to store a file in Git; it is to update the declarative source that Argo CD uses to reconcile the cluster. Once the repository is updated, Argo CD detects the new commit and syncs the MachineConfig into the cluster according to its application definition. This demonstrates a core automation principle in OpenShift GitOps: administrators do not treat the cluster as the primary editable surface. Instead, they modify Git and let the automation layer enforce state. That provides traceability, peer review potential, rollback capability, and consistency across environments.