Skip to content

Commit b2e9b2a

Browse files
authored
Merge pull request kubernetes#74608 from dims/lighter-weight-make-for-conformance-dependencies
Lighter weight make for conformance dependencies, better script and manifest
2 parents 6e8b569 + 23b33f5 commit b2e9b2a

File tree

4 files changed

+123
-43
lines changed

4 files changed

+123
-43
lines changed

cluster/images/conformance/Makefile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,18 @@
1515
# Build the conformance image.
1616
#
1717
# Usage:
18-
# [ARCH=amd64] [REGISTRY="staging-k8s.gcr.io"] make (build|push) VERSION={some_released_version_of_kubernetes}
18+
# [ARCH=amd64] [REGISTRY="k8s.gcr.io"] make (build|push) VERSION={some_released_version_of_kubernetes}
1919

20-
REGISTRY?=staging-k8s.gcr.io
20+
REGISTRY?=k8s.gcr.io
2121
ARCH?=amd64
2222
OUT_DIR?=_output
23-
GINKGO_BIN?=$(shell pwd)/../../../$(OUT_DIR)/dockerized/bin/linux/$(ARCH)/ginkgo
24-
KUBECTL_BIN?=$(shell pwd)/../../../$(OUT_DIR)/dockerized/bin/linux/$(ARCH)/kubectl
25-
E2E_TEST_BIN?=$(shell pwd)/../../../$(OUT_DIR)/dockerized/bin/linux/$(ARCH)/e2e.test
23+
24+
OUTPUT_PATH=$(shell pwd)/../../../$(OUT_DIR)
25+
BINARY_PATH=$(shell test -d $(OUTPUT_PATH)/local && echo $(OUTPUT_PATH)/local || echo $(OUTPUT_PATH)/dockerized)
26+
27+
GINKGO_BIN?=$(BINARY_PATH)/bin/linux/$(ARCH)/ginkgo
28+
KUBECTL_BIN?=$(BINARY_PATH)/bin/linux/$(ARCH)/kubectl
29+
E2E_TEST_BIN?=$(BINARY_PATH)/bin/linux/$(ARCH)/e2e.test
2630
CLUSTER_DIR?=$(shell pwd)/../../../cluster/
2731

2832
BASEIMAGE=k8s.gcr.io/debian-hyperkube-base-$(ARCH):0.12.1

cluster/images/conformance/README.md

Lines changed: 11 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,63 +6,36 @@
66
#### How to release by hand
77

88
```console
9-
# First, build the binaries
10-
$ build/run.sh make cross
9+
# First, build the binaries by running make from the root directory
10+
$ make WHAT="test/e2e/e2e.test vendor/github.com/onsi/ginkgo/ginkgo cmd/kubectl"
1111

1212
# Build for linux/amd64 (default)
13-
# export REGISTRY=$HOST/$ORG to switch from staging-k8s.gcr.io
13+
# export REGISTRY=$HOST/$ORG to switch from k8s.gcr.io
1414

1515
$ make push VERSION={target_version} ARCH=amd64
16-
# ---> staging-k8s.gcr.io/conformance-amd64:VERSION
17-
# ---> staging-k8s.gcr.io/conformance:VERSION (image with backwards-compatible naming)
16+
# ---> k8s.gcr.io/conformance-amd64:VERSION
17+
# ---> k8s.gcr.io/conformance:VERSION (image with backwards-compatible naming)
1818

1919
$ make push VERSION={target_version} ARCH=arm
20-
# ---> staging-k8s.gcr.io/conformance-arm:VERSION
20+
# ---> k8s.gcr.io/conformance-arm:VERSION
2121

2222
$ make push VERSION={target_version} ARCH=arm64
23-
# ---> staging-k8s.gcr.io/conformance-arm64:VERSION
23+
# ---> k8s.gcr.io/conformance-arm64:VERSION
2424

2525
$ make push VERSION={target_version} ARCH=ppc64le
26-
# ---> staging-k8s.gcr.io/conformance-ppc64le:VERSION
26+
# ---> k8s.gcr.io/conformance-ppc64le:VERSION
2727

2828
$ make push VERSION={target_version} ARCH=s390x
29-
# ---> staging-k8s.gcr.io/conformance-s390x:VERSION
29+
# ---> k8s.gcr.io/conformance-s390x:VERSION
3030
```
3131

