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

Update Dockerfile for the e2e test #333

Merged
merged 1 commit into from
Jun 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion Dockerfile.e2e-test
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@

FROM debian:9

COPY cmd/e2e-test/run.sh /run.sh
ADD bin/ARG_ARCH/ARG_BIN /ARG_BIN
ENTRYPOINT ["/ARG_BIN", "-inCluster"]
RUN apt-get update && apt-get update && apt-get install curl -y

ENTRYPOINT ["/run.sh"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ include build/rules.mk
# Additional rule to build an image of glbc for e2e testing.
# TODO(rramkumar): Find a way not to use "latest" as the tag.
push-e2e:
@$(MAKE) --no-print-directory CONTAINER_PREFIX=ingress-gce-e2e containers push
@$(MAKE) --no-print-directory containers push
36 changes: 15 additions & 21 deletions cmd/e2e-test/e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,41 @@
# limitations under the License.
#

# To enable creating RBAC rules on the GKE cluster:
# To run the containerized e2e test in your own cluster:
#
# $ kubectl apply -f e2e-test.yaml
#
# You will nee to first enable creating RBAC rules on the GKE cluster:
#
# $ kubectl create clusterrolebinding cluster-admin-binding \
# --clusterrole cluster-admin
# --user $(gcloud config get-value account)
# --clusterrole cluster-admin \
# --user $(gcloud config get-value account) \
# clusterrolebinding "cluster-admin-binding"
kind: ServiceAccount
apiVersion: v1
metadata:
name: ingress-e2e-test
namespace: default
---
kind: Role
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
namespace: default
name: ingress-e2e-test
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["list"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["list"]
- apiGroups: [""]
resources: ["services"]
verbs: ["list"]
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["get", "create"]
- apiGroups: ["*"]
resources: ["*"]
verbs: ["*"]
---
kind: RoleBinding
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: ingress-e2e-test
namespace: default
subjects:
- kind: ServiceAccount
name: ingress-e2e-test
namespace: default
roleRef:
kind: Role
kind: ClusterRole
name: ingress-e2e-test
apiGroup: rbac.authorization.k8s.io
---
Expand All @@ -65,7 +59,7 @@ metadata:
spec:
containers:
- name: ingress-e2e
image: gcr.io/k8s-ingress-image-push/ingress-gce-e2e-test-amd64:v1.1.0-123-g7aaa9456
image: gcr.io/k8s-ingress-image-push/ingress-gce-e2e-test-amd64:master
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be ingress-gce-e2e-e2e-test-amd64

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix pusher to not add the -e2e prefix

imagePullPolicy: Always
restartPolicy: Never
serviceAccount: ingress-e2e-test
27 changes: 27 additions & 0 deletions cmd/e2e-test/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
#
# Copyright 2018 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# run.sh manages the settings required for running containerized in a
# Kubernetes cluster.

echo '--- BEGIN ---'
PROJECT=$(curl -H'Metadata-Flavor:Google' metadata.google.internal/computeMetadata/v1/project/project-id 2>/dev/null)
echo "PROJECT: ${PROJECT}"
CMD="/e2e-test -test.v -test.parallel=10 -run -project ${PROJECT} -logtostderr -inCluster -v=2"
echo "CMD: ${CMD}" $@
${CMD} "$@" 2>&1
echo "RESULT: $?"
echo '--- END ---'