Propagate dns settings to backup pods (#8845)
Run the E2E test on kind / build (push) Failing after 6m28s
Run the E2E test on kind / setup-test-matrix (push) Successful in 2s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / Build (push) Failing after 37s
Close stale issues and PRs / stale (push) Successful in 9s
Trivy Nightly Scan / Trivy nightly scan (velero, main) (push) Failing after 59s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-aws, main) (push) Failing after 50s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-gcp, main) (push) Failing after 53s
Trivy Nightly Scan / Trivy nightly scan (velero-plugin-for-microsoft-azure, main) (push) Failing after 1m2s

* Propagate dns settings to backup pods

Signed-off-by: Felix Prasse <1330854+flx5@users.noreply.github.com>

* Add changelog for PR 8845

Signed-off-by: Felix Prasse <1330854+flx5@users.noreply.github.com>

---------

Signed-off-by: Felix Prasse <1330854+flx5@users.noreply.github.com>
This commit is contained in:
Felix Prasse
2025-04-25 02:49:53 +00:00
committed by GitHub
parent e06b62e3a8
commit 1589439441
4 changed files with 11 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
Inherit the dnsPolicy and dnsConfig from the node agent pod.
This is done so that the kopia task uses the same configuration.
+2
View File
@@ -681,6 +681,8 @@ func (e *csiSnapshotExposer) createBackupPod(
RestartPolicy: corev1api.RestartPolicyNever,
SecurityContext: securityCtx,
Tolerations: toleration,
DNSPolicy: podInfo.dnsPolicy,
DNSConfig: podInfo.dnsConfig,
},
}
+2
View File
@@ -510,6 +510,8 @@ func (e *genericRestoreExposer) createRestorePod(ctx context.Context, ownerObjec
RestartPolicy: corev1api.RestartPolicyNever,
SecurityContext: securityCtx,
Tolerations: toleration,
DNSPolicy: podInfo.dnsPolicy,
DNSConfig: podInfo.dnsConfig,
},
}
+5
View File
@@ -36,6 +36,8 @@ type inheritedPodInfo struct {
volumes []corev1api.Volume
logLevelArgs []string
logFormatArgs []string
dnsPolicy v1.DNSPolicy
dnsConfig *v1.PodDNSConfig
}
func getInheritedPodInfo(ctx context.Context, client kubernetes.Interface, veleroNamespace string, osType string) (inheritedPodInfo, error) {
@@ -58,6 +60,9 @@ func getInheritedPodInfo(ctx context.Context, client kubernetes.Interface, veler
podInfo.volumeMounts = podSpec.Containers[0].VolumeMounts
podInfo.volumes = podSpec.Volumes
podInfo.dnsPolicy = podSpec.DNSPolicy
podInfo.dnsConfig = podSpec.DNSConfig
args := podSpec.Containers[0].Args
for i, arg := range args {
if arg == "--log-format" {