3232
If you don't want to push the images, run `make` or `make build` instead
3333

3434

35-
#### How to setup RBAC needed
35+
#### How to run tests
3636

3737
```
38-
kubectl create clusterrolebinding add-on-cluster-admin --clusterrole=cluster-admin --serviceaccount=default:default
38+
kubectl create -f conformance-e2e.yaml
3939
```
4040

41-
#### How to run a single test
42-
43-
```
44-
apiVersion: v1
45-
kind: Pod
46-
metadata:
47-
name: e2e-producer-consumer-test
48-
spec:
49-
containers:
50-
- name: conformance-container
51-
image: gcr.io/heptio-images/kube-conformance:latest
52-
image: staging-k8s.gcr.io/conformance-amd64:v1.12.1
53-
imagePullPolicy: IfNotPresent
54-
env:
55-
- name: E2E_FOCUS
56-
value: "Pods should be submitted and removed"
57-
volumeMounts:
58-
- name: output-volume
59-
mountPath: /tmp/results
60-
volumes:
61-
- name: output-volume
62-
hostPath:
63-
path: /tmp/results
64-
restartPolicy: Never
65-
```
66-
67-
6841
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/cluster/images/conformance/README.md?pixel)]()
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2018 The Kubernetes Authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -o errexit
17+
set -o nounset
18+
set -o pipefail
19+
20+
kubectl create -f conformance-e2e.yaml
21+
while true; do
22+
STATUS=$(kubectl -n conformance get pods e2e-conformance-test -o jsonpath="{.status.phase}")
23+
timestamp=$(date +"[%H:%M:%S]")
24+
echo "$timestamp Pod status is: ${STATUS}"
25+
if [[ "$STATUS" == "Succeeded" ]]; then
26+
echo "$timestamp Done."
27+
break
28+
else
29+
sleep 5
30+
fi
31+
done
32+
echo "Please use 'kubectl logs -n conformance e2e-conformance-test' to view the results"
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
apiVersion: v1
3+
kind: Namespace
4+
metadata:
5+
name: conformance
6+
---
7+
apiVersion: v1
8+
kind: ServiceAccount
9+
metadata:
10+
labels:
11+
component: conformance
12+
name: conformance-serviceaccount
13+
namespace: conformance
14+
---
15+
apiVersion: rbac.authorization.k8s.io/v1
16+
kind: ClusterRoleBinding
17+
metadata:
18+
labels:
19+
component: conformance
20+
name: conformance-serviceaccount-role
21+
roleRef:
22+
apiGroup: rbac.authorization.k8s.io
23+
kind: ClusterRole
24+
name: conformance-serviceaccount
25+
subjects:
26+
- kind: ServiceAccount
27+
name: conformance-serviceaccount
28+
namespace: conformance
29+
---
30+
apiVersion: rbac.authorization.k8s.io/v1
31+
kind: ClusterRole
32+
metadata:
33+
labels:
34+
component: conformance
35+
name: conformance-serviceaccount
36+
rules:
37+
- apiGroups:
38+
- '*'
39+
resources:
40+
- '*'
41+
verbs:
42+
- '*'
43+
- nonResourceURLs:
44+
- '/metrics'
45+
- '/logs'
46+
- '/logs/*'
47+
verbs:
48+
- 'get'
49+
---
50+
apiVersion: v1
51+
kind: Pod
52+
metadata:
53+
name: e2e-conformance-test
54+
namespace: conformance
55+
spec:
56+
containers:
57+
- name: conformance-container
58+
image: k8s.gcr.io/conformance-amd64:v1.14
59+
imagePullPolicy: IfNotPresent
60+
env:
61+
- name: E2E_FOCUS
62+
value: "Pods should be submitted and removed"
63+
volumeMounts:
64+
- name: output-volume
65+
mountPath: /tmp/results
66+
volumes:
67+
- name: output-volume
68+
hostPath:
69+
path: /tmp/results
70+
restartPolicy: Never
71+
serviceAccountName: conformance-serviceaccount

0 commit comments

Comments
 (0)