Skip to content

Commit

Permalink
Update Dockerfile for the e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
bowei committed Jun 12, 2018
1 parent 7c9408b commit 5eaa459
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 23 deletions.
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
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 ---'

0 comments on commit 5eaa459

Please sign in to comment.