Rename legacy minikube e2e testing script

Also tidy up kind e2e testing script

Signed-off-by: James Munnelly <james@munnelly.eu>
This commit is contained in:
James Munnelly 2018-09-07 23:24:51 +01:00
parent 5005c1723b
commit c6bd3902b9
3 changed files with 12 additions and 92 deletions

View File

@ -41,17 +41,11 @@ trap cleanup EXIT
# deploy_kind will deploy a kubernetes-in-docker cluster
deploy_kind() {
local KIND_CONFIG="kind-config.yaml"
if [ ! -z "${KIND_KUBEADM_1_11_FORCE:-}" ]; then
KIND_CONFIG="kind-config-force.yaml"
fi
# create the kind cluster
kind create \
--name="${KIND_CLUSTER_NAME}" \
--image="${KIND_IMAGE}" \
--config "${REPO_ROOT}"/test/fixtures/"${KIND_CONFIG}"
--config "${REPO_ROOT}"/test/fixtures/kind-config.yaml
export KUBECONFIG="${HOME}/.kube/kind-config-${KIND_CLUSTER_NAME}"

View File

@ -14,8 +14,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
## This file is a stop gap whilst we migrate the Makefile to better
## supprt prow for our testing
# This file is the entrypoint to our legacy minikube e2e testing environment
# for cert-manager. It is currently used to run e2e test jobs against a
# 1.9 or lower minikube built cluster.
# This script should not be used for anything except for our CI process.
set -o errexit
set -o nounset
set -o pipefail
@ -28,36 +31,12 @@ echo "Waiting for minikube cluster to be ready..."
while true; do if kubectl get nodes; then break; fi; echo "Waiting 5s for kubernetes to be ready..."; sleep 5; done
echo "Installing helm with cluster-admin privileges..."
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: List
items:
### Tiller ###
# Create a ServiceAccount for tiller to use
- apiVersion: v1
kind: ServiceAccount
metadata:
name: tiller
namespace: kube-system
# Bind tiller to the cluster-admin role
- apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: "tiller"
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: "cluster-admin"
subjects:
- apiGroup: ""
kind: ServiceAccount
name: tiller
namespace: kube-system
EOF
helm init --service-account=tiller
# Install tiller with admin permissions
kubectl create serviceaccount -n kube-system tiller
# Bind the tiller service account to the cluster-admin role
kubectl create clusterrolebinding tiller-binding --clusterrole=cluster-admin --serviceaccount kube-system:tiller
# Deploy tiller
helm init --service-account tiller --wait
echo "Exposing nginx-ingress service with a stable IP (10.0.0.15)"
# Setup service for nginx ingress controller. A DNS entry for *.certmanager.kubernetes.network has been setup to point to 10.0.0.15 for e2e tests

View File

@ -1,53 +0,0 @@
# this config is a copy of kind-config.yaml, but with an additional lifecycle
# hook that downloads kubeadm 1.11.2 which is able to bootstrap kubernetes 1.10
# clusters needed during tests.
#
# this config file is similar to the default, except we set the cluster's
# service cidr range to be 10.0.0.0/16.
# we do this because we need a fixed/predictable clusterIP of 10.0.0.15 for the
# nginx-ingress service, in order to perform HTTP01 validations during tests.
apiVersion: kind.sigs.k8s.io/v1alpha1
kind: Config
# number of nodes in the cluster (currently only 1 is supported)
numNodes: 1
# template for kubeadm config, "" -> the default template
kubeadmConfigTemplate: |
# config generated by kind
apiVersion: kubeadm.k8s.io/v1alpha2
kind: MasterConfiguration
clusterName: {{.ClusterName}}
# on docker for mac we have to expose the api server via port forward,
# so we need to ensure the cert is valid for localhost so we can talk
# to the cluster after rewriting the kubeconfig to point to localhost
apiServerCertSANs: [localhost]
kubernetesVersion: {{.KubernetesVersion}}
{{if ne .UnifiedControlPlaneImage ""}}
# optionally specify a unified control plane image
unifiedControlPlaneImage: {{.UnifiedControlPlaneImage}}:{{.DockerStableTag}}
{{end}}
networking:
# Don't think setting pod subnet is currently required
# podSubnet: ""
serviceSubnet: 10.0.0.0/16
kubeletConfiguration:
baseConfig:
clusterDNS:
- 10.0.0.10
nodeLifecycle:
preKubeadm:
# we download kubeadm 1.11.x here manually as earlier version of kubeadm do
# not support the kubeadm MasterConfiguration structure
- name: download kubeadm 1.11.2
mustSucceed: true
command:
- /bin/bash
- -c
- |
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
curl -o /usr/bin/kubeadm https://storage.googleapis.com/kubernetes-release/release/v1.11.2/bin/linux/amd64/kubeadm
chmod +x /usr/bin/kubeadm