Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support running ovn-ic e2e on macOS #1197

Merged
merged 1 commit into from
Dec 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ test/e2e/ovnsb_db.*
kube-ovn.yaml
kube-ovn-crd.yaml
ovn.yaml
ovn-ic-0.yaml
ovn-ic-1.yaml
kind.yaml
kube-ovn.tar
vpc-nat-gateway.tar
Expand Down
33 changes: 17 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,11 @@ kind-install-cluster:
ENABLE_SSL=true dist/images/install.sh
kubectl describe no
kubectl config use-context kind-kube-ovn1
sed -e 's/10.16.0/10.18.0/g' -e 's/10.96.0/10.98.0/g' -e 's/100.64.0/100.68.0/g' dist/images/install.sh > ./install-multi.sh
ENABLE_SSL=true bash ./install-multi.sh
sed -e 's/10.16.0/10.18.0/g' \
-e 's/10.96.0/10.98.0/g' \
-e 's/100.64.0/100.68.0/g' \
dist/images/install.sh > install-multi.sh
ENABLE_SSL=true bash install-multi.sh
kubectl describe no

.PHONY: kind-install-underlay
Expand All @@ -161,10 +164,9 @@ kind-install-underlay:
-e 's@^[[:space:]]*EXCLUDE_IPS=.*@EXCLUDE_IPS="$(EXCLUDE_IPS)"@' \
-e 's@^VLAN_ID=.*@VLAN_ID="0"@' \
dist/images/install.sh > install-underlay.sh
chmod +x install-underlay.sh
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-
ENABLE_SSL=true ENABLE_VLAN=true VLAN_NIC=eth0 ./install-underlay.sh
ENABLE_SSL=true ENABLE_VLAN=true VLAN_NIC=eth0 bash install-underlay.sh
kubectl describe no

.PHONY: kind-install-single
Expand All @@ -189,10 +191,9 @@ kind-install-underlay-ipv6:
-e 's@^[[:space:]]*EXCLUDE_IPS=.*@EXCLUDE_IPS="$(EXCLUDE_IPS)"@' \
-e 's@^VLAN_ID=.*@VLAN_ID="0"@' \
dist/images/install.sh > install-underlay.sh
@chmod +x install-underlay.sh
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-
ENABLE_SSL=true IPV6=true ENABLE_VLAN=true VLAN_NIC=eth0 ./install-underlay.sh
ENABLE_SSL=true IPV6=true ENABLE_VLAN=true VLAN_NIC=eth0 bash install-underlay.sh

.PHONY: kind-install-dual
kind-install-dual:
Expand All @@ -214,10 +215,9 @@ kind-install-underlay-dual:
-e 's@^[[:space:]]*EXCLUDE_IPS=.*@EXCLUDE_IPS="$(IPV4_EXCLUDE_IPS),$(IPV6_EXCLUDE_IPS)"@' \
-e 's@^VLAN_ID=.*@VLAN_ID="0"@' \
dist/images/install.sh > install-underlay.sh
@chmod +x install-underlay.sh
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-
ENABLE_SSL=true DUAL_STACK=true ENABLE_VLAN=true VLAN_NIC=eth0 ./install-underlay.sh
ENABLE_SSL=true DUAL_STACK=true ENABLE_VLAN=true VLAN_NIC=eth0 bash install-underlay.sh

.PHONY: kind-install-underlay-logical-gateway-dual
kind-install-underlay-logical-gateway-dual:
Expand All @@ -232,21 +232,21 @@ kind-install-underlay-logical-gateway-dual:
-e 's@^[[:space:]]*EXCLUDE_IPS=.*@EXCLUDE_IPS="$(IPV4_EXCLUDE_IPS),$(IPV6_EXCLUDE_IPS)"@' \
-e 's@^VLAN_ID=.*@VLAN_ID="0"@' \
dist/images/install.sh > install-underlay.sh
@chmod +x install-underlay.sh
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-
ENABLE_SSL=true DUAL_STACK=true ENABLE_VLAN=true VLAN_NIC=eth0 LOGICAL_GATEWAY=true ./install-underlay.sh
ENABLE_SSL=true DUAL_STACK=true ENABLE_VLAN=true VLAN_NIC=eth0 LOGICAL_GATEWAY=true bash install-underlay.sh

.PHONY: kind-install-ic
kind-install-ic:
$(eval HOSTIP = $(shell ip -4 route get 8.8.8.8 | awk {'print $$7'} | tr -d '\n'))
zone=az0 host_node_ip=${HOSTIP} gateway_node_name=kube-ovn-control-plane j2 yamls/ovn-ic.yaml.j2 -o /ovn-ic-0.yaml
zone=az1 host_node_ip=${HOSTIP} gateway_node_name=kube-ovn1-control-plane j2 yamls/ovn-ic.yaml.j2 -o /ovn-ic-1.yaml
docker run -d --name ovn-ic-db --network kind $(REGISTRY)/kube-ovn:$(RELEASE_TAG) bash start-ic-db.sh
@set -e; \
ic_db_host=$$(docker inspect ovn-ic-db -f "{{.NetworkSettings.Networks.kind.IPAddress}}"); \
zone=az0 ic_db_host=$$ic_db_host gateway_node_name=kube-ovn-control-plane j2 yamls/ovn-ic.yaml.j2 -o ovn-ic-0.yaml; \
zone=az1 ic_db_host=$$ic_db_host gateway_node_name=kube-ovn1-control-plane j2 yamls/ovn-ic.yaml.j2 -o ovn-ic-1.yaml
kubectl config use-context kind-kube-ovn
kubectl apply -f /ovn-ic-0.yaml
kubectl apply -f ovn-ic-0.yaml
kubectl config use-context kind-kube-ovn1
kubectl apply -f /ovn-ic-1.yaml
docker run --name=ovn-ic-db -d --network=host -v /etc/ovn/:/etc/ovn -v /var/run/ovn:/var/run/ovn -v /var/log/ovn:/var/log/ovn $(REGISTRY)/kube-ovn:$(RELEASE_TAG) bash start-ic-db.sh
kubectl apply -f ovn-ic-1.yaml

.PHONY: kind-install-cilium
kind-install-cilium:
Expand Down Expand Up @@ -376,6 +376,7 @@ clean:
$(RM) dist/images/kube-ovn dist/images/kube-ovn-cmd
$(RM) yamls/kind.yaml
$(RM) ovn.yaml kube-ovn.yaml kube-ovn-crd.yaml
$(RM) ovn-ic-0.yaml ovn-ic-1.yaml
$(RM) kube-ovn.tar vpc-nat-gateway.tar image-amd64.tar image-arm64.tar
$(RM) test/e2e/ovnnb_db.* test/e2e/ovnsb_db.*
$(RM) install-underlay.sh
2 changes: 1 addition & 1 deletion pkg/controller/ovn-ic.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func (c *Controller) establishInterConnection(config map[string]string) error {
}
if len(chassises) == 0 {
klog.Error("no available ic gw")
return fmt.Errorf("noavailable ic gw")
return fmt.Errorf("no available ic gw")
}
if err := c.waitTsReady(); err != nil {
klog.Errorf("failed to wait ts ready, %v", err)
Expand Down
2 changes: 1 addition & 1 deletion yamls/ovn-ic.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
data:
enable-ic: "true"
az-name: "{{ zone }}"
ic-db-host: "{{ host_node_ip }}"
ic-db-host: "{{ ic_db_host }}"
ic-nb-port: "6645"
ic-sb-port: "6646"
gw-nodes: "{{ gateway_node_name }}"
Expand Down