From 965993406379df2a26de730a6c6e5be999e67f27 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Wed, 22 Mar 2023 10:04:04 +0100 Subject: [PATCH] fixes --- .woodpecker/e2e.yml | 18 +----------------- e2e/kind-cluster.yml | 17 ----------------- e2e/kind.cluster.yml | 20 ++++++++++++++++++++ 3 files changed, 21 insertions(+), 34 deletions(-) delete mode 100644 e2e/kind-cluster.yml create mode 100644 e2e/kind.cluster.yml diff --git a/.woodpecker/e2e.yml b/.woodpecker/e2e.yml index 38f2a44..e3a36f3 100644 --- a/.woodpecker/e2e.yml +++ b/.woodpecker/e2e.yml @@ -31,12 +31,11 @@ pipeline: - export KUBECONFIG=$${CI_WORKSPACE}/kube.config - sleep 15s - docker info - - kind create cluster --help - kind create cluster --config e2e/kind.cluster.yml --image kindest/node:${k8s} --wait 1m - kind get clusters - docker ps #replace localhost or 0.0.0.0 in the kubeconfig file with "docker", in order to be able to reach the cluster through the docker service - - sed -i -E -e 's/localhost|0\.0\.0\.0/'docker'/g' $${KUBECONFIG} + - sed -i -E -e 's/localhost|0\.0\.0\.0/docker/g' $${KUBECONFIG} chart-testing: image: alpine:3.17.2 @@ -46,18 +45,3 @@ pipeline: - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing kubectl - export KUBECONFIG=$${CI_WORKSPACE}/kube.config - kubectl get no -o wide - - # delete-cluster: - # image: alpine:3.17.2 - # pull: true - # environment: - # DOCKER_HOST: tcp://docker:2375 - # commands: - # - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/community docker-cli kind - # - export KUBECONFIG=$${CI_WORKSPACE}/kube.config - # - kind delete cluster --name chart-testing - # - docker ps - # when: - # status: - # - success - # - failure diff --git a/e2e/kind-cluster.yml b/e2e/kind-cluster.yml deleted file mode 100644 index 3261f26..0000000 --- a/e2e/kind-cluster.yml +++ /dev/null @@ -1,17 +0,0 @@ -# based on https://github.com/kind-ci/examples/blob/master/drone/.drone.yml -apiVersion: kind.x-k8s.io/v1alpha4 -kind: Cluster -name: chart-testing -networking: - apiServerAddress: "0.0.0.0" - -nodes: -# add to the apiServer certSANs the name of the drone service in order to be able to reach the cluster through it -- role: control-plane - kubeadmConfigPatches: - - | - kind: ClusterConfiguration - apiServer: - certSANs: - - "docker" -- role: worker \ No newline at end of file diff --git a/e2e/kind.cluster.yml b/e2e/kind.cluster.yml new file mode 100644 index 0000000..456fbe2 --- /dev/null +++ b/e2e/kind.cluster.yml @@ -0,0 +1,20 @@ +# based on https://github.com/kind-ci/examples/blob/master/.gitlab-ci.yml +apiVersion: kind.x-k8s.io/v1alpha4 +kind: Cluster +name: chart-testing +networking: + apiServerAddress: '0.0.0.0' + +# add to the apiServer certSANs the name of the docker (dind) service in order to be able to reach the cluster through it +kubeadmConfigPatchesJSON6902: + - group: kubeadm.k8s.io + version: v1beta2 + kind: ClusterConfiguration + patch: | + - op: add + path: /apiServer/certSANs/- + value: docker + +nodes: + - role: control-plane + - role: worker