From ec87b60c943ee9cabf890a16c8b29ec628180d99 Mon Sep 17 00:00:00 2001 From: James Munnelly Date: Fri, 11 Jan 2019 13:57:06 +0000 Subject: [PATCH] Use Bazel images for nginx-ingress, vault and tiller Signed-off-by: James Munnelly --- Makefile | 1 - WORKSPACE | 42 ++++++++++++++++++- hack/ci/lib/build_images.sh | 4 ++ test/e2e/charts/BUILD.bazel | 4 ++ test/e2e/charts/pebble/values.yaml | 2 +- .../vault/templates/vault-deployment.yaml | 1 + test/e2e/charts/vault/values.yaml | 2 +- .../e2e/framework/addon/nginxingress/nginx.go | 16 +++++++ test/e2e/framework/config/tiller.go | 2 +- 9 files changed, 68 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index e9148ca08..ffc9e0c17 100644 --- a/Makefile +++ b/Makefile @@ -113,7 +113,6 @@ e2e_test: $$(bazel info bazel-genfiles)/test/e2e/e2e.test \ -- \ --helm-binary-path=$$(bazel info bazel-genfiles)/hack/bin/helm \ - --tiller-image-tag=$$($$(bazel info bazel-genfiles)/hack/bin/helm version --client --template '{{.Client.SemVer}}') \ --repo-root="$$(pwd)" \ --report-dir="$${ARTIFACTS:-./_artifacts}" \ --ginkgo.skip="$(GINKGO_SKIP)" diff --git a/WORKSPACE b/WORKSPACE index 065fc8724..4c71cc069 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -74,7 +74,9 @@ container_pull( tag = "3.7-v20180822-0201cfb11", ) -## Fetch helm for use in template generation and testing +## Fetch helm & tiller for use in template generation and testing +## You can bump the version of Helm & Tiller used during e2e tests by tweaking +## the version numbers in these rules. http_archive( name = "helm_darwin", sha256 = "7c4e6bfbc211d6b984ffb4fa490ce9ac112cc4b9b8d859ece27045b8514c1ed1", @@ -107,6 +109,13 @@ filegroup( """, ) +container_pull( + name = "io_gcr_helm_tiller", + registry = "gcr.io", + repository = "kubernetes-helm/tiller", + tag = "v2.10.0", +) + ## Install 'kind', for creating kubernetes-in-docker clusters go_repository( name = "io_kubernetes_sigs_kind", @@ -114,7 +123,9 @@ go_repository( importpath = "sigs.k8s.io/kind", ) -## Fetch pebble, for use during e2e tests +## Fetch pebble for use during e2e tests +## You can change the version of Pebble used for tests by changing the 'commit' +## field in this rule go_repository( name = "org_letsencrypt_pebble", commit = "2132a88193fdf0d7c0d93c33fce61db43d630fd4", @@ -124,6 +135,33 @@ go_repository( patch_cmds = ["sed -i -e 's/private/public/g' 'cmd/pebble/BUILD.bazel'"], ) +## Fetch nginx-ingress for use during e2e tests +## You can change the version of nginx-ingress used for tests by changing the +## 'tag' field in this rule +container_pull( + name = "io_kubernetes_ingress-nginx", + registry = "quay.io", + repository = "kubernetes-ingress-controller/nginx-ingress-controller", + tag = "0.21.0", +) + +container_pull( + name = "io_gcr_k8s_defaultbackend", + registry = "k8s.gcr.io", + repository = "defaultbackend", + tag = "1.4", +) + +## Fetch vault for use during e2e tests +## You can change the version of vault used for tests by changing the 'tag' +## field in this rule +container_pull( + name = "com_hashicorp_vault", + registry = "index.docker.io", + repository = "library/vault", + tag = "0.9.3", +) + ## Install buildozer, for mass-editing BUILD files http_file( name = "buildozer_darwin", diff --git a/hack/ci/lib/build_images.sh b/hack/ci/lib/build_images.sh index 7e9e72cae..70a6fad71 100755 --- a/hack/ci/lib/build_images.sh +++ b/hack/ci/lib/build_images.sh @@ -43,6 +43,10 @@ build_images() { "${DOCKER_REPO}"/cert-manager-acmesolver:"${DOCKER_TAG}" \ "${DOCKER_REPO}"/cert-manager-webhook:"${DOCKER_TAG}" \ "pebble:bazel" \ + "quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.21.0" \ + "k8s.gcr.io/defaultbackend:bazel" \ + "vault:bazel" \ + "gcr.io/kubernetes-helm/tiller:bazel" \ -o "${BUNDLE_FILE}" # Copy docker archive into the kind container diff --git a/test/e2e/charts/BUILD.bazel b/test/e2e/charts/BUILD.bazel index b2752e302..39ec57c80 100644 --- a/test/e2e/charts/BUILD.bazel +++ b/test/e2e/charts/BUILD.bazel @@ -5,5 +5,9 @@ container_bundle( images = { # A set of images to bundle up into a single tarball. "pebble:bazel": "//test/e2e/charts/pebble:image", + "quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.21.0": "@io_kubernetes_ingress-nginx//image", + "k8s.gcr.io/defaultbackend:bazel": "@io_gcr_k8s_defaultbackend//image", + "vault:bazel": "@com_hashicorp_vault//image", + "gcr.io/kubernetes-helm/tiller:bazel": "@io_gcr_helm_tiller//image", } ) diff --git a/test/e2e/charts/pebble/values.yaml b/test/e2e/charts/pebble/values.yaml index 904c67577..088beac49 100644 --- a/test/e2e/charts/pebble/values.yaml +++ b/test/e2e/charts/pebble/values.yaml @@ -2,7 +2,7 @@ replicaCount: 1 image: repository: pebble tag: "bazel" - pullPolicy: IfNotPresent + pullPolicy: Never service: type: ClusterIP resources: diff --git a/test/e2e/charts/vault/templates/vault-deployment.yaml b/test/e2e/charts/vault/templates/vault-deployment.yaml index e4bdea461..fbb319975 100644 --- a/test/e2e/charts/vault/templates/vault-deployment.yaml +++ b/test/e2e/charts/vault/templates/vault-deployment.yaml @@ -18,6 +18,7 @@ spec: containers: - name: vault image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: Never command: ["vault", "server", "-dev", "-dev-listen-address=[::]:8202", "-config", "/vault/config/config.json"] # command: ["/bin/sh", "-c", "sleep 9999"] ports: diff --git a/test/e2e/charts/vault/values.yaml b/test/e2e/charts/vault/values.yaml index 4e7dcad17..94b180213 100644 --- a/test/e2e/charts/vault/values.yaml +++ b/test/e2e/charts/vault/values.yaml @@ -1,6 +1,6 @@ image: repository: vault - tag: "0.9.3" + tag: "bazel" vault: publicKey: diff --git a/test/e2e/framework/addon/nginxingress/nginx.go b/test/e2e/framework/addon/nginxingress/nginx.go index 525476937..176920dee 100644 --- a/test/e2e/framework/addon/nginxingress/nginx.go +++ b/test/e2e/framework/addon/nginxingress/nginx.go @@ -94,6 +94,22 @@ func (n *Nginx) Setup(cfg *config.Config) error { ChartName: "stable/nginx-ingress", ChartVersion: cfg.Addons.Nginx.ChartVersion, Vars: []chart.StringTuple{ + { + Key: "controller.image.pullPolicy", + Value: "Never", + }, + { + Key: "controller.image.tag", + Value: "0.21.0", + }, + { + Key: "defaultBackend.image.pullPolicy", + Value: "Never", + }, + { + Key: "defaultBackend.image.tag", + Value: "bazel", + }, { Key: "controller.service.clusterIP", Value: n.IPAddress, diff --git a/test/e2e/framework/config/tiller.go b/test/e2e/framework/config/tiller.go index a20d3f2a9..e1d92f0fd 100644 --- a/test/e2e/framework/config/tiller.go +++ b/test/e2e/framework/config/tiller.go @@ -31,7 +31,7 @@ type Tiller struct { func (n *Tiller) AddFlags(fs *flag.FlagSet) { fs.StringVar(&n.ImageRepo, "tiller-image-repo", "gcr.io/kubernetes-helm/tiller", "docker image repo for tiller-deploy") - fs.StringVar(&n.ImageTag, "tiller-image-tag", "v2.11.0", "docker image tag for tiller-deploy") + fs.StringVar(&n.ImageTag, "tiller-image-tag", "bazel", "docker image tag for tiller-deploy") } func (n *Tiller) Validate() []error {