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
Switch image in gRPC probe tests to agnhost #115800
Merged
k8s-ci-robot
merged 3 commits into
kubernetes:master
from
shogohida:switch-image-in-grpc-probe-tests-to-agnhost
Feb 18, 2023
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -20,7 +20,6 @@ import ( | |
"context" | ||
"errors" | ||
"fmt" | ||
"net" | ||
"net/url" | ||
"strings" | ||
"time" | ||
|
@@ -525,7 +524,7 @@ var _ = SIGDescribe("Probing container", func() { | |
livenessProbe := &v1.Probe{ | ||
ProbeHandler: v1.ProbeHandler{ | ||
GRPC: &v1.GRPCAction{ | ||
Port: 2379, | ||
Port: 5000, | ||
Service: nil, | ||
}, | ||
}, | ||
|
@@ -534,7 +533,7 @@ var _ = SIGDescribe("Probing container", func() { | |
FailureThreshold: 1, | ||
} | ||
|
||
pod := gRPCServerPodSpec(nil, livenessProbe, "etcd") | ||
pod := gRPCServerPodSpec(nil, livenessProbe, "agnhost") | ||
RunLivenessTest(ctx, f, pod, 0, defaultObservationTimeout) | ||
}) | ||
|
||
|
@@ -555,7 +554,7 @@ var _ = SIGDescribe("Probing container", func() { | |
TimeoutSeconds: 5, // default 1s can be pretty aggressive in CI environments with low resources | ||
FailureThreshold: 1, | ||
} | ||
pod := gRPCServerPodSpec(nil, livenessProbe, "etcd") | ||
pod := gRPCServerPodSpec(nil, livenessProbe, "agnhost") | ||
RunLivenessTest(ctx, f, pod, 1, defaultObservationTimeout) | ||
}) | ||
|
||
|
@@ -630,7 +629,7 @@ done | |
podClient := e2epod.NewPodClient(f) | ||
terminationGracePeriod := int64(30) | ||
script := ` | ||
_term() { | ||
_term() { | ||
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. Blank space was deleted automatically by Visual Studio Code. |
||
rm -f /tmp/ready | ||
rm -f /tmp/liveness | ||
sleep 20 | ||
|
@@ -641,7 +640,7 @@ trap _term SIGTERM | |
touch /tmp/ready | ||
touch /tmp/liveness | ||
|
||
while true; do | ||
while true; do | ||
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. Blank space was deleted automatically by Visual Studio Code. |
||
echo \"hello\" | ||
sleep 10 | ||
done | ||
|
@@ -1036,27 +1035,18 @@ func runReadinessFailTest(ctx context.Context, f *framework.Framework, pod *v1.P | |
} | ||
|
||
func gRPCServerPodSpec(readinessProbe, livenessProbe *v1.Probe, containerName string) *v1.Pod { | ||
etcdLocalhostAddress := "127.0.0.1" | ||
if framework.TestContext.ClusterIsIPv6() { | ||
etcdLocalhostAddress = "::1" | ||
} | ||
etcdURL := fmt.Sprintf("http://%s", net.JoinHostPort(etcdLocalhostAddress, "2379")) | ||
return &v1.Pod{ | ||
ObjectMeta: metav1.ObjectMeta{Name: "test-grpc-" + string(uuid.NewUUID())}, | ||
Spec: v1.PodSpec{ | ||
Containers: []v1.Container{ | ||
{ | ||
Name: containerName, | ||
Image: imageutils.GetE2EImage(imageutils.Etcd), | ||
Image: imageutils.GetE2EImage(imageutils.Agnhost), | ||
Command: []string{ | ||
"/usr/local/bin/etcd", | ||
"--listen-client-urls", | ||
"http://0.0.0.0:2379", //should listen on all addresses | ||
"--advertise-client-urls", | ||
etcdURL, | ||
"/agnhost", | ||
"grpc-health-checking", | ||
}, | ||
// 2380 is an automatic peer URL | ||
Ports: []v1.ContainerPort{{ContainerPort: int32(2379)}, {ContainerPort: int32(2380)}}, | ||
Ports: []v1.ContainerPort{{ContainerPort: int32(5000)}, {ContainerPort: int32(8080)}}, | ||
LivenessProbe: livenessProbe, | ||
ReadinessProbe: readinessProbe, | ||
}, | ||
|
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.
did you run the test? You still hasn;t updated the port in liveness probe definition on the line 527
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.
Oh sorry about that. I changed it to 5000