Skip to content

Commit

Permalink
optimize kube-ovn-monitor yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
hongzhen-ma committed Mar 9, 2022
1 parent ce8087d commit dbf4774
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 46 deletions.
16 changes: 4 additions & 12 deletions dist/images/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2222,10 +2222,10 @@ metadata:
kubernetes.io/description: |
Metrics for OVN components: northd, nb and sb.
spec:
replicas: $count
replicas: 1
strategy:
rollingUpdate:
maxSurge: 0
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
selector:
Expand Down Expand Up @@ -2266,8 +2266,6 @@ spec:
env:
- name: ENABLE_SSL
value: "$ENABLE_SSL"
- name: NODE_IPS
value: $addresses
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
Expand All @@ -2284,9 +2282,6 @@ spec:
name: host-run-ovs
- mountPath: /var/run/ovn
name: host-run-ovn
- mountPath: /sys
name: host-sys
readOnly: true
- mountPath: /etc/openvswitch
name: host-config-openvswitch
- mountPath: /etc/ovn
Expand All @@ -2304,13 +2299,13 @@ spec:
command:
- cat
- /var/run/ovn/ovnnb_db.pid
periodSeconds: 3
periodSeconds: 10
timeoutSeconds: 45
livenessProbe:
exec:
command:
- cat
- /var/run/ovn/ovn-nbctl.pid
- /var/run/ovn/ovnnb_db.pid
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 5
Expand All @@ -2325,9 +2320,6 @@ spec:
- name: host-run-ovn
hostPath:
path: /run/ovn
- name: host-sys
hostPath:
path: /sys
- name: host-config-openvswitch
hostPath:
path: /etc/origin/openvswitch
Expand Down
16 changes: 0 additions & 16 deletions dist/images/start-ovn-monitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,4 @@
set -euo pipefail
ENABLE_SSL=${ENABLE_SSL:-false}

function gen_conn_str {
t=$(echo -n "${NODE_IPS}" | sed 's/[[:space:]]//g' | sed 's/,/ /g')
if [[ "$ENABLE_SSL" == "false" ]]; then
x=$(for i in ${t}; do echo -n "tcp:[$i]:$1",; done| sed 's/,$//')
else
x=$(for i in ${t}; do echo -n "ssl:[$i]:$1",; done| sed 's/,$//')
fi
echo "$x"
}

if [[ "$ENABLE_SSL" == "false" ]]; then
export OVN_NB_DAEMON=$(ovn-nbctl --db="$(gen_conn_str 6641)" --pidfile --detach --overwrite-pidfile)
else
export OVN_NB_DAEMON=$(ovn-nbctl -p /var/run/tls/key -c /var/run/tls/cert -C /var/run/tls/cacert --db="$(gen_conn_str 6641)" --pidfile --detach --overwrite-pidfile)
fi

exec ./kube-ovn-monitor $@
12 changes: 3 additions & 9 deletions yamls/kube-ovn-ipv6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ spec:
replicas: 1
strategy:
rollingUpdate:
maxSurge: 0
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
selector:
Expand Down Expand Up @@ -402,9 +402,6 @@ spec:
name: host-run-ovs
- mountPath: /var/run/ovn
name: host-run-ovn
- mountPath: /sys
name: host-sys
readOnly: true
- mountPath: /etc/openvswitch
name: host-config-openvswitch
- mountPath: /etc/ovn
Expand All @@ -422,13 +419,13 @@ spec:
command:
- cat
- /var/run/ovn/ovnnb_db.pid
periodSeconds: 3
periodSeconds: 10
timeoutSeconds: 45
livenessProbe:
exec:
command:
- cat
- /var/run/ovn/ovn-nbctl.pid
- /var/run/ovn/ovnnb_db.pid
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 5
Expand All @@ -443,9 +440,6 @@ spec:
- name: host-run-ovn
hostPath:
path: /run/ovn
- name: host-sys
hostPath:
path: /sys
- name: host-config-openvswitch
hostPath:
path: /etc/origin/openvswitch
Expand Down
12 changes: 3 additions & 9 deletions yamls/kube-ovn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ spec:
replicas: 1
strategy:
rollingUpdate:
maxSurge: 0
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
selector:
Expand Down Expand Up @@ -434,9 +434,6 @@ spec:
name: host-run-ovs
- mountPath: /var/run/ovn
name: host-run-ovn
- mountPath: /sys
name: host-sys
readOnly: true
- mountPath: /etc/openvswitch
name: host-config-openvswitch
- mountPath: /etc/ovn
Expand All @@ -454,13 +451,13 @@ spec:
command:
- cat
- /var/run/ovn/ovnnb_db.pid
periodSeconds: 3
periodSeconds: 10
timeoutSeconds: 45
livenessProbe:
exec:
command:
- cat
- /var/run/ovn/ovn-nbctl.pid
- /var/run/ovn/ovnnb_db.pid
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 5
Expand All @@ -475,9 +472,6 @@ spec:
- name: host-run-ovn
hostPath:
path: /run/ovn
- name: host-sys
hostPath:
path: /sys
- name: host-config-openvswitch
hostPath:
path: /etc/origin/openvswitch
Expand Down

0 comments on commit dbf4774

Please sign in to comment.