-
Notifications
You must be signed in to change notification settings - Fork 301
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
run presubmits with pull-request created image #2029
Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
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 |
---|---|---|
|
@@ -21,7 +21,6 @@ set -o pipefail | |
set -o xtrace | ||
|
||
export GOPATH="$(go env GOPATH)" | ||
KUBE_REPO_ROOT=$GOPATH/src/k8s.io/kubernetes | ||
REPO_ROOT=$(git rev-parse --show-toplevel) | ||
cd ${REPO_ROOT} | ||
|
||
|
@@ -30,10 +29,6 @@ function cleanup { | |
if [[ "${CLEANUP_BOSKOS:-}" == "true" ]]; then | ||
cleanup_boskos | ||
fi | ||
# shellcheck disable=SC2153 | ||
if [[ "${DELETE_CLUSTER:-}" == "true" ]]; then | ||
kubetest2 ${KUBETEST2_ARGS} --down || echo "kubetest2 down failed" | ||
fi | ||
} | ||
trap cleanup EXIT | ||
|
||
|
@@ -58,22 +53,113 @@ if [[ -z "${IMAGE_TAG:-}" ]]; then | |
IMAGE_TAG=$(git rev-parse --short HEAD)-$(date +%Y%m%dT%H%M%S) | ||
fi | ||
|
||
export GCE_GLBC_IMAGE=$(go run github.com/google/[email protected] build --tags ${IMAGE_TAG} --base-import-paths --push=true ./cmd/glbc/) | ||
KO_GLBC_IMAGE=$(go run github.com/google/[email protected] build --tags ${IMAGE_TAG} --base-import-paths --push=true ./cmd/glbc/) | ||
# remove the sha from the image name, it does not work with gce registry per example | ||
export GCE_GLBC_IMAGE=$(echo $KO_GLBC_IMAGE | cut -d\@ -f1) | ||
echo "GCE_GLBC_IMAGE=${GCE_GLBC_IMAGE}" | ||
|
||
go install sigs.k8s.io/kubetest2@latest | ||
go install sigs.k8s.io/kubetest2/kubetest2-gce@latest | ||
go install sigs.k8s.io/kubetest2/kubetest2-tester-ginkgo@latest | ||
kubetest2 gce -v 2 \ | ||
--repo-root=${KUBE_REPO_ROOT} \ | ||
--gcp-project=${GCP_PROJECT} \ | ||
--ingress-gce-image=${GCE_GLBC_IMAGE} \ | ||
--legacy-mode \ | ||
--build \ | ||
--up \ | ||
--down \ | ||
--test=ginkgo \ | ||
-- \ | ||
--focus-regex='\[Feature:NEG\]|Loadbalancing|LoadBalancers|Ingress' \ | ||
--skip-regex='\[Feature:kubemci\]|\[Disruptive\]|\[Feature:IngressScale\]|\[Feature:NetworkPolicy\]' \ | ||
--use-built-binaries | ||
|
||
export CUSTOM_INGRESS_YAML=$(cat <<EOF | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: l7-lb-controller | ||
namespace: kube-system | ||
annotations: | ||
scheduler.alpha.kubernetes.io/critical-pod: "" | ||
seccomp.security.alpha.kubernetes.io/pod: "docker/default" | ||
labels: | ||
k8s-app: gcp-lb-controller | ||
kubernetes.io/name: "GLBC" | ||
spec: | ||
priorityClassName: system-cluster-critical | ||
securityContext: | ||
runAsUser: 0 | ||
terminationGracePeriodSeconds: 300 | ||
hostNetwork: true | ||
containers: | ||
- image: $GCE_GLBC_IMAGE | ||
livenessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: 8086 | ||
scheme: HTTP | ||
initialDelaySeconds: 30 | ||
# healthz reaches out to GCE | ||
periodSeconds: 30 | ||
timeoutSeconds: 15 | ||
successThreshold: 1 | ||
failureThreshold: 5 | ||
name: l7-lb-controller | ||
volumeMounts: | ||
- mountPath: /etc/gce.conf | ||
name: cloudconfig | ||
readOnly: true | ||
- mountPath: /var/log/glbc.log | ||
name: logfile | ||
readOnly: false | ||
- mountPath: /etc/srv/kubernetes/l7-lb-controller | ||
name: srvkube | ||
readOnly: true | ||
resources: | ||
requests: | ||
cpu: 10m | ||
memory: 50Mi | ||
args: | ||
- --v=3 | ||
- --logtostderr=false | ||
- --log_file=/var/log/glbc.log | ||
- --enable-finalizer-remove | ||
- --enable-finalizer-add | ||
- --default-backend-service=kube-system/default-http-backend | ||
- --kubeconfig=/etc/srv/kubernetes/l7-lb-controller/kubeconfig | ||
- --sync-period=600s | ||
- --running-in-cluster=false | ||
- --config-file-path=/etc/gce.conf | ||
- --healthz-port=8086 | ||
- --gce-ratelimit=ga.Operations.Get,qps,10,100 | ||
- --gce-ratelimit=alpha.Operations.Get,qps,10,100 | ||
- --gce-ratelimit=beta.Operations.Get,qps,10,100 | ||
- --gce-ratelimit=ga.BackendServices.Get,qps,1.8,1 | ||
- --gce-ratelimit=beta.BackendServices.Get,qps,1.8,1 | ||
- --gce-ratelimit=ga.HealthChecks.Get,qps,1.8,1 | ||
- --gce-ratelimit=alpha.HealthChecks.Get,qps,1.8,1 | ||
- --gce-ratelimit=beta.NetworkEndpointGroups.Get,qps,1.8,1 | ||
- --gce-ratelimit=beta.NetworkEndpointGroups.AttachNetworkEndpoints,qps,1.8,1 | ||
- --gce-ratelimit=beta.NetworkEndpointGroups.DetachNetworkEndpoints,qps,1.8,1 | ||
- --gce-ratelimit=beta.NetworkEndpointGroups.ListNetworkEndpoints,qps,1.8,1 | ||
- --gce-ratelimit=ga.NetworkEndpointGroups.Get,qps,1.8,1 | ||
- --gce-ratelimit=ga.NetworkEndpointGroups.AttachNetworkEndpoints,qps,1.8,1 | ||
- --gce-ratelimit=ga.NetworkEndpointGroups.DetachNetworkEndpoints,qps,1.8,1 | ||
- --gce-ratelimit=ga.NetworkEndpointGroups.ListNetworkEndpoints,qps,1.8,1 | ||
volumes: | ||
- hostPath: | ||
path: /etc/gce.conf | ||
type: FileOrCreate | ||
name: cloudconfig | ||
- hostPath: | ||
path: /var/log/glbc.log | ||
type: FileOrCreate | ||
name: logfile | ||
- hostPath: | ||
path: /etc/srv/kubernetes/l7-lb-controller | ||
name: srvkube | ||
EOF | ||
) | ||
|
||
|
||
# The tests are too slow ~20 mins per test and when running in parallel flake | ||
# Run just one test as smoke test to verify the code is functional | ||
# TODO: make the test more faster and reliable, even replace the kubernetes | ||
# tests with our own ones. | ||
/workspace/test-infra/scenarios/kubernetes_e2e.py --check-leaked-resources \ | ||
--cluster= \ | ||
--env=GCE_ALPHA_FEATURES=NetworkEndpointGroup \ | ||
--env=KUBE_GCE_ENABLE_IP_ALIASES=true \ | ||
--extract=ci/latest \ | ||
--gcp-project="${GCP_PROJECT}" \ | ||
--gcp-zone=us-west1-b \ | ||
--ginkgo-parallel=1 \ | ||
--provider=gce \ | ||
'--test_args=--ginkgo.focus=Loadbalancing.*should.be.able.to.switch.between.IG.and.NEG.modes --ginkgo.skip=\[Serial\]|IngressClass' \ | ||
--timeout=320m |
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.
so this pushes to a registry? what GCs these?
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.
This is pushed to the GCR registry in the boskos project. you can see the GCS for GCR created in https://github.com/kubernetes/k8s.io/pull/5015/files for kops tests.
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 think we should migrate to regional ARs for each boskos project.
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.
pushes to boskos created project, I copied from @justinsb , that is why I asked, I think this is eventually garbage collected