Skip to content

Commit

Permalink
Fix github action e2e test.
Browse files Browse the repository at this point in the history
Signed-off-by: Lan Liang <gcslyp@gmail.com>
  • Loading branch information
liangyuanpeng committed Jan 17, 2024
1 parent eeb0c89 commit 25677da
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 31 deletions.
35 changes: 6 additions & 29 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
docker build -t gcr.io/k8s-staging-kas-network-proxy/proxy-agent:master -f artifacts/images/agent-build.Dockerfile .
docker save gcr.io/k8s-staging-kas-network-proxy/proxy-agent:master > _output/konnectivity-agent.tar
docker build -t gcr.io/k8s-staging-kas-network-proxy/proxy-server:master -f artifacts/images/server-build.Dockerfile .
docker save gcr.io/k8s-staging-kas-network-proxy/proxy-server:master > > _output/konnectivity-server.tar
docker save gcr.io/k8s-staging-kas-network-proxy/proxy-server:master > _output/konnectivity-server.tar
- uses: actions/upload-artifact@v2
with:
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
# kubectl
curl -L https://dl.k8s.io/${{ env.K8S_VERSION }}/bin/linux/amd64/kubectl -o ${TMP_DIR}/kubectl
# kind
curl -Lo ${TMP_DIR}/kind https://kind.sigs.k8s.io/dl/v0.17.0/kind-linux-amd64
curl -Lo ${TMP_DIR}/kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64
# Install
sudo cp ${TMP_DIR}/ginkgo /usr/local/bin/ginkgo
sudo cp ${TMP_DIR}/e2e.test /usr/local/bin/e2e.test
Expand All @@ -93,35 +93,12 @@ jobs:
# output_dir
mkdir -p _artifacts
# create cluster
cat <<EOF | /usr/local/bin/kind create cluster \
sed -i 's/IP_FAMILY/'${IP_FAMILY}'/g' examples/kind/kind.config
sed -i 's#EGREE_SELECTOR_CONFIGURATION_PATH#./examples/kind/egress_selector_configuration.yaml#g' examples/kind/kind.config
/usr/local/bin/kind create cluster \
--name ${{ env.KIND_CLUSTER_NAME}} \
--image kindest/node:${{ env.K8S_VERSION }} \
-v7 --wait 1m --retain --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
networking:
ipFamily: ${IP_FAMILY}
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
kind: ClusterConfiguration
apiServer:
extraArgs:
"egress-selector-config-file": "/etc/kubernetes/konnectivity-server-config/egress_selector_configuration.yaml"
extraVolumes:
- name: egress-selector-config-file
hostPath: "/etc/kubernetes/konnectivity-server-config/egress_selector_configuration.yaml"
mountPath: "/etc/kubernetes/konnectivity-server-config/egress_selector_configuration.yaml"
readOnly: true
- name: konnectivity-server
hostPath: "/etc/kubernetes/konnectivity-server"
mountPath: "/etc/kubernetes/konnectivity-server"
readOnly: true
extraMounts:
- hostPath: ./examples/kind/egress_selector_configuration.yaml
containerPath: /etc/kubernetes/konnectivity-server-config/egress_selector_configuration.yaml
EOF
-v7 --wait 1m --retain --config=examples/kind/kind.config
# dump the kubeconfig for later
/usr/local/bin/kind get kubeconfig --name ${{ env.KIND_CLUSTER_NAME}} > _artifacts/kubeconfig.conf
Expand Down
4 changes: 4 additions & 0 deletions examples/kind/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
Change to the `examples/kind` folder and create a `kind` cluster with the `kind.config` file

```sh
$ sed -i 's/IP_FAMILY/ipv4/g' kind.config

$ sed -i 's#EGREE_SELECTOR_CONFIGURATION_PATH#./egress_selector_configuration.yaml#g' kind.config

$ kind create cluster --config kind.config
Creating cluster "kind" ...
DEBUG: docker/images.go:58] Image: kindest/node:v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72 present locally
Expand Down
4 changes: 2 additions & 2 deletions examples/kind/kind.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
networking:
ipFamily: ipv4
ipFamily: IP_FAMILY
nodes:
- role: control-plane
kubeadmConfigPatchesJSON6902:
Expand All @@ -26,7 +26,7 @@ nodes:
mountPath: "/etc/kubernetes/konnectivity-server"
readOnly: true
extraMounts:
- hostPath: ./egress_selector_configuration.yaml
- hostPath: EGREE_SELECTOR_CONFIGURATION_PATH
containerPath: /etc/kubernetes/konnectivity-server-config/egress_selector_configuration.yaml
- role: worker
- role: worker

0 comments on commit 25677da

Please sign in to comment.