Skip to content

Commit

Permalink
ci: add ipv6 install e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed Jul 21, 2020
1 parent 6f187c4 commit 82140c9
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 6 deletions.
43 changes: 40 additions & 3 deletions .github/workflows/build-x86-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ jobs:
- name: Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v3

- name: Go Build Cache
uses: actions/cache@v2
with:
path: /home/runner/.cache/go-build
key: ${{ runner.os }}-go-x86-build-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-x86-build-
- name: Go Mod Cache
uses: actions/cache@v2
with:
Expand Down Expand Up @@ -67,7 +75,7 @@ jobs:
name: image
path: image.tar

singlee2e:
single-e2e:
needs: build
name: 1-master-e2e
runs-on: ubuntu-latest
Expand Down Expand Up @@ -105,7 +113,7 @@ jobs:
sudo chmod 666 /home/runner/.kube/config
make e2e
hae2e:
ha-e2e:
needs: build
name: 3-master-e2e
runs-on: ubuntu-latest
Expand Down Expand Up @@ -143,8 +151,37 @@ jobs:
sudo chmod 666 /home/runner/.kube/config
make e2e
ipv6-e2e:
needs: build
name: ipv6-e2e
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Init Kind
run: |
pip install j2cli --user
pip install "j2cli[yaml]" --user
sudo PATH=~/.local/bin:$PATH make kind-init-ipv6
- name: Download image
uses: actions/download-artifact@v2
with:
name: image

- name: Load Image
run: |
docker load --input image.tar
- name: Install Kube-OVN
run: |
docker load --input image.tar
sudo make kind-install-ipv6
push:
needs: [singlee2e, hae2e]
needs: [single-e2e, ha-e2e, ipv6-e2e]
name: push
runs-on: ubuntu-latest
steps:
Expand Down
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,30 @@ kind-init:
kind delete cluster --name=kube-ovn
ip_family=ipv4 ha=false j2 yamls/kind.yaml.j2 -o yamls/kind.yaml
kind create cluster --config yamls/kind.yaml --name kube-ovn
kubectl get no -o wide

kind-install:
kind load docker-image --name kube-ovn ${REGISTRY}/kube-ovn:${RELEASE_TAG}
kubectl taint node kube-ovn-control-plane node-role.kubernetes.io/master:NoSchedule-
bash dist/images/install.sh
dist/images/install.sh
kubectl get no -o wide

kind-init-ha:
kind delete cluster --name=kube-ovn
ip_family=ipv4 ha=true j2 yamls/kind.yaml.j2 -o yamls/kind.yaml
kind create cluster --config yamls/kind.yaml --name kube-ovn
kubectl get no -o wide

kind-init-ipv6:
kind delete cluster --name=kube-ovn
ip_family=ipv6 ha=false j2 yamls/kind.yaml.j2 -o yamls/kind.yaml
kind create cluster --config yamls/kind.yaml --name kube-ovn
kubectl get no -o wide

kind-install-ipv6:
kind load docker-image --name kube-ovn ${REGISTRY}/kube-ovn:${RELEASE_TAG}
kubectl taint node kube-ovn-control-plane node-role.kubernetes.io/master:NoSchedule-
IPv6=true dist/images/install.sh

kind-reload:
kind load docker-image --name kube-ovn ${REGISTRY}/kube-ovn:${RELEASE_TAG}
Expand Down
16 changes: 14 additions & 2 deletions dist/images/install.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
#!/usr/bin/env bash
set -euo pipefail

IPv6=${IPv6:-false}

REGISTRY="kubeovn"
NAMESPACE="kube-system" # The ns to deploy kube-ovn
POD_CIDR="10.16.0.0/16" # Do NOT overlap with NODE/SVC/JOIN CIDR
EXCLUDE_IPS="" # EXCLUDE_IPS for default subnet
SVC_CIDR="10.96.0.0/12" # Do NOT overlap with NODE/POD/JOIN CIDR
JOIN_CIDR="100.64.0.0/16" # Do NOT overlap with NODE/POD/SVC CIDR
PINGER_EXTERNAL_ADDRESS="114.114.114.114" # Pinger check external ip probe
PINGER_EXTERNAL_DOMAIN="alauda.cn" # Pinger check external domain probe
if [ "$IPv6" = "true" ]; then
POD_CIDR="fd00:10:16::/64" # Do NOT overlap with NODE/SVC/JOIN CIDR
SVC_CIDR="fd00:10:96::/112" # Do NOT overlap with NODE/POD/JOIN CIDR
JOIN_CIDR="fd00:100:64::/64" # Do NOT overlap with NODE/POD/SVC CIDR
PINGER_EXTERNAL_ADDRESS="2400:3200::1"
PINGER_EXTERNAL_DOMAIN="google.com"
fi

EXCLUDE_IPS="" # EXCLUDE_IPS for default subnet
LABEL="node-role.kubernetes.io/master" # The node label to deploy OVN DB
IFACE="" # The nic to support container network, if empty will use the nic that the default route use
NETWORK_TYPE="geneve" # geneve or vlan
Expand Down Expand Up @@ -1256,7 +1268,7 @@ spec:
containers:
- name: pinger
image: "$REGISTRY/kube-ovn:$VERSION"
command: ["/kube-ovn/kube-ovn-pinger", "--external-address=114.114.114.114", "--external-dns=alauda.cn"]
command: ["/kube-ovn/kube-ovn-pinger", "--external-address=$PINGER_EXTERNAL_ADDRESS", "--external-dns=$PINGER_EXTERNAL_DOMAIN"]
imagePullPolicy: $IMAGE_PULL_POLICY
securityContext:
runAsUser: 0
Expand Down
1 change: 1 addition & 0 deletions pkg/pinger/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func ParseFlags() (*Configuration, error) {
if err := config.initKubeClient(); err != nil {
return nil, err
}
klog.Infof("pinger config is %+v", config)
return config, nil
}

Expand Down

0 comments on commit 82140c9

Please sign in to comment.