-
Notifications
You must be signed in to change notification settings - Fork 62
test: Istio e2e test suite #570
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
base: notebooks-v2
Are you sure you want to change the base?
test: Istio e2e test suite #570
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
7837c35
to
0a79c95
Compare
- 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]>
0a79c95
to
95f18da
Compare
…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]>
…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]>
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.
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() |
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.
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" { |
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.
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 = "" |
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.
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: |
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.
Is this TODO:
relevant/valid?
} | ||
|
||
// InstallIstioMinimalWithIngress installs Istio with minimal profile and ingressgateway enabled. | ||
func InstallIstioMinimalWithIngress(namespace string) error { |
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.
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
{
|
||
// 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 |
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.
We definitely do NOT want to comment this code out.
@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 |
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.
We should remove this code and rely on logic within go
testing infrastructure to perform this setup.
Key Changes