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 istio bug report on failure #9458

Merged
merged 21 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d4489dd
add istioctl bug report
npolshakova May 6, 2024
83a6536
add debug, clean up istio commands
npolshakova May 6, 2024
b9a1398
bump curl, add check httpbin is ready
npolshakova May 6, 2024
efca7c2
use hashFiles exists
npolshakova May 7, 2024
51f0f16
Merge main into npolshak/add-istio-debug-report-on-failure
soloio-bulldozer[bot] May 7, 2024
7eff77d
Merge branch 'main' into npolshak/add-istio-debug-report-on-failure
npolshakova May 8, 2024
9c6c4aa
Merge refs/heads/main into npolshak/add-istio-debug-report-on-failure
soloio-bulldozer[bot] May 8, 2024
33b1b2e
add resource req limits
npolshakova May 8, 2024
e4e9329
pr feedback
npolshakova May 8, 2024
7c2f7f6
Merge remote-tracking branch 'origin/main' into npolshak/add-istio-de…
npolshakova May 8, 2024
ea66193
trigger failure to get resource limits in oss
npolshakova May 8, 2024
b090382
set istio version
npolshakova May 8, 2024
ac03b53
set istio version in github workflow
npolshakova May 9, 2024
cd7bf99
Merge refs/heads/main into npolshak/add-istio-debug-report-on-failure
soloio-bulldozer[bot] May 9, 2024
510ec88
Merge remote-tracking branch 'origin/main' into npolshak/add-istio-de…
npolshakova May 9, 2024
21d0dad
use GeneratedFiles.TempDir
npolshakova May 9, 2024
8bc1ff8
use FailureDir
npolshakova May 9, 2024
0d23e99
remove fail() to test artifact upload
npolshakova May 9, 2024
7a7c00b
switch istioctl back to testInstallation
npolshakova May 9, 2024
2332da6
remove increased timeout
npolshakova May 9, 2024
aa99cc4
Merge refs/heads/main into npolshak/add-istio-debug-report-on-failure
soloio-bulldozer[bot] May 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/pr-kubernetes-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
env:
VERSION: '1.0.0-ci1'
GITHUB_TOKEN: ${{ github.token }}
# The istio version to use for the e2e tests
# TODO(npolshak): Test across multiple versions of Istio
# https://istio.io/latest/docs/releases/supported-releases/#support-status-of-istio-releases
ISTIO_VERSION: "1.19.9"

jobs:
prepare_env:
Expand Down Expand Up @@ -95,4 +99,9 @@ jobs:
cluster-name: kind
test-args: ${{ matrix.test.go-test-args }}
run-regex: ${{ matrix.test.go-test-run-regex }}

- name: Archive bug report directory on failure
npolshakova marked this conversation as resolved.
Show resolved Hide resolved
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: bug-report
path: ./_test/bug_report
npolshakova marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 6 additions & 0 deletions changelog/v1.17.0-beta26/add-istio-bug-report-on-failure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
changelog:
- type: NON_USER_FACING
issueLink: https://github.com/solo-io/solo-projects/issues/6048
resolvesIssue: false
description: >-
Add istioctl bug-report to the end-to-end tests on failure.
6 changes: 6 additions & 0 deletions test/kubernetes/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ This package holds the entry point for each of our `TestInstallation`.

See [Load balancing tests](./load_balancing_tests.md) for more information about how these tests are run in CI.

## Environment Variables

Some tests may require environment variables to be set. Some required env vars are:

- Istio features: Require `ISTIO_VERSION` to be set. The tests running in CI use `ISTIO_VERSION="${ISTIO_VERSION:-1.19.9}"` to default to a specific version of Istio.

## Debugging

Refer to the [Debugging guide](./debugging.md) for more information on how to debug tests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,9 @@ spec:
command:
- "tail"
- "-f"
- "/dev/null"
- "/dev/null"
resources:
requests:
cpu: "100m"
limits:
cpu: "200m"
7 changes: 6 additions & 1 deletion test/kubernetes/e2e/features/istio/auto_mtls_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package istio
import (
"context"

"github.com/onsi/gomega"
"github.com/stretchr/testify/suite"

"github.com/solo-io/gloo/pkg/utils/kubeutils"
Expand Down Expand Up @@ -31,6 +32,8 @@ func NewIstioAutoMtlsSuite(ctx context.Context, testInst *e2e.TestInstallation)
func (s *istioAutoMtlsTestingSuite) SetupSuite() {
err := s.testInstallation.Actions.Kubectl().ApplyFile(s.ctx, setupManifest)
s.NoError(err, "can apply setup manifest")
// Check that istio injection is successful and httpbin is running
s.testInstallation.Assertions.EventuallyRunningReplicas(s.ctx, httpbinDeployment.ObjectMeta, gomega.Equal(1))

// Ensure that the proxy service and deployment are created
err = s.testInstallation.Actions.Kubectl().ApplyFile(s.ctx, k8sRoutingManifest)
Expand All @@ -45,6 +48,7 @@ func (s *istioAutoMtlsTestingSuite) TearDownSuite() {

err = s.testInstallation.Actions.Kubectl().DeleteFile(s.ctx, setupManifest)
s.NoError(err, "can delete setup manifest")
s.testInstallation.Assertions.EventuallyObjectsNotExist(s.ctx, httpbinDeployment)
}

func (s *istioAutoMtlsTestingSuite) TestMtlsStrictPeerAuth() {
Expand All @@ -64,7 +68,8 @@ func (s *istioAutoMtlsTestingSuite) TestMtlsStrictPeerAuth() {
curl.WithHostHeader("httpbin"),
curl.WithPath("/headers"),
},
expectedMtlsResponse)
expectedMtlsResponse,
)
}

