Skip to content

Conversation

yashpal2104
Copy link

@yashpal2104 yashpal2104 commented Sep 5, 2025

Key Changes

  • Adds a comprehensive e2e test suite targeting Istio-enabled scenarios.
  • Tests common installation/uninstallation/wait and verifies istio resources and we will also need "isInstalled" + "install" + "wait" style checks to handle this istio-ingressgateway resource.
  • Adds Cross-platform istioctl installation for testing locally
  • Provides a foundation for future Istio-related test expansion and more robust CI coverage.

@github-project-automation github-project-automation bot moved this to Needs Triage in Kubeflow Notebooks Sep 5, 2025
@google-oss-prow google-oss-prow bot added the area/ci area - related to ci label Sep 5, 2025
@yashpal2104 yashpal2104 marked this pull request as draft September 5, 2025 17:11
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kimwnasptd for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot added the area/controller area - related to controller components label Sep 5, 2025
@google-oss-prow google-oss-prow bot added area/v2 area - version - kubeflow notebooks v2 do-not-merge/work-in-progress size/XL labels Sep 5, 2025
@yashpal2104 yashpal2104 changed the title Istio e2e test suite test: Istio e2e test suite Sep 5, 2025
- Add InstallIstioctl() function to download and install istioctl binary
- Add InstallIstioMinimalWithIngress() to set up Istio with minimal profile
- Add IsIstioInstalled() and WaitIstioctlAvailable() helper functions
- Use positional formatting in URL template for istioctl downloads
- Support configurable Istio namespace for installation
- Add error handling and proper command output redirection

This enables e2e tests to automatically set up Istio service mesh
components required for workspace HTTP proxy functionality.

Signed-off-by: Yash Pal <[email protected]>
…gement

- Add InstallIstioctl() with OS/arch detection for Linux, macOS, Windows
- Add comprehensive Istio gateway functions (install, check, wait)
- Enhance WaitIstioAvailable() to verify all Istio components
- Add UninstallIstioctl() for complete cleanup
- Use platform-specific download methods with fallbacks

Signed-off-by: Yash Pal <[email protected]>
@google-oss-prow google-oss-prow bot added size/L and removed size/M labels Sep 7, 2025
…tests

- Add istioctl binary download and installation for multiple platforms
- Implement Istio minimal profile deployment with ingress gateway
- Add comprehensive Istio availability checks and wait functions
- Improve error handling and cleanup for test components
- Add platform-specific binary management for Windows/Linux/macOS

Signed-off-by: Yash Pal <[email protected]>
Copy link
Contributor

@andyatmiami andyatmiami left a comment

Choose a reason for hiding this comment

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

Great start - lets get these issues explained and/or resolved first and I'll continue with review afterwards.

Send me any error logs you may have w.r.t the problems you were having with CertManager (once you undo those changes in this PR) and I can help debug.


if !skipIstioctlInstall {
By("checking if istioctl is installed already")
isIstioctlAlreadyInstalled = utils.IsIstioInstalled()
Copy link
Contributor

Choose a reason for hiding this comment

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

We want to be really careful with naming here...

checking if istioctl is "installed" (i.e. binary available) is much different than checking if istio is installed (which presumably would be an istioctl --version check)

I could/would imagine each of those use cases requiring their own helper function...

osName := runtime.GOOS
var rmCmd *exec.Cmd

if osName == "windows" {
Copy link
Contributor

Choose a reason for hiding this comment

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

There are already numerous places in our Makefile where running on Windows would not work ...

As such - I see no need (for now) to add the complexity of supporting windows here.. since it would presumably fail before this code could/would ever get invoked. So we should simplify this function to remove all Windows support (and anywhere else outside this function for that matter 😎 )

"strings"

. "github.com/onsi/ginkgo/v2" //nolint:golint
)

const (

// use LTS version of istioctl
istioctlVersion = "1.27.0"
istioctlURL = ""
Copy link
Contributor

Choose a reason for hiding this comment

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

I would expect this variable to have an actual value?

Maybe call it istioctlURLTemplate and give it the template value defined here?

return cmd.Run()
}

// TODO:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this TODO: relevant/valid?

}

