Skip to content

Commit

Permalink
suuport user custom log location (#3186)
Browse files Browse the repository at this point in the history
Signed-off-by: bobz965 <[email protected]>
  • Loading branch information
bobz965 authored Sep 8, 2023
1 parent 8a3cf03 commit 11408af
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 61 deletions.
4 changes: 2 additions & 2 deletions charts/templates/central-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ spec:
path: /etc/origin/ovn
- name: host-log-ovs
hostPath:
path: /var/log/openvswitch
path: {{ .Values.log_conf.LOG_DIR }}/openvswitch
- name: host-log-ovn
hostPath:
path: /var/log/ovn
path: {{ .Values.log_conf.LOG_DIR }}/ovn
- name: localtime
hostPath:
path: /etc/localtime
Expand Down
2 changes: 1 addition & 1 deletion charts/templates/controller-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ spec:
path: /etc/localtime
- name: kube-ovn-log
hostPath:
path: /var/log/kube-ovn
path: {{ .Values.log_conf.LOG_DIR }}/kube-ovn
- name: kube-ovn-tls
secret:
optional: true
Expand Down
4 changes: 2 additions & 2 deletions charts/templates/monitor-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ spec:
path: /etc/origin/ovn
- name: host-log-ovn
hostPath:
path: /var/log/ovn
path: {{ .Values.log_conf.LOG_DIR }}/ovn
- name: localtime
hostPath:
path: /etc/localtime
Expand All @@ -134,4 +134,4 @@ spec:
secretName: kube-ovn-tls
- name: kube-ovn-log
hostPath:
path: /var/log/kube-ovn
path: {{ .Values.log_conf.LOG_DIR }}/kube-ovn
4 changes: 2 additions & 2 deletions charts/templates/ovn-dpdk-ds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ spec:
path: /etc/origin/ovn
- name: host-log-ovs
hostPath:
path: /var/log/openvswitch
path: {{ .Values.log_conf.LOG_DIR }}/openvswitch
- name: host-log-ovn
hostPath:
path: /var/log/ovn
path: {{ .Values.log_conf.LOG_DIR }}/ovn
- name: localtime
hostPath:
path: /etc/localtime
Expand Down
6 changes: 3 additions & 3 deletions charts/templates/ovncni-ds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,16 @@ spec:
path: /var/run/dbus
- name: kube-ovn-log
hostPath:
path: /var/log/kube-ovn
path: {{ .Values.log_conf.LOG_DIR }}/kube-ovn
- name: localtime
hostPath:
path: /etc/localtime
- name: host-log-ovs
hostPath:
path: /var/log/openvswitch
path: {{ .Values.log_conf.LOG_DIR }}/openvswitch
- name: host-log-ovn
hostPath:
path: /var/log/ovn
path: {{ .Values.log_conf.LOG_DIR }}/ovn
- name: tmp
hostPath:
path: /tmp
Expand Down
4 changes: 2 additions & 2 deletions charts/templates/ovsovn-ds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ spec:
path: /etc/origin/ovn
- name: host-log-ovs
hostPath:
path: /var/log/openvswitch
path: {{ .Values.log_conf.LOG_DIR }}/openvswitch
- name: host-log-ovn
hostPath:
path: /var/log/ovn
path: {{ .Values.log_conf.LOG_DIR }}/ovn
- name: localtime
hostPath:
path: /etc/localtime
Expand Down
6 changes: 3 additions & 3 deletions charts/templates/pinger-ds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ spec:
path: /etc/origin/openvswitch
- name: host-log-ovs
hostPath:
path: /var/log/openvswitch
path: {{ .Values.log_conf.LOG_DIR }}/openvswitch
- name: kube-ovn-log
hostPath:
path: /var/log/kube-ovn
path: {{ .Values.log_conf.LOG_DIR }}/kube-ovn
- name: host-log-ovn
hostPath:
path: /var/log/ovn
path: {{ .Values.log_conf.LOG_DIR }}/ovn
- name: localtime
hostPath:
path: /etc/localtime
Expand Down
2 changes: 1 addition & 1 deletion charts/templates/upgrade-ovs-ovn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,6 @@ spec:
volumes:
- name: kube-ovn-log
hostPath:
path: /var/log/kube-ovn
path: {{ .Values.log_conf.LOG_DIR }}/kube-ovn
{{ end }}
{{ end }}
3 changes: 3 additions & 0 deletions charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ cni_conf:

kubelet_conf:
KUBELET_DIR: "/var/lib/kubelet"

log_conf:
LOG_DIR: "/var/log"

imagePullSecrets: []
nameOverride: ""
Expand Down
39 changes: 20 additions & 19 deletions dist/images/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ ENABLE_TPROXY=${ENABLE_TPROXY:-false}
DEBUG_WRAPPER=${DEBUG_WRAPPER:-}

KUBELET_DIR=${KUBELET_DIR:-/var/lib/kubelet}
LOG_DIR=${LOG_DIR:-/var/log}

CNI_CONF_DIR="/etc/cni/net.d"
CNI_BIN_DIR="/opt/cni/bin"
Expand Down Expand Up @@ -3305,10 +3306,10 @@ spec:
path: /etc/origin/ovn
- name: host-log-ovs
hostPath:
path: /var/log/openvswitch
path: $LOG_DIR/openvswitch
- name: host-log-ovn
hostPath:
path: /var/log/ovn
path: $LOG_DIR/ovn
- name: localtime
hostPath:
path: /etc/localtime
Expand Down Expand Up @@ -3464,10 +3465,10 @@ spec:
path: /etc/origin/ovn
- name: host-log-ovs
hostPath:
path: /var/log/openvswitch
path: $LOG_DIR/openvswitch
- name: host-log-ovn
hostPath:
path: /var/log/ovn
path: $LOG_DIR/ovn
- name: host-config-ovs
hostPath:
path: /opt/ovs-config
Expand Down Expand Up @@ -3643,10 +3644,10 @@ spec:
path: /etc/origin/ovn
- name: host-log-ovs
hostPath:
path: /var/log/openvswitch
path: $LOG_DIR/openvswitch
- name: host-log-ovn
hostPath:
path: /var/log/ovn
path: $LOG_DIR/ovn
- name: localtime
hostPath:
path: /etc/localtime
Expand Down Expand Up @@ -3740,9 +3741,9 @@ spec:
name: host-config-openvswitch
- mountPath: /etc/ovn
name: host-config-ovn
- mountPath: /var/log/openvswitch
- mountPath: $LOG_DIR/openvswitch
name: host-log-ovs
- mountPath: /var/log/ovn
- mountPath: $LOG_DIR/ovn
name: host-log-ovn
- mountPath: /etc/localtime
name: localtime
Expand Down Expand Up @@ -3810,10 +3811,10 @@ spec:
path: /etc/origin/ovn
- name: host-log-ovs
hostPath:
path: /var/log/openvswitch
path: $LOG_DIR/openvswitch
- name: host-log-ovn
hostPath:
path: /var/log/ovn
path: $LOG_DIR/ovn
- name: localtime
hostPath:
path: /etc/localtime
Expand Down Expand Up @@ -3986,7 +3987,7 @@ spec:
path: /etc/localtime
- name: kube-ovn-log
hostPath:
path: /var/log/kube-ovn
path: $LOG_DIR/kube-ovn
- name: kube-ovn-tls
secret:
optional: true
Expand Down Expand Up @@ -4172,13 +4173,13 @@ spec:
path: /var/run/dbus
- name: host-log-ovs
hostPath:
path: /var/log/openvswitch
path: $LOG_DIR/openvswitch
- name: kube-ovn-log
hostPath:
path: /var/log/kube-ovn
path: $LOG_DIR/kube-ovn
- name: host-log-ovn
hostPath:
path: /var/log/ovn
path: $LOG_DIR/ovn
- name: localtime
hostPath:
path: /etc/localtime
Expand Down Expand Up @@ -4290,13 +4291,13 @@ spec:
path: /etc/origin/openvswitch
- name: host-log-ovs
hostPath:
path: /var/log/openvswitch
path: $LOG_DIR/openvswitch
- name: kube-ovn-log
hostPath:
path: /var/log/kube-ovn
path: $LOG_DIR/kube-ovn
- name: host-log-ovn
hostPath:
path: /var/log/ovn
path: $LOG_DIR/ovn
- name: localtime
hostPath:
path: /etc/localtime
Expand Down Expand Up @@ -4431,7 +4432,7 @@ spec:
path: /etc/origin/ovn
- name: host-log-ovn
hostPath:
path: /var/log/ovn
path: $LOG_DIR/ovn
- name: localtime
hostPath:
path: /etc/localtime
Expand All @@ -4441,7 +4442,7 @@ spec:
secretName: kube-ovn-tls
- name: kube-ovn-log
hostPath:
path: /var/log/kube-ovn
path: $LOG_DIR/kube-ovn
---
kind: Service
apiVersion: v1
Expand Down
18 changes: 9 additions & 9 deletions yamls/kube-ovn-dual-stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ spec:
path: /etc/localtime
- name: kube-ovn-log
hostPath:
path: /var/log/kube-ovn
path: {{ .Values.log_conf.LOG_DIR }}/kube-ovn
- name: kube-ovn-tls
secret:
optional: true
Expand Down Expand Up @@ -314,13 +314,13 @@ spec:
path: /var/run/dbus
- name: host-log-ovs
hostPath:
path: /var/log/openvswitch
path: {{ .Values.log_conf.LOG_DIR }}/openvswitch
- name: kube-ovn-log
hostPath:
path: /var/log/kube-ovn
path: {{ .Values.log_conf.LOG_DIR }}/kube-ovn
- name: host-log-ovn
hostPath:
path: /var/log/ovn
path: {{ .Values.log_conf.LOG_DIR }}/ovn
- name: localtime
hostPath:
path: /etc/localtime
Expand Down Expand Up @@ -432,13 +432,13 @@ spec:
path: /etc/origin/openvswitch
- name: host-log-ovs
hostPath:
path: /var/log/openvswitch
path: {{ .Values.log_conf.LOG_DIR }}/openvswitch
- name: kube-ovn-log
hostPath:
path: /var/log/kube-ovn
path: {{ .Values.log_conf.LOG_DIR }}/kube-ovn
- name: host-log-ovn
hostPath:
path: /var/log/ovn
path: {{ .Values.log_conf.LOG_DIR }}/ovn
- name: localtime
hostPath:
path: /etc/localtime
Expand Down Expand Up @@ -573,7 +573,7 @@ spec:
path: /etc/origin/ovn
- name: host-log-ovn
hostPath:
path: /var/log/ovn
path: {{ .Values.log_conf.LOG_DIR }}/ovn
- name: localtime
hostPath:
path: /etc/localtime
Expand All @@ -583,7 +583,7 @@ spec:
secretName: kube-ovn-tls
- name: kube-ovn-log
hostPath:
path: /var/log/kube-ovn
path: {{ .Values.log_conf.LOG_DIR }}/kube-ovn
---
kind: Service
apiVersion: v1
Expand Down
18 changes: 9 additions & 9 deletions yamls/kube-ovn-ipv6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ spec:
path: /etc/localtime
- name: kube-ovn-log
hostPath:
path: /var/log/kube-ovn
path: {{ .Values.log_conf.LOG_DIR }}/kube-ovn
- name: kube-ovn-tls
secret:
optional: true
Expand Down Expand Up @@ -314,13 +314,13 @@ spec:
path: /var/run/dbus
- name: host-log-ovs
hostPath:
path: /var/log/openvswitch
path: {{ .Values.log_conf.LOG_DIR }}/openvswitch
- name: kube-ovn-log
hostPath:
path: /var/log/kube-ovn
path: {{ .Values.log_conf.LOG_DIR }}/kube-ovn
- name: host-log-ovn
hostPath:
path: /var/log/ovn
path: {{ .Values.log_conf.LOG_DIR }}/ovn
- name: localtime
hostPath:
path: /etc/localtime
Expand Down Expand Up @@ -432,13 +432,13 @@ spec:
path: /etc/origin/openvswitch
- name: host-log-ovs
hostPath:
path: /var/log/openvswitch
path: {{ .Values.log_conf.LOG_DIR }}/openvswitch
- name: kube-ovn-log
hostPath:
path: /var/log/kube-ovn
path: {{ .Values.log_conf.LOG_DIR }}/kube-ovn
- name: host-log-ovn
hostPath:
path: /var/log/ovn
path: {{ .Values.log_conf.LOG_DIR }}/ovn
- name: localtime
hostPath:
path: /etc/localtime
Expand Down Expand Up @@ -573,7 +573,7 @@ spec:
path: /etc/origin/ovn
- name: host-log-ovn
hostPath:
path: /var/log/ovn
path: {{ .Values.log_conf.LOG_DIR }}/ovn
- name: localtime
hostPath:
path: /etc/localtime
Expand All @@ -583,7 +583,7 @@ spec:
secretName: kube-ovn-tls
- name: kube-ovn-log
hostPath:
path: /var/log/kube-ovn
path: {{ .Values.log_conf.LOG_DIR }}/kube-ovn
---
kind: Service
apiVersion: v1
Expand Down
Loading

0 comments on commit 11408af

Please sign in to comment.