-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Add github action to run e2e test with kubernetes cluster.
Signed-off-by: Lan Liang <[email protected]>
- Loading branch information
1 parent
75e51f4
commit 24babde
Showing
5 changed files
with
152 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
ARG K8S_VERSION | ||
|
||
FROM kindest/node:${K8S_VERSION} | ||
|
||
RUN mkdir /tmp/kind | ||
COPY xline.tar /tmp/kind/ | ||
RUN ( containerd -l warning & ) && ctr -n k8s.io images import --no-unpack /tmp/kind/*.tar | ||
RUN rm /tmp/kind/*.tar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
nodes: | ||
- role: control-plane | ||
image: ghcr.io/xline-kv/kind-node-xline:${K8S_VERSION}-master | ||
extraMounts: | ||
- hostPath: ${WORKSPACE}/ci/artifacts/xline-pod.yaml | ||
containerPath: /etc/kubernetes/manifests/xline.yaml | ||
kubeadmConfigPatches: | ||
- | | ||
kind: ClusterConfiguration | ||
etcd: | ||
external: | ||
endpoints: | ||
- http://kind-control-plane:2379 | ||
- role: worker | ||
image: ghcr.io/xline-kv/kind-node-xline:${K8S_VERSION}-master | ||
- role: worker | ||
image: ghcr.io/xline-kv/kind-node-xline:${K8S_VERSION}-master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
creationTimestamp: null | ||
name: xline | ||
namespace: kube-system | ||
spec: | ||
containers: | ||
- name: xline | ||
image: ghcr.io/xline-kv/xline:master | ||
imagePullPolicy: IfNotPresent | ||
command: | ||
- /bin/sh | ||
- -c | ||
- xline --name node1 --members node1=kind-control-plane:2379 --data-dir /tmp/xline --storage-engine rocksdb --client-listen-urls=http://kind-control-plane:2379 --peer-listen-urls=http://kind-control-plane:2380,http://kind-control-plane:2381 --client-advertise-urls=http://kind-control-plane:2379 --peer-advertise-urls=http://kind-control-plane:2380,http://kind-control-plane:2381 | ||
hostNetwork: true | ||
status: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
K8S_VERSION=${K8S_VERSION:-"v1.27.3"} | ||
KIND_VERSION=${KIND_VERSION:-"0.22.0"} | ||
|
||
wget -q https://github.com/kubernetes-sigs/kind/releases/download/v$KIND_VERSION/kind-linux-amd64 | ||
chmod +x kind-linux-amd64 && mv kind-linux-amd64 /usr/local/bin/kind | ||
|
||
# print the config file | ||
WORKSPACE=$PWD envsubst | ||
|
||
WORKSPACE=$PWD envsubst < ci/artifacts/kind.yaml | kind create cluster -v7 --retain --wait 4m --config - | ||
kubectl wait node --all --for condition=ready |