// InstallIstioMinimalWithIngress installs Istio with minimal profile and ingressgateway enabled.
func InstallIstioMinimalWithIngress(namespace string) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see anything calling this function.. which would explain the error I am getting trying to run the code:

  [FAILED] in [BeforeSuite] - /Users/astonebe/Development/Code/GitHub/kubeflow-notebooks/workspaces/controller/test/e2e/e2e_suite_test.go:106 @ 09/12/25 14:56:46.656
[BeforeSuite] [FAILED] [3.213 seconds]
[BeforeSuite] 
/Users/astonebe/Development/Code/GitHub/kubeflow-notebooks/workspaces/controller/test/e2e/e2e_suite_test.go:58

  [FAILED] istioctl is not available
  Expected success, but got an error:
      <*fmt.wrapError | 0x14000238c80>: 
      istio-system namespace not found: kubectl get namespace istio-system failed with error: (exit status 1) Error from server (NotFound): namespaces "istio-system" not found
      
      {

Comment on lines +585 to +627

// First check if cert-manager namespace exists, if not install cert-manager
// cmd := exec.Command("kubectl", "get", "namespace", "cert-manager")
// if _, err := Run(cmd); err != nil {
// // Namespace doesn't exist, install cert-manager
// fmt.Println("cert-manager namespace not found, installing cert-manager...")
// if err := InstallCertManager(); err != nil {
// return fmt.Errorf("failed to install cert-manager: %w", err)
// }
// }

// // Wait for the cert-manager namespace to be ready
// cmd = exec.Command("kubectl", "wait", "--for=condition=Ready", "namespace/cert-manager", "--timeout=300s")
// if _, err := Run(cmd); err != nil {
// return fmt.Errorf("cert-manager namespace not ready: %w", err)
// }

// // Wait for each CertManager deployment individually by name (most reliable)
// deployments := []string{"cert-manager", "cert-manager-cainjector", "cert-manager-webhook"}

// for _, deployment := range deployments {
// cmd := exec.Command("kubectl", "wait", "deployment", deployment,
// "-n", "cert-manager",
// "--for", "condition=Available",
// "--timeout", "300s")

// if _, err := Run(cmd); err != nil {
// return fmt.Errorf("deployment %s not ready: %w", deployment, err)
// }
// }

// // Wait for the cert-manager webhook to be ready (critical for functionality)
// cmd = exec.Command("kubectl", "wait", "pods",
// "-n", "cert-manager",
// "-l", "app=webhook",
// "--for", "condition=Ready",
// "--timeout", "300s")

// if _, err := Run(cmd); err != nil {
// return fmt.Errorf("cert-manager webhook pods not ready: %w", err)
// }

// return nil
Copy link
Contributor

Choose a reason for hiding this comment

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

We definitely do NOT want to comment this code out.

Comment on lines +81 to +96
@echo "Installing CertManager..."
@if [ "$(CERT_MANAGER_INSTALL_SKIP)" != "true" ]; then \
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.18.2/cert-manager.yaml; \
echo "Waiting for CertManager deployments to be ready..."; \
kubectl wait --for=condition=Available --timeout=300s deployment/cert-manager -n cert-manager; \
kubectl wait --for=condition=Available --timeout=300s deployment/cert-manager-cainjector -n cert-manager; \
kubectl wait --for=condition=Available --timeout=300s deployment/cert-manager-webhook -n cert-manager; \
echo "CertManager is ready!"; \
fi
@echo "Installing Istio..."
@if [ "$(ISTIO_INSTALL_SKIP)" != "true" ]; then \
echo "Istio installation will be handled by the test suite"; \
fi
@if [ "$(PROMETHEUS_INSTALL_SKIP)" != "true" ]; then \
echo "Installing Prometheus (if needed)..."; \
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

We should remove this code and rely on logic within go testing infrastructure to perform this setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ci area - related to ci area/controller area - related to controller components area/v2 area - version - kubeflow notebooks v2 do-not-merge/work-in-progress size/L
Projects
Status: Needs Triage
Development

Successfully merging this pull request may close these issues.

2 participants