Skip to content

Commit

Permalink
fix: use nodeName as chassis hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed Sep 2, 2020
1 parent 290e7ba commit e986144
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 3 deletions.
8 changes: 8 additions & 0 deletions dist/images/install-pre-1.16.sh
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,10 @@ spec:
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- mountPath: /lib/modules
name: host-modules
Expand Down Expand Up @@ -921,6 +925,10 @@ spec:
fieldPath: status.podIP
- name: HW_OFFLOAD
value: "$HW_OFFLOAD"
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- mountPath: /lib/modules
name: host-modules
Expand Down
8 changes: 8 additions & 0 deletions dist/images/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,10 @@ spec:
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- mountPath: /lib/modules
name: host-modules
Expand Down Expand Up @@ -1038,6 +1042,10 @@ spec:
fieldPath: status.podIP
- name: HW_OFFLOAD
value: "$HW_OFFLOAD"
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- mountPath: /lib/modules
name: host-modules
Expand Down
7 changes: 4 additions & 3 deletions dist/images/start-ovs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,14 @@ fi
/usr/share/openvswitch/scripts/ovs-ctl restart --no-ovsdb-server --system-id=random
/usr/share/openvswitch/scripts/ovs-ctl --protocol=udp --dport=6081 enable-protocol

# Start ovn-controller
/usr/share/ovn/scripts/ovn-ctl restart_controller

# Set remote ovn-sb for ovn-controller to connect to
ovs-vsctl set open . external-ids:ovn-remote=tcp:"[${OVN_SB_SERVICE_HOST}]":"${OVN_SB_SERVICE_PORT}"
ovs-vsctl set open . external-ids:ovn-remote-probe-interval=10000
ovs-vsctl set open . external-ids:ovn-openflow-probe-interval=180
ovs-vsctl set open . external-ids:ovn-encap-type=geneve
ovs-vsctl set open . external-ids:hostname="${KUBE_NODE_NAME}"

# Start ovn-controller
/usr/share/ovn/scripts/ovn-ctl restart_controller

tail -f /var/log/ovn/ovn-controller.log
3 changes: 3 additions & 0 deletions pkg/controller/ovn-ic.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ func (c *Controller) establishInterConnection(config map[string]string) error {
klog.Errorf("failed to get gw %s chassisID, %v", gw, err)
return err
}
if chassisID == "" {
return fmt.Errorf("no chassisID for gw %s", gw)
}
chassises = append(chassises, chassisID)
}

Expand Down
4 changes: 4 additions & 0 deletions yamls/ovn-dpdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ spec:
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- mountPath: /lib/modules
name: host-modules
Expand Down
4 changes: 4 additions & 0 deletions yamls/ovn-ha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,10 @@ spec:
fieldPath: status.podIP
- name: HW_OFFLOAD
value: "false"
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
volumeMounts:
- mountPath: /lib/modules
name: host-modules
Expand Down
4 changes: 4 additions & 0 deletions yamls/ovn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ spec:
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: HW_OFFLOAD
value: "false"
volumeMounts:
Expand Down

0 comments on commit e986144

Please sign in to comment.