Skip to content

Commit

Permalink
Add GCE DinD based CI test job for IPv6
Browse files Browse the repository at this point in the history
This change adds a CI test job for testing Kubernetes IPv6-only functionality.
This CI test uses deployment scripts from the Mirantis/kubeadm-dind-cluster
github repo to set up a containerized (Docker-in-Docker) Kubernetes
cluster that is running on a GCE instance. (A containerized environment
is needed because GCE does not support IPv6 connectivity between GCE
instances.

Note that when the kubeadm-dind-cluster scripts are used to spin up
a Kubernetes cluster in IPv6 mode, it will create the following
container on the GCE instance:
- bind9 container that performs DNS64 functionality
- tayga container that performs NAT64 functionality
- kube-master node container
- kube-node-1 node container
- kube-node-2 node container

NOTE: Unit tests for gce_dind.go will be coming shortly.
  • Loading branch information
Dane LeBlanc committed Apr 3, 2018
1 parent 29691e3 commit fe37505
Show file tree
Hide file tree
Showing 7 changed files with 756 additions and 0 deletions.
38 changes: 38 additions & 0 deletions images/gce-dind/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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.

FROM gcr.io/k8s-testimages/kubekins-e2e:v20180102-0e2b24a0b-master
LABEL maintainer "leblancd@cisco.com"

# add env we can debug with the image name:tag
ARG IMAGE_ARG
ENV IMAGE=${IMAGE_ARG}

RUN apt-get update && apt-get install -y \
git \
wget \
liblz4-1 && \
apt-get clean

# Install kubeadm-dind-cluster scripts
RUN cd /root && \
git clone -b k8s_ipv6_ci https://github.com/leblancd/kubeadm-dind-cluster.git

# Install docker-machine
RUN curl -L https://github.com/docker/machine/releases/download/v0.13.0/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine && install /tmp/docker-machine /usr/local/bin/docker-machine

ENV SHELL bash
WORKDIR /workspace
ADD runner /
ENTRYPOINT ["/bin/bash", "/runner"]
25 changes: 25 additions & 0 deletions images/gce-dind/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2017 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.

VERSION = $(shell date +v%Y%m%d)-$(shell git describe --tags --always --dirty)

IMG = "gcr.io/k8s-testimages/e2e-gce-dind"

image:
docker build --no-cache -t "$(IMG):$(VERSION)" --build-arg "IMAGE_ARG=$(IMG):$(VERSION)" .

push: image
gcloud docker -- push "$(IMG):$(VERSION)"

.PHONY: image push
27 changes: 27 additions & 0 deletions images/gce-dind/runner
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Copyright 2017 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.

set -o errexit
set -o nounset
set -o pipefail

if [ ! -e test-infra ]; then
git clone https://github.com/kubernetes/test-infra
fi

./test-infra/jenkins/bootstrap.py \
--job="${JOB_NAME}" \
--service-account="${GOOGLE_APPLICATION_CREDENTIALS}" \
"$@"
23 changes: 23 additions & 0 deletions jobs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11500,6 +11500,29 @@
"sig-cluster-lifecycle"
]
},
"pull-kubernetes-e2e-gce-dind-ipv6": {
"args": [
"--cluster=",
"--deployment=gce-dind",
"--env-file=jobs/platform/gce.env",
"--gcp-zone=us-central1-f",
"--ginkgo-parallel=30",
"--gce-dind-scripts-path=/root/kubeadm-dind-cluster",
"--gce-dind-image=rpothier/kubeadm-dind-cluster:k8s-1.10",
"--gce-dind-build-kubeadm=true",
"--gce-dind-build-hyperkube=true",
"--gce-dind-ipv6-only=true",
"--gce-dind-num-nodes=2",
"--gce-dind-dump-cluster-logs=true",
"--provider=gce",
"--test_args=--ginkgo.focus=Networking|Services --ginkgo.skip=IPv4|Networking-Performance|Federation|preserve\ssource\spod|session\saffinity:\sudp|functioning\sNodePort --num-nodes=2 --minStartupPods=8",
"--timeout=55m"
],
"scenario": "kubernetes_e2e",
"sigOwners": [
"sig-network"
]
},
"pull-kubernetes-integration": {
"args": [
"--branch=${PULL_BASE_REF}",
Expand Down
Loading

0 comments on commit fe37505

Please sign in to comment.