From e03a68f8eb8a9939b9ccabbf8b4038c1d7adaec2 Mon Sep 17 00:00:00 2001 From: Spencer Smith Date: Tue, 9 Jun 2020 20:25:47 -0400 Subject: [PATCH] feat: update k8s and sonobuoy versions This PR will update k8s to the latest 1.18 release and bump sonobuoy to help resolve some e2e flakes. Also adds some retry logic around the sonobuoy run. Signed-off-by: Spencer Smith --- Makefile | 4 ++-- docs/talosctl/talosctl_cluster_create.md | 2 +- docs/talosctl/talosctl_gen_config.md | 2 +- docs/website/content/v0.4/en/configuration/v1alpha1.md | 2 +- hack/test/capi/cluster-aws.yaml | 8 ++++---- hack/test/capi/cluster-gcp.yaml | 8 ++++---- hack/test/e2e.sh | 9 +++++++-- hack/test/libvirt/libvirt.sh | 2 +- pkg/config/types/v1alpha1/doc.go | 2 +- pkg/constants/constants.go | 2 +- 10 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index a0ee98237..9f91f262a 100644 --- a/Makefile +++ b/Makefile @@ -13,10 +13,10 @@ OPERATING_SYSTEM := $(shell uname -s | tr "[:upper:]" "[:lower:]") OSCTL_DEFAULT_TARGET := talosctl-$(OPERATING_SYSTEM) INTEGRATION_TEST_DEFAULT_TARGET := integration-test-$(OPERATING_SYSTEM) INTEGRATION_TEST_PROVISION_DEFAULT_TARGET := integration-test-provision-$(OPERATING_SYSTEM) -KUBECTL_URL ?= https://storage.googleapis.com/kubernetes-release/release/v1.18.0/bin/$(OPERATING_SYSTEM)/amd64/kubectl +KUBECTL_URL ?= https://storage.googleapis.com/kubernetes-release/release/v1.18.3/bin/$(OPERATING_SYSTEM)/amd64/kubectl CLUSTERCTL_VERSION ?= 0.3.5 CLUSTERCTL_URL ?= https://github.com/kubernetes-sigs/cluster-api/releases/download/v$(CLUSTERCTL_VERSION)/clusterctl-$(OPERATING_SYSTEM)-amd64 -SONOBUOY_VERSION ?= 0.18.0 +SONOBUOY_VERSION ?= 0.18.2 SONOBUOY_URL ?= https://github.com/heptio/sonobuoy/releases/download/v$(SONOBUOY_VERSION)/sonobuoy_$(SONOBUOY_VERSION)_$(OPERATING_SYSTEM)_amd64.tar.gz TESTPKGS ?= ./... RELEASES ?= v0.5.0 v0.6.0-alpha.1 diff --git a/docs/talosctl/talosctl_cluster_create.md b/docs/talosctl/talosctl_cluster_create.md index 9af6ff399..4ef59f2cd 100644 --- a/docs/talosctl/talosctl_cluster_create.md +++ b/docs/talosctl/talosctl_cluster_create.md @@ -28,7 +28,7 @@ talosctl cluster create [flags] --initrd-path string the uncompressed kernel image to use (default "_out/initramfs.xz") -i, --input-dir string location of pre-generated config files --install-image string the installer image to use (default "docker.io/autonomy/installer:latest") - --kubernetes-version string desired kubernetes version to run (default "1.18.0") + --kubernetes-version string desired kubernetes version to run (default "1.18.3") --masters int the number of masters to create (default 1) --memory int the limit on memory usage in MB (each container) (default 1024) --mtu int MTU of the docker bridge network (default 1500) diff --git a/docs/talosctl/talosctl_gen_config.md b/docs/talosctl/talosctl_gen_config.md index a2cf59749..207b12d0f 100644 --- a/docs/talosctl/talosctl_gen_config.md +++ b/docs/talosctl/talosctl_gen_config.md @@ -22,7 +22,7 @@ talosctl gen config [flags] -h, --help help for config --install-disk string the disk to install to (default "/dev/sda") --install-image string the image used to perform an installation (default "docker.io/autonomy/installer:latest") - --kubernetes-version string desired kubernetes version to run (default "1.18.0") + --kubernetes-version string desired kubernetes version to run (default "1.18.3") -o, --output-dir string destination to output generated files --registry-mirror strings list of registry mirrors to use in format: = --version string the desired machine config version to generate (default "v1alpha1") diff --git a/docs/website/content/v0.4/en/configuration/v1alpha1.md b/docs/website/content/v0.4/en/configuration/v1alpha1.md index bed0e2212..810e0b10b 100644 --- a/docs/website/content/v0.4/en/configuration/v1alpha1.md +++ b/docs/website/content/v0.4/en/configuration/v1alpha1.md @@ -35,7 +35,7 @@ machine: force: false cluster: controlPlane: - version: 1.18.0 + version: 1.18.3 endpoint: https://1.2.3.4 clusterName: example network: diff --git a/hack/test/capi/cluster-aws.yaml b/hack/test/capi/cluster-aws.yaml index 06cec470a..894d69100 100644 --- a/hack/test/capi/cluster-aws.yaml +++ b/hack/test/capi/cluster-aws.yaml @@ -59,7 +59,7 @@ spec: kind: AWSMachine name: talos-e2e-{{TAG}}-aws-controlplane-0 namespace: default - version: 1.18.0 + version: 1.18.3 --- apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 kind: AWSMachine @@ -112,7 +112,7 @@ spec: kind: AWSMachine name: talos-e2e-{{TAG}}-aws-controlplane-1 namespace: default - version: 1.18.0 + version: 1.18.3 --- apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 kind: AWSMachine @@ -165,7 +165,7 @@ spec: kind: AWSMachine name: talos-e2e-{{TAG}}-aws-controlplane-2 namespace: default - version: 1.18.0 + version: 1.18.3 --- apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 kind: AWSMachine @@ -232,7 +232,7 @@ spec: kind: AWSMachineTemplate name: talos-e2e-{{TAG}}-aws-workers namespace: default - version: 1.18.0 + version: 1.18.3 --- apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 kind: AWSMachineTemplate diff --git a/hack/test/capi/cluster-gcp.yaml b/hack/test/capi/cluster-gcp.yaml index 2edaeb440..cff4697d3 100644 --- a/hack/test/capi/cluster-gcp.yaml +++ b/hack/test/capi/cluster-gcp.yaml @@ -58,7 +58,7 @@ spec: kind: GCPMachine name: talos-e2e-{{TAG}}-gcp-controlplane-0 namespace: default - version: 1.18.0 + version: 1.18.3 --- apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 kind: GCPMachine @@ -105,7 +105,7 @@ spec: kind: GCPMachine name: talos-e2e-{{TAG}}-gcp-controlplane-1 namespace: default - version: 1.18.0 + version: 1.18.3 --- apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 kind: GCPMachine @@ -152,7 +152,7 @@ spec: kind: GCPMachine name: talos-e2e-{{TAG}}-gcp-controlplane-2 namespace: default - version: 1.18.0 + version: 1.18.3 --- apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 kind: GCPMachine @@ -212,7 +212,7 @@ spec: kind: GCPMachineTemplate name: talos-e2e-{{TAG}}-gcp-workers namespace: default - version: 1.18.0 + version: 1.18.3 --- apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 kind: GCPMachineTemplate diff --git a/hack/test/e2e.sh b/hack/test/e2e.sh index 06b7325fb..b308cac09 100755 --- a/hack/test/e2e.sh +++ b/hack/test/e2e.sh @@ -102,12 +102,17 @@ function run_talos_integration_test_docker { } function run_kubernetes_integration_test { - ${SONOBUOY} run \ + timeout=$(($(date +%s) + ${TIMEOUT})) + until ${SONOBUOY} run \ --kubeconfig ${KUBECONFIG} \ --wait \ --skip-preflight \ --plugin e2e \ - --mode ${SONOBUOY_MODE} + --mode ${SONOBUOY_MODE}; do + [[ $(date +%s) -gt $timeout ]] && exit 1 + echo "attempting to run sonobuoy" + sleep 10 + done ${SONOBUOY} status --kubeconfig ${KUBECONFIG} --json | jq . | tee ${TMP}/sonobuoy-status.json if [ $(cat ${TMP}/sonobuoy-status.json | jq -r '.plugins[] | select(.plugin == "e2e") | ."result-status"') != 'passed' ]; then exit 1; fi } diff --git a/hack/test/libvirt/libvirt.sh b/hack/test/libvirt/libvirt.sh index b3dee4309..005fdd506 100755 --- a/hack/test/libvirt/libvirt.sh +++ b/hack/test/libvirt/libvirt.sh @@ -81,7 +81,7 @@ function down { } function workspace { - docker run --rm -it -v $PWD:/workspace -v $PWD/../../../${ARTIFACTS}/talosctl-linux-amd64:/bin/talosctl:ro --network talos --dns 172.28.1.1 -w /workspace/matchbox/assets -e TALOSCONFIG='/workspace/matchbox/assets/talosconfig' -e KUBECONFIG='/workspace/matchbox/assets/kubeconfig' --entrypoint /bin/bash k8s.gcr.io/hyperkube:v1.18.0 + docker run --rm -it -v $PWD:/workspace -v $PWD/../../../${ARTIFACTS}/talosctl-linux-amd64:/bin/talosctl:ro --network talos --dns 172.28.1.1 -w /workspace/matchbox/assets -e TALOSCONFIG='/workspace/matchbox/assets/talosconfig' -e KUBECONFIG='/workspace/matchbox/assets/kubeconfig' --entrypoint /bin/bash k8s.gcr.io/hyperkube:v1.18.3 } main $@ diff --git a/pkg/config/types/v1alpha1/doc.go b/pkg/config/types/v1alpha1/doc.go index 551feecad..347601ad7 100644 --- a/pkg/config/types/v1alpha1/doc.go +++ b/pkg/config/types/v1alpha1/doc.go @@ -34,7 +34,7 @@ machine: force: false cluster: controlPlane: - version: 1.18.0 + version: 1.18.3 endpoint: https://1.2.3.4 clusterName: example network: diff --git a/pkg/constants/constants.go b/pkg/constants/constants.go index e8bca8363..2e6e64cfa 100644 --- a/pkg/constants/constants.go +++ b/pkg/constants/constants.go @@ -139,7 +139,7 @@ const ( KubeletBootstrapKubeconfig = "/etc/kubernetes/bootstrap-kubeconfig" // DefaultKubernetesVersion is the default target version of the control plane. - DefaultKubernetesVersion = "1.18.0" + DefaultKubernetesVersion = "1.18.3" // KubernetesImage is the enforced hyperkube image to use for the control plane. KubernetesImage = "k8s.gcr.io/hyperkube"