Skip to content

Update k8s_exec and k8s_cp to include container name#1858

Merged
rooftopcellist merged 1 commit intoansible:develfrom
fluzzykitten:patch-1
May 16, 2024
Merged

Update k8s_exec and k8s_cp to include container name#1858
rooftopcellist merged 1 commit intoansible:develfrom
fluzzykitten:patch-1

Conversation

@fluzzykitten
Copy link
Copy Markdown
Contributor

SUMMARY

We need to specify a container in environments that use sidecar injection, like in the case of istio service mesh. If the container is not specified, and a side car is injected so there are multiple containers running in the pod, this task will fail because a container was not specified in a pod with multiple containers.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
    Bug preventing backups in environments that use Istio service mesh or other automatic side-car injection
ADDITIONAL INFORMATION

Container that we create is the same name as the pod, so we just need to tell the backup to use the container we created, to differentiate it from any sidecars containers that might've been injected

@rooftopcellist
Copy link
Copy Markdown
Member

Good point, thanks for the PR @fluzzykitten !

I checked that the container name is indeed correct:

However, I expect you will also need to specify the container here as well right @fluzzykitten ?

Actually, pretty much all of these places:

@rooftopcellist
Copy link
Copy Markdown
Member

While looking at this PR, I noticed this typo:

We need to specify a container in environments that use sidecar injection, like in the case of istio service mesh. If the container is not specified, and a side car is injected so there are multiple containers running in the pod, this task will fail because a container was not specified in a pod with multiple containers.
@fluzzykitten
Copy link
Copy Markdown
Contributor Author

@rooftopcellist Shoot! You're right, I only pushed one of the files. My bad. MR updated with the other instances of the k8s_exec and k8s_cp modules that didn't set a container, and would be affected by sidecar container injection.

@fluzzykitten fluzzykitten changed the title Update secrets.yml Update k8s_exec and k8s_cp to include container name May 16, 2024
@rooftopcellist
Copy link
Copy Markdown
Member

@fluzzykitten thanks for the quick update! I just tested out a backup and restore and didn't run into any issues. Thanks for the contribution!

@rooftopcellist rooftopcellist enabled auto-merge (squash) May 16, 2024 20:32
@rooftopcellist rooftopcellist merged commit 4720d29 into ansible:devel May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants