mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Merge pull request #87632 from pjh/multi-arch-smoke-test
Update GCE Windows smoke-test script to work with 1909 nodes.
This commit is contained in:
commit
9f44f7ecc2
@ -84,14 +84,15 @@ Now bring up a cluster using one of the following two methods:
|
|||||||
```
|
```
|
||||||
# Invoke kube-up.sh with these environment variables:
|
# Invoke kube-up.sh with these environment variables:
|
||||||
# PROJECT: text name of your GCP project.
|
# PROJECT: text name of your GCP project.
|
||||||
# KUBERNETES_SKIP_CONFIRM: skips any kube-up prompts.
|
# KUBE_UP_AUTOMATIC_CLEANUP (optional): cleans up existing cluster without
|
||||||
PROJECT=${CLOUDSDK_CORE_PROJECT} KUBERNETES_SKIP_CONFIRM=y ./cluster/kube-up.sh
|
# prompting.
|
||||||
|
PROJECT=${CLOUDSDK_CORE_PROJECT} KUBE_UP_AUTOMATIC_CLEANUP=true ./cluster/kube-up.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
To teardown the cluster run:
|
To teardown the cluster run:
|
||||||
|
|
||||||
```
|
```
|
||||||
PROJECT=${CLOUDSDK_CORE_PROJECT} KUBERNETES_SKIP_CONFIRM=y ./cluster/kube-down.sh
|
PROJECT=${CLOUDSDK_CORE_PROJECT} ./cluster/kube-down.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 2b. Create a Kubernetes end-to-end (E2E) test cluster
|
#### 2b. Create a Kubernetes end-to-end (E2E) test cluster
|
||||||
|
@ -245,17 +245,19 @@ function undeploy_linux_command_pod {
|
|||||||
${kubectl} delete deployment $linux_command_deployment
|
${kubectl} delete deployment $linux_command_deployment
|
||||||
}
|
}
|
||||||
|
|
||||||
windows_webserver_deployment=windows-nettest
|
windows_webserver_deployment=windows-agnhost
|
||||||
windows_webserver_pod_label=nettest
|
windows_webserver_pod_label=agnhost
|
||||||
|
# The default port for 'agnhost serve-hostname'. The documentation says that
|
||||||
|
# this can be changed but the --port arg does not seem to work.
|
||||||
|
windows_webserver_port=9376
|
||||||
windows_webserver_replicas=1
|
windows_webserver_replicas=1
|
||||||
|
|
||||||
function deploy_windows_webserver_pod {
|
function deploy_windows_webserver_pod {
|
||||||
echo "Writing example deployment to $windows_webserver_deployment.yaml"
|
echo "Writing example deployment to $windows_webserver_deployment.yaml"
|
||||||
cat <<EOF > $windows_webserver_deployment.yaml
|
cat <<EOF > $windows_webserver_deployment.yaml
|
||||||
# You can run a pod with the e2eteam/nettest:1.0 image (which should listen on
|
# A multi-arch Windows container that runs an HTTP server on port
|
||||||
# <podIP>:8080) and create another pod on a different node (linux would be
|
# $windows_webserver_port that serves the container's hostname.
|
||||||
# easier) to curl the http server:
|
# curl -s http://<pod_ip>:$windows_webserver_port
|
||||||
# curl http://<pod_ip>:8080/read
|
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@ -273,8 +275,10 @@ spec:
|
|||||||
app: $windows_webserver_pod_label
|
app: $windows_webserver_pod_label
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: nettest
|
- name: agnhost
|
||||||
image: e2eteam/nettest:1.0
|
image: e2eteam/agnhost:2.8
|
||||||
|
args:
|
||||||
|
- serve-hostname
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
beta.kubernetes.io/os: windows
|
beta.kubernetes.io/os: windows
|
||||||
tolerations:
|
tolerations:
|
||||||
@ -332,6 +336,7 @@ windows_command_deployment=windows-powershell
|
|||||||
windows_command_pod_label=powershell
|
windows_command_pod_label=powershell
|
||||||
windows_command_replicas=1
|
windows_command_replicas=1
|
||||||
|
|
||||||
|
# Deploys a multi-arch Windows pod capable of running PowerShell.
|
||||||
function deploy_windows_command_pod {
|
function deploy_windows_command_pod {
|
||||||
echo "Writing example deployment to $windows_command_deployment.yaml"
|
echo "Writing example deployment to $windows_command_deployment.yaml"
|
||||||
cat <<EOF > $windows_command_deployment.yaml
|
cat <<EOF > $windows_command_deployment.yaml
|
||||||
@ -352,8 +357,8 @@ spec:
|
|||||||
app: $windows_command_pod_label
|
app: $windows_command_pod_label
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: nettest
|
- name: pause-win
|
||||||
image: e2eteam/nettest:1.0
|
image: gcr.io/gke-release/pause-win:1.1.0
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
beta.kubernetes.io/os: windows
|
beta.kubernetes.io/os: windows
|
||||||
tolerations:
|
tolerations:
|
||||||
@ -422,7 +427,7 @@ function test_linux_pod_to_linux_pod {
|
|||||||
local linux_webserver_pod_ip
|
local linux_webserver_pod_ip
|
||||||
linux_webserver_pod_ip="$(get_linux_webserver_pod_ip)"
|
linux_webserver_pod_ip="$(get_linux_webserver_pod_ip)"
|
||||||
|
|
||||||
if ! $kubectl exec "$linux_command_pod" -- curl -m 20 \
|
if ! $kubectl exec "$linux_command_pod" -- curl -s -m 20 \
|
||||||
"http://$linux_webserver_pod_ip" &> $output_file; then
|
"http://$linux_webserver_pod_ip" &> $output_file; then
|
||||||
cleanup_deployments
|
cleanup_deployments
|
||||||
echo "Failing output: $(cat $output_file)"
|
echo "Failing output: $(cat $output_file)"
|
||||||
@ -444,8 +449,8 @@ function test_linux_pod_to_windows_pod {
|
|||||||
local windows_webserver_pod_ip
|
local windows_webserver_pod_ip
|
||||||
windows_webserver_pod_ip="$(get_windows_webserver_pod_ip)"
|
windows_webserver_pod_ip="$(get_windows_webserver_pod_ip)"
|
||||||
|
|
||||||
if ! $kubectl exec "$linux_command_pod" -- curl -m 20 \
|
if ! $kubectl exec "$linux_command_pod" -- curl -s -m 20 \
|
||||||
"http://$windows_webserver_pod_ip:8080/read" &> $output_file; then
|
"http://$windows_webserver_pod_ip:$windows_webserver_port" &> $output_file; then
|
||||||
cleanup_deployments
|
cleanup_deployments
|
||||||
echo "Failing output: $(cat $output_file)"
|
echo "Failing output: $(cat $output_file)"
|
||||||
echo "FAILED: ${FUNCNAME[0]}"
|
echo "FAILED: ${FUNCNAME[0]}"
|
||||||
@ -461,7 +466,7 @@ function test_linux_pod_to_internet {
|
|||||||
# A stable (hopefully) HTTP server provided by Cloudflare.
|
# A stable (hopefully) HTTP server provided by Cloudflare.
|
||||||
local internet_ip="1.1.1.1"
|
local internet_ip="1.1.1.1"
|
||||||
|
|
||||||
if ! $kubectl exec "$linux_command_pod" -- curl -m 20 \
|
if ! $kubectl exec "$linux_command_pod" -- curl -s -m 20 \
|
||||||
"http://$internet_ip" > $output_file; then
|
"http://$internet_ip" > $output_file; then
|
||||||
cleanup_deployments
|
cleanup_deployments
|
||||||
echo "Failing output: $(cat $output_file)"
|
echo "Failing output: $(cat $output_file)"
|
||||||
@ -486,7 +491,7 @@ function test_linux_pod_to_k8s_service {
|
|||||||
# curl-ing the metrics-server service downloads 14 bytes of unprintable binary
|
# curl-ing the metrics-server service downloads 14 bytes of unprintable binary
|
||||||
# data and sets a return code of success (0).
|
# data and sets a return code of success (0).
|
||||||
if ! $kubectl exec "$linux_command_pod" -- \
|
if ! $kubectl exec "$linux_command_pod" -- \
|
||||||
curl -m 20 "http://$service_ip:$service_port" &> $output_file; then
|
curl -s -m 20 "http://$service_ip:$service_port" &> $output_file; then
|
||||||
cleanup_deployments
|
cleanup_deployments
|
||||||
echo "Failing output: $(cat $output_file)"
|
echo "Failing output: $(cat $output_file)"
|
||||||
echo "FAILED: ${FUNCNAME[0]}"
|
echo "FAILED: ${FUNCNAME[0]}"
|
||||||
@ -534,7 +539,7 @@ function test_windows_pod_to_windows_pod {
|
|||||||
windows_webserver_pod_ip="$(get_windows_webserver_pod_ip)"
|
windows_webserver_pod_ip="$(get_windows_webserver_pod_ip)"
|
||||||
|
|
||||||
if ! $kubectl exec "$windows_command_pod" -- powershell.exe \
|
if ! $kubectl exec "$windows_command_pod" -- powershell.exe \
|
||||||
"curl -UseBasicParsing http://$windows_webserver_pod_ip:8080/read" \
|
"curl -UseBasicParsing http://$windows_webserver_pod_ip:$windows_webserver_port" \
|
||||||
> $output_file; then
|
> $output_file; then
|
||||||
cleanup_deployments
|
cleanup_deployments
|
||||||
echo "Failing output: $(cat $output_file)"
|
echo "Failing output: $(cat $output_file)"
|
||||||
|
Loading…
Reference in New Issue
Block a user