Skip to content

Commit

Permalink
Use Bazel images for nginx-ingress, vault and tiller
Browse files Browse the repository at this point in the history
Signed-off-by: James Munnelly <james@munnelly.eu>
  • Loading branch information
munnerz committed Jan 11, 2019
1 parent e9b735d commit ec87b60
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 6 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
42 changes: 40 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -107,14 +109,23 @@ 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",
commit = "e0e26dae2dab662a3d06756ed668f47b2a0515cc",
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",
Expand All @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions hack/ci/lib/build_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/charts/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
)
2 changes: 1 addition & 1 deletion test/e2e/charts/pebble/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ replicaCount: 1
image:
repository: pebble
tag: "bazel"
pullPolicy: IfNotPresent
pullPolicy: Never
service:
type: ClusterIP
resources:
Expand Down
1 change: 1 addition & 0 deletions test/e2e/charts/vault/templates/vault-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/charts/vault/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
image:
repository: vault
tag: "0.9.3"
tag: "bazel"

vault:
publicKey:
Expand Down
16 changes: 16 additions & 0 deletions test/e2e/framework/addon/nginxingress/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/framework/config/tiller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ec87b60

Please sign in to comment.