func (s *istioAutoMtlsTestingSuite) TestMtlsPermissivePeerAuth() {
Expand Down
14 changes: 6 additions & 8 deletions test/kubernetes/e2e/features/istio/inputs/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,11 @@ spec:
- "600s" # override default 10s
ports:
- containerPort: 8080
- name: curl
image: curlimages/curl:7.83.1
resources:
requests:
cpu: "100m"
limits:
cpu: "200m"
imagePullPolicy: IfNotPresent
command:
- "tail"
- "-f"
- "/dev/null"
---
apiVersion: v1
kind: Namespace
Expand All @@ -93,4 +86,9 @@ spec:
command:
- "tail"
- "-f"
- "/dev/null"
- "/dev/null"
resources:
requests:
cpu: "100m"
limits:
cpu: "200m"
8 changes: 7 additions & 1 deletion test/kubernetes/e2e/features/istio/no_mtls_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package istio
import (
"context"

"github.com/onsi/gomega"
"github.com/solo-io/gloo/pkg/utils/kubeutils"
"github.com/solo-io/gloo/pkg/utils/requestutils/curl"
"github.com/solo-io/gloo/test/kubernetes/e2e"
Expand Down Expand Up @@ -31,6 +32,8 @@ func NewTestingSuite(ctx context.Context, testInst *e2e.TestInstallation) suite.
func (s *istioTestingSuite) SetupSuite() {
err := s.testInstallation.Actions.Kubectl().ApplyFile(s.ctx, setupManifest)
s.NoError(err, "can apply setup manifest")
// Check that istio injection is successful and httpbin is running
s.testInstallation.Assertions.EventuallyRunningReplicas(s.ctx, httpbinDeployment.ObjectMeta, gomega.Equal(1))

// Ensure that the proxy service and deployment are created
err = s.testInstallation.Actions.Kubectl().ApplyFile(s.ctx, k8sRoutingManifest)
Expand All @@ -45,6 +48,8 @@ func (s *istioTestingSuite) TearDownSuite() {

err = s.testInstallation.Actions.Kubectl().DeleteFile(s.ctx, setupManifest)
s.NoError(err, "can delete setup manifest")
s.testInstallation.Assertions.EventuallyObjectsNotExist(s.ctx, httpbinDeployment)

}

func (s *istioTestingSuite) TestStrictPeerAuth() {
Expand All @@ -65,7 +70,8 @@ func (s *istioTestingSuite) TestStrictPeerAuth() {
curl.WithHostHeader("httpbin"),
curl.WithPath("/headers"),
},
expectedServiceUnavailableResponse)
expectedServiceUnavailableResponse,
)
}

func (s *istioTestingSuite) TestPermissivePeerAuth() {
Expand Down
8 changes: 8 additions & 0 deletions test/kubernetes/e2e/features/istio/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ var (
proxyDeployment = &appsv1.Deployment{ObjectMeta: glooProxyObjectMeta}
proxyService = &corev1.Service{ObjectMeta: glooProxyObjectMeta}

// httpbinDeployment is the Deployment that is in the Istio mesh
httpbinDeployment = &appsv1.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: "httpbin",
Namespace: "httpbin",
},
}

// curlPod is the Pod that will be used to execute curl requests, and is defined in the fault injection manifest files
curlPodExecOpt = kubectl.PodExecOptions{
Name: "curl",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,9 @@ spec:
command:
- "tail"
- "-f"
- "/dev/null"
- "/dev/null"
npolshakova marked this conversation as resolved.
Show resolved Hide resolved
resources:
requests:
cpu: "100m"
limits:
cpu: "200m"
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,9 @@ spec:
command:
- "tail"
- "-f"
- "/dev/null"
- "/dev/null"
resources:
requests:
cpu: "100m"
limits:
cpu: "200m"
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,9 @@ spec:
command:
- "tail"
- "-f"
- "/dev/null"
- "/dev/null"
resources:
requests:
cpu: "100m"
limits:
cpu: "200m"
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,9 @@ spec:
command:
- "tail"
- "-f"
- "/dev/null"
- "/dev/null"
resources:
requests:
cpu: "100m"
limits:
cpu: "200m"
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,8 @@ spec:
- "tail"
- "-f"
- "/dev/null"
resources:
requests:
cpu: "100m"
limits:
cpu: "200m"
3 changes: 3 additions & 0 deletions test/kubernetes/e2e/k8sgateway/automtls_istio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ func TestK8sGatewayIstioAutoMtls(t *testing.T) {
t.Cleanup(func() {
if t.Failed() {
testInstallation.PreFailHandler(ctx)

// Generate istioctl bug report
npolshakova marked this conversation as resolved.
Show resolved Hide resolved
testInstallation.CreateIstioBugReport(ctx)
}

testInstallation.UninstallGlooGateway(ctx, func(ctx context.Context) error {
Expand Down
3 changes: 3 additions & 0 deletions test/kubernetes/e2e/k8sgateway/istio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ func TestK8sGatewayIstio(t *testing.T) {
t.Cleanup(func() {
if t.Failed() {
testInstallation.PreFailHandler(ctx)

// Generate istioctl bug report
testInstallation.CreateIstioBugReport(ctx)
}

testInstallation.UninstallGlooGateway(ctx, func(ctx context.Context) error {
Expand Down
Loading
Loading