-
Notifications
You must be signed in to change notification settings - Fork 32
ibm power fixes - add more static cluster minikube fixes #663
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,7 +62,7 @@ setup_local_registry_and_custom_image() { | |
| # Clean up any existing registry first | ||
| sudo podman rm -f registry 2>/dev/null || true | ||
|
|
||
| if ! sudo podman run -d -p 127.0.0.1:5000:5000 --name registry --restart=always docker.io/library/registry:2; then | ||
| if ! sudo podman run -d -p 127.0.0.1:5000:5000 --replace --name registry --restart=always docker.io/library/registry:2; then | ||
| echo "❌ Failed to start local registry - trying alternative approach" | ||
| exit 1 | ||
| fi | ||
|
|
@@ -79,26 +79,23 @@ setup_local_registry_and_custom_image() { | |
| echo "✅ Local registry already running" | ||
| fi | ||
|
|
||
| # Configure podman to trust local registry (rootful only since minikube uses sudo podman) | ||
| # Configure podman to trust local registry (use 127.0.0.1 to avoid IPv6 issues) | ||
| echo "Configuring registries.conf to trust local registry..." | ||
| sudo mkdir -p /root/.config/containers | ||
| sudo tee /root/.config/containers/registries.conf << 'EOF' >/dev/null | ||
| [[registry]] | ||
| location = "localhost:5000" | ||
| location = "127.0.0.1:5000" | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. some loopback misses from prior pr |
||
| insecure = true | ||
| EOF | ||
| echo "✅ Registry configuration created" | ||
|
|
||
| custom_image_tag="localhost:5000/kicbase:v0.0.48" | ||
| custom_image_tag="127.0.0.1:5000/kicbase:v0.0.48" | ||
| if curl -s --max-time 5 http://127.0.0.1:5000/v2/kicbase/tags/list | grep -q "v0.0.48"; then | ||
| echo "Custom kicbase image already exists in local registry" | ||
| return 0 | ||
| fi | ||
|
|
||
| # Build custom kicbase image with crictl | ||
| echo "Building custom kicbase image with crictl for ppc64le..." | ||
|
|
||
| # Build custom kicbase image | ||
| mkdir -p "${PROJECT_DIR:-.}/scripts/minikube/kicbase" | ||
| cat > "${PROJECT_DIR:-.}/scripts/minikube/kicbase/Dockerfile" << 'EOF' | ||
| FROM gcr.io/k8s-minikube/kicbase:v0.0.48 | ||
|
|
@@ -122,7 +119,7 @@ EOF | |
| if ! curl -s --max-time 5 http://127.0.0.1:5000/v2/_catalog >/dev/null 2>&1; then | ||
| echo "Registry not responding, restarting..." | ||
| sudo podman rm -f registry 2>/dev/null || true | ||
| sudo podman run -d -p 127.0.0.1:5000:5000 --name registry --restart=always docker.io/library/registry:2 | ||
| sudo podman run -d -p 127.0.0.1:5000:5000 --replace --name registry --restart=always docker.io/library/registry:2 | ||
| for _ in {1..15}; do | ||
| if curl -s --max-time 5 http://127.0.0.1:5000/v2/_catalog >/dev/null 2>&1; then | ||
| echo "Registry restarted successfully" | ||
|
|
@@ -146,27 +143,25 @@ EOF | |
| start_minikube_cluster() { | ||
| echo ">>> Starting minikube cluster with podman driver (rootful mode)..." | ||
|
|
||
| if "${PROJECT_DIR:-.}/bin/minikube" status &>/dev/null; then | ||
| echo "✅ Minikube is already running - verifying health..." | ||
| if "${PROJECT_DIR:-.}/bin/minikube" kubectl -- get nodes &>/dev/null; then | ||
| # Check rootful podman directly (minikube status checks wrong namespace) | ||
| if sudo podman ps --filter name=minikube --format '{{.Names}}' 2>/dev/null | grep -q '^minikube$'; then | ||
| echo "✅ Minikube container exists - verifying kubectl connectivity..." | ||
| if "${PROJECT_DIR:-.}/bin/minikube" kubectl -- get nodes &>/dev/null 2>&1; then | ||
| echo "✅ Minikube cluster is healthy - skipping setup" | ||
| return 0 | ||
| else | ||
| echo "⚠️ Minikube running but unhealthy - will recreate" | ||
| echo "⚠️ Minikube container exists but kubectl not working - will recreate" | ||
| fi | ||
| fi | ||
|
|
||
| # Clean up any existing minikube state to avoid cached configuration issues | ||
| echo "Cleaning up any existing minikube state..." | ||
| if [[ -d ~/.minikube/machines/minikube ]]; then | ||
| echo "Removing ~/.minikube/machines/minikube directory..." | ||
| rm -rf ~/.minikube/machines/minikube | ||
| fi | ||
| sudo rm -rf ~/.minikube/machines/minikube 2>/dev/null || true | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since we use sudo podman (rootful) we also need to ensure minikube gets cleaned up in root space |
||
| rm -rf ~/.minikube/machines/minikube 2>/dev/null || true | ||
|
|
||
| echo "Ensuring clean minikube state..." | ||
| sudo "${PROJECT_DIR:-.}/bin/minikube" delete 2>/dev/null || true | ||
| "${PROJECT_DIR:-.}/bin/minikube" delete 2>/dev/null || true | ||
|
|
||
| # Clean up stale podman volumes | ||
| echo "Cleaning up stale podman volumes..." | ||
| sudo podman volume rm -f minikube 2>/dev/null || true | ||
| sudo podman network rm -f minikube 2>/dev/null || true | ||
|
|
@@ -179,8 +174,8 @@ start_minikube_cluster() { | |
| if [[ "${ARCH}" == "ppc64le" ]]; then | ||
| echo "Using custom kicbase image for ppc64le with crictl..." | ||
|
|
||
| start_args+=("--base-image=localhost:5000/kicbase:v0.0.48") | ||
| start_args+=("--insecure-registry=localhost:5000") | ||
| start_args+=("--base-image=127.0.0.1:5000/kicbase:v0.0.48") | ||
| start_args+=("--insecure-registry=127.0.0.1:5000") | ||
| fi | ||
|
|
||
| echo "Starting minikube with args: ${start_args[*]}" | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sometimes cleanup didn't work, so we should just replace the existing/running one