You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Troubleshooting](#troubleshooting) - Fix common issues
@@ -43,12 +46,14 @@ This section defines core concepts referenced throughout the document.
43
46
This CA certificate mounting feature is **exclusively for OpenShift ImageStream backups**.
44
47
45
48
**ImageStream backups require special handling** because:
49
+
46
50
- They delegate to openshift-velero-plugin
47
51
- The plugin uses docker-distribution S3 driver for image layer copying
48
52
- The S3 driver can only read CA certificates from the `AWS_CA_BUNDLE` environment variable
49
53
- It cannot access Velero's BSL `caCert` configuration directly
50
54
51
55
**Regular Velero backups (pods, PVCs, namespaces, etc.)** do NOT need this feature:
56
+
52
57
- Velero directly uses the `caCert` field from BackupStorageLocation spec
53
58
- CA certificate validation happens within Velero's own code
54
59
- No environment variable-based CA handling needed
@@ -90,13 +95,15 @@ OADP/Velero supports CA certificates through **two independent mechanisms**:
90
95
The `spec.backupImages` field in DataProtectionApplication CR controls CA certificate mounting:
91
96
92
97
**When `true` (default)**:
98
+
93
99
- CA certificates collected from AWS BSLs
94
100
- ConfigMap `velero-ca-bundle` created
95
101
- Volume mounted at `/etc/velero/ca-certs`
96
102
-`AWS_CA_BUNDLE` environment variable set
97
103
- ImageStream backups work with custom CAs
98
104
99
105
**When `false`**:
106
+
100
107
- No CA certificate processing
101
108
- No ConfigMap created
102
109
- No volume mount added
@@ -112,6 +119,7 @@ See [Disabling ImageStream Backup CA Handling](#disabling-imagestream-backup-ca-
112
119
Based on [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/configmap/) and [issue #20200](https://github.com/kubernetes/kubernetes/issues/20200):
-**File sync to pod**: 1-2 minutes (kubelet sync period + cache TTL)
117
125
- Kubelet sync period: 1 minute (default)
@@ -120,31 +128,36 @@ Based on [Kubernetes documentation](https://kubernetes.io/docs/concepts/configur
120
128
-**Typical delay**: 60-90 seconds
121
129
122
130
**Important behavior**:
131
+
123
132
- ConfigMap updates do NOT restart pods automatically
124
133
- Environment variables (like `AWS_CA_BUNDLE`) are NOT updated automatically
125
134
- The `AWS_CA_BUNDLE` points to a file path - the file content is updated by kubelet
126
135
- Applications must detect and reload configuration changes
127
136
128
137
**Implications for certificate updates**:
138
+
129
139
- New AWS SDK sessions (for new backup operations) use the updated certificate file
130
140
- Existing AWS SDK sessions continue using old certificates until session recreated
131
141
-**Practical effect**: Certificate updates available for new backups after kubelet sync period
132
142
133
143
### Pod Restart Triggers
134
144
135
145
**Velero pod WILL restart when**:
146
+
136
147
-`backupImages` changed from `false` to `true` (volume mount added)
137
148
-`backupImages` changed from `true` to `false` (volume mount removed)
138
149
- First CA certificate is added (volume mount added to deployment)
139
150
- Last CA certificate is removed (volume mount removed from deployment)
140
151
-`AWS_CA_BUNDLE` environment variable is added/removed
141
152
142
153
**Velero pod will NOT restart when**:
154
+
143
155
- CA certificate content is updated in existing BSL
144
156
- ConfigMap data is modified (only file content changes)
145
157
-`backupImages` remains unchanged
146
158
147
159
**Impact on running backups**:
160
+
148
161
- During ConfigMap update (no restart): Running backups may complete, new backups use updated certs
149
162
- During pod restart: Running backups **will fail**, Velero marks as `PartiallyFailed`
150
163
-**Recommendation**: Avoid changing `backupImages` or adding/removing CA certificates during active backups. For Non-DPA BSL discovery, use safe trigger mechanisms instead - see [Triggering Discovery of Non-DPA BSL Changes](#triggering-discovery-of-non-dpa-bsl-changes)
@@ -161,12 +174,14 @@ The AWS SDK and Docker Distribution S3 driver read CA certificates at **session
161
174
### Certificate Collection Scope
162
175
163
176
**Currently collected from**:
177
+
164
178
- Only AWS provider BackupStorageLocations
165
179
- BSLs defined in DPA `spec.backupLocations`
166
180
- Additional BSLs in the same namespace (not in DPA spec)
167
181
- System default CA certificates (appended for fallback)
168
182
169
183
**Not collected from**:
184
+
170
185
- Non-AWS provider BSLs (Azure, GCP, etc.)
171
186
- BSLs in different namespaces
172
187
- Manually created certificate files
@@ -177,7 +192,7 @@ The AWS SDK and Docker Distribution S3 driver read CA certificates at **session
description: backupImages is used to specify whether you want to deploy a registry for enabling backup and restore of images
@@ -425,6 +448,7 @@ With `backupImages: false`:
425
448
### Default Behavior
426
449
427
450
**When `backupImages` is not specified** (nil):
451
+
428
452
- Defaults to `true` via the `BackupImages()` method
429
453
- CA certificate processing is enabled
430
454
- ConfigMap and volume mount are created if CA certificates exist in BSLs
@@ -436,6 +460,7 @@ With `backupImages: false`:
436
460
See [ConfigMap Sync Timing](#configmap-sync-timing) and [AWS SDK Session Behavior](#aws-sdk-session-behavior) in Key Concepts for how certificate updates propagate.
437
461
438
462
**Quick summary**:
463
+
439
464
- ConfigMap updates don't restart pods
440
465
- Files sync to pods within 1-2 minutes (kubelet sync period)
441
466
- New backup operations pick up updated certificates after sync completes
@@ -448,12 +473,14 @@ See [ConfigMap Sync Timing](#configmap-sync-timing) and [AWS SDK Session Behavio
448
473
The OADP controller updates the `velero-ca-bundle` ConfigMap in response to several triggers:
449
474
450
475
**1. DPA Spec Changes**:
476
+
451
477
- User modifies `spec.backupLocations[*].velero.objectStorage.caCert`
452
478
- User modifies `spec.backupLocations[*].cloudStorage.caCert`
453
479
- User adds/removes backup locations with CA certificates
454
480
- Controller watches DPA resource via `For(&oadpv1alpha1.DataProtectionApplication{})`
455
481
456
482
**2. BSL Resource Changes**:
483
+
457
484
- OADP-managed BSLs are created/updated via `controllerutil.CreateOrPatch`
458
485
- Controller owns BSL resources via `Owns(&velerov1.BackupStorageLocation{})`
459
486
- Any changes to owned BSLs trigger DPA reconciliation (via controller ownership)
@@ -462,20 +489,22 @@ The OADP controller updates the `velero-ca-bundle` ConfigMap in response to seve
462
489
- Non-OADP BSLs are discovered via `r.List()` call in `processCACertForBSLs()` during each reconciliation
463
490
464
491
**3. Secret Label Changes**:
492
+
465
493
- Controller watches Secrets via `Watches(&corev1.Secret{}, &labelHandler{})`
466
494
- Secrets with labels `openshift.io/oadp: "True"` and `dataprotectionapplication.name: <dpa-name>` trigger reconciliation
467
495
- BSL credential secrets are automatically labeled by `UpdateCredentialsSecretLabels()` (bsl.go:371-407)
468
496
- This enables detection of credential updates that might affect BSL configuration
469
497
470
498
**4. ConfigMap Lifecycle**:
499
+
471
500
- ConfigMap has controller reference to DPA: `controllerutil.SetControllerReference(dpa, configMap, r.Scheme)`
472
501
- Controller owns ConfigMaps via `Owns(&corev1.ConfigMap{})`
473
502
- ConfigMap updates use `controllerutil.CreateOrPatch` for idempotent updates
474
503
- Only updates when certificate content actually changes (prevents unnecessary pod disruptions)
475
504
476
505
#### Complete Update Flow
477
506
478
-
```
507
+
```doc
479
508
Trigger Event (DPA change, BSL update, or Secret label change)
480
509
│
481
510
↓
@@ -596,6 +625,7 @@ New Session Reads Updated Certificate File
596
625
**Predicate Filtering** (from `predicate.go`):
597
626
598
627
The controller uses `veleroPredicate()` to filter events:
628
+
599
629
- **Update events**: Only trigger if `generation` changed (spec modification)
600
630
- **Create events**: Trigger if resource has `openshift.io/oadp` label or is DPA
601
631
- **Delete events**: Trigger if resource has `openshift.io/oadp` label or is DPA
@@ -622,22 +652,27 @@ Non-OADP BSLs (BackupStorageLocations created outside of DPA spec) are discovere
622
652
**Safe trigger mechanisms** (ConfigMap-only update, no pod restart):
- Velero pod **NO** volume mount at `/etc/velero/ca-certs`
721
758
- `AWS_CA_BUNDLE`environment variable **NOT** set
@@ -760,6 +797,7 @@ spec:
760
797
```
761
798
762
799
**Result**:
800
+
763
801
- ConfigMap contains: Production CA + DR CA + System CAs
764
802
- All certificates concatenated and deduplicated
765
803
- ImageStream backups to both locations work with their respective custom CAs
@@ -769,18 +807,21 @@ spec:
769
807
### What This Feature Enables
770
808
771
809
✅ **ImageStream backups** in environments with:
810
+
772
811
- Custom Certificate Authorities (internal CAs)
773
812
- Self-signed certificates on S3 endpoints
774
813
- MITM proxy infrastructure
775
814
- Air-gapped environments with internal CAs
776
815
777
816
✅ **Automatic certificate management**:
817
+
778
818
- Collection from all AWS BSLs
779
819
- Deduplication of certificates
780
820
- System CA fallback
781
821
- ConfigMap lifecycle management
782
822
783
823
✅ **Opt-out capability**:
824
+
784
825
- Disable via `spec.backupImages: false`
785
826
- Reduce overhead when imagestream backups not needed
786
827
@@ -795,16 +836,19 @@ spec:
795
836
See [Two CA Certificate Mechanisms](#two-ca-certificate-mechanisms) in Key Concepts for a complete explanation of how different components (velero-plugin-for-aws, imagestream backups, BSL validation) use CA certificates differently with `backupImages: true` vs `false`.
796
837
797
838
**Key points**:
839
+
798
840
- velero-plugin-for-aws: `AWS_CA_BUNDLE`overrides BSL `caCert` when both present (affects all AWS SDK operations)
0 commit comments