Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Podman Compatibility and Enhance Kind cluster setup #11086

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

see-quick
Copy link
Member

@see-quick see-quick commented Jan 28, 2025

Type of change

  • Enhancement / new feature
  • Refactoring

Description

This PR introduces Podman compatibility to the KIND cluster setup script. It seamlessly allows users to use Docker or Podman as their container runtime. The changes ensure proper configuration and support for Kubernetes cluster provisioning.

Checklist

  • Write tests
  • Make sure all tests pass

Signed-off-by: see-quick <maros.orsak159@gmail.com>
@see-quick see-quick added this to the 0.46.0 milestone Jan 28, 2025
@see-quick see-quick requested a review from a team January 28, 2025 09:54
@see-quick see-quick self-assigned this Jan 28, 2025
@ppatierno
Copy link
Member

Why most of the already existing commands are now started via sudo?

.azure/scripts/setup-kind.sh Show resolved Hide resolved
.azure/scripts/setup-kind.sh Outdated Show resolved Hide resolved
.azure/scripts/setup-kind.sh Outdated Show resolved Hide resolved
@see-quick
Copy link
Member Author

Why most of the already existing commands are now started via sudo?

Mainly because we have to run kind of as rootfull (with podman).

Signed-off-by: see-quick <maros.orsak159@gmail.com>
Signed-off-by: see-quick <maros.orsak159@gmail.com>
Signed-off-by: see-quick <maros.orsak159@gmail.com>
…on required.

Signed-off-by: see-quick <maros.orsak159@gmail.com>
Signed-off-by: see-quick <maros.orsak159@gmail.com>
Signed-off-by: see-quick <maros.orsak159@gmail.com>
@see-quick see-quick requested review from Frawless and a team January 31, 2025 10:44
@see-quick
Copy link
Member Author

/azp run acceptance

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: see-quick <maros.orsak159@gmail.com>
Signed-off-by: see-quick <maros.orsak159@gmail.com>
Signed-off-by: see-quick <maros.orsak159@gmail.com>
Signed-off-by: see-quick <maros.orsak159@gmail.com>
Signed-off-by: see-quick <maros.orsak159@gmail.com>
}

function label_node {
# It should work for all clusters
for nodeName in $(kubectl get nodes -o custom-columns=:.metadata.name --no-headers);
for nodeName in $($SUDO kubectl get nodes -o custom-columns=:.metadata.name --no-headers);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should $SUDO be used everywhere?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, because if do not execute with sudo you will not see kind cluster as we previously started kind as sudo

@see-quick
Copy link
Member Author

/packit test --labels acceptance

// Kaniko pushes the image to the local registry, but Podman stores it in an internal storage
// that is not directly accessible to Kind. Podman must first pull the image from the registry
// so that it is available in the Podman daemon's local storage before "kind load" can work.
Exec.exec("sudo", "podman", "pull", image);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if I will use kind with docker?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I should add some wrapper to check your container runtime and base on that just use podman/docker.

@Frawless Frawless self-requested a review February 6, 2025 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants