create cluster config
This commit is contained in:
parent
054ed49110
commit
8d0ed4c3f8
2 changed files with 36 additions and 20 deletions
|
@ -17,7 +17,7 @@ services:
|
||||||
matrix:
|
matrix:
|
||||||
k8s:
|
k8s:
|
||||||
# from https://hub.docker.com/r/kindest/node/tags
|
# from https://hub.docker.com/r/kindest/node/tags
|
||||||
# - v1.25.3 # renovate: kindest
|
# - v1.25.3 # renovate: kindest
|
||||||
- v1.26.2 # renovate: kindest
|
- v1.26.2 # renovate: kindest
|
||||||
|
|
||||||
pipeline:
|
pipeline:
|
||||||
|
@ -29,15 +29,14 @@ pipeline:
|
||||||
commands:
|
commands:
|
||||||
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/community docker-cli kind
|
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/community docker-cli kind
|
||||||
- export KUBECONFIG=$${CI_WORKSPACE}/kube.config
|
- export KUBECONFIG=$${CI_WORKSPACE}/kube.config
|
||||||
- sleep 30s
|
- sleep 15s
|
||||||
- docker info
|
- docker info
|
||||||
- kind create cluster --help
|
- kind create cluster --help
|
||||||
- kind create cluster --name chart-testing --image kindest/node:${k8s} --wait 60s
|
- kind create cluster --config e2e/kind.cluster.yml --image kindest/node:${k8s} --wait 1m
|
||||||
- kind get clusters
|
- kind get clusters
|
||||||
- docker ps
|
- docker ps
|
||||||
- docker network ls
|
#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
|
||||||
- docker inspect chart-testing-control-plane
|
- sed -i -E -e 's/localhost|0\.0\.0\.0/'docker'/g' $${KUBECONFIG}
|
||||||
|
|
||||||
|
|
||||||
chart-testing:
|
chart-testing:
|
||||||
image: alpine:3.17.2
|
image: alpine:3.17.2
|
||||||
|
@ -48,17 +47,17 @@ pipeline:
|
||||||
- export KUBECONFIG=$${CI_WORKSPACE}/kube.config
|
- export KUBECONFIG=$${CI_WORKSPACE}/kube.config
|
||||||
- kubectl get no -o wide
|
- kubectl get no -o wide
|
||||||
|
|
||||||
delete-cluster:
|
# delete-cluster:
|
||||||
image: alpine:3.17.2
|
# image: alpine:3.17.2
|
||||||
pull: true
|
# pull: true
|
||||||
environment:
|
# environment:
|
||||||
DOCKER_HOST: tcp://docker:2375
|
# DOCKER_HOST: tcp://docker:2375
|
||||||
commands:
|
# commands:
|
||||||
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/community docker-cli kind
|
# - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/community docker-cli kind
|
||||||
- export KUBECONFIG=$${CI_WORKSPACE}/kube.config
|
# - export KUBECONFIG=$${CI_WORKSPACE}/kube.config
|
||||||
- kind delete cluster --name chart-testing
|
# - kind delete cluster --name chart-testing
|
||||||
- docker ps
|
# - docker ps
|
||||||
when:
|
# when:
|
||||||
status:
|
# status:
|
||||||
- success
|
# - success
|
||||||
- failure
|
# - failure
|
||||||
|
|
17
e2e/kind-cluster.yml
Normal file
17
e2e/kind-cluster.yml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# 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
|
Loading…
Reference in a new issue