Skip to content

Commit

Permalink
chart: fix specifying namespace (#3592)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Kvapil <[email protected]>
  • Loading branch information
kvaps authored Jan 2, 2024
1 parent b823c9b commit 44654a9
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 26 deletions.
2 changes: 1 addition & 1 deletion charts/templates/controller-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kind: Service
apiVersion: v1
metadata:
name: kube-ovn-controller
namespace: kube-system
namespace: {{ .Values.namespace }}
labels:
app: kube-ovn-controller
spec:
Expand Down
2 changes: 1 addition & 1 deletion charts/templates/monitor-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kind: Service
apiVersion: v1
metadata:
name: kube-ovn-monitor
namespace: kube-system
namespace: {{ .Values.namespace }}
labels:
app: kube-ovn-monitor
spec:
Expand Down
2 changes: 1 addition & 1 deletion charts/templates/nb-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kind: Service
apiVersion: v1
metadata:
name: ovn-nb
namespace: kube-system
namespace: {{ .Values.namespace }}
spec:
ports:
- name: ovn-nb
Expand Down
2 changes: 1 addition & 1 deletion charts/templates/northd-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kind: Service
apiVersion: v1
metadata:
name: ovn-northd
namespace: kube-system
namespace: {{ .Values.namespace }}
spec:
ports:
- name: ovn-northd
Expand Down
8 changes: 4 additions & 4 deletions charts/templates/ovn-CRB.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ roleRef:
subjects:
- kind: ServiceAccount
name: ovn
namespace: kube-system
namespace: {{ .Values.namespace }}

---
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -23,7 +23,7 @@ roleRef:
subjects:
- kind: ServiceAccount
name: ovn-ovs
namespace: kube-system
namespace: {{ .Values.namespace }}

---
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -37,7 +37,7 @@ roleRef:
subjects:
- kind: ServiceAccount
name: kube-ovn-cni
namespace: kube-system
namespace: {{ .Values.namespace }}

---
apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -51,4 +51,4 @@ roleRef:
subjects:
- kind: ServiceAccount
name: kube-ovn-app
namespace: kube-system
namespace: {{ .Values.namespace }}
2 changes: 1 addition & 1 deletion charts/templates/ovn-dpdk-ds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: DaemonSet
apiVersion: apps/v1
metadata:
name: ovs-ovn-dpdk
namespace: kube-system
namespace: {{ .Values.namespace }}
annotations:
kubernetes.io/description: |
This daemon set launches the openvswitch daemon.
Expand Down
8 changes: 4 additions & 4 deletions charts/templates/ovn-sa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: ovn
namespace: kube-system
namespace: {{ .Values.namespace }}
{{- if .Values.global.registry.imagePullSecrets }}
imagePullSecrets:
{{- range $index, $secret := .Values.global.registry.imagePullSecrets }}
Expand All @@ -17,18 +17,18 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: ovn-ovs
namespace: kube-system
namespace: {{ .Values.namespace }}

---
apiVersion: v1
kind: ServiceAccount
metadata:
name: kube-ovn-cni
namespace: kube-system
namespace: {{ .Values.namespace }}

---
apiVersion: v1
kind: ServiceAccount
metadata:
name: kube-ovn-app
namespace: kube-system
namespace: {{ .Values.namespace }}
2 changes: 1 addition & 1 deletion charts/templates/ovncni-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kind: Service
apiVersion: v1
metadata:
name: kube-ovn-cni
namespace: kube-system
namespace: {{ .Values.namespace }}
labels:
app: kube-ovn-cni
spec:
Expand Down
1 change: 1 addition & 0 deletions charts/templates/pinger-ds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ spec:
{{- else if eq .Values.networking.NET_STACK "ipv6" -}}
{{ .Values.ipv6.PINGER_EXTERNAL_DOMAIN }}
{{- end }}
- --ds-namespace={{ .Values.namespace }}
- --logtostderr=false
- --alsologtostderr=true
- --log_file=/var/log/kube-ovn/kube-ovn-pinger.log
Expand Down
2 changes: 1 addition & 1 deletion charts/templates/pinger-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kind: Service
apiVersion: v1
metadata:
name: kube-ovn-pinger
namespace: kube-system
namespace: {{ .Values.namespace }}
labels:
app: kube-ovn-pinger
spec:
Expand Down
6 changes: 3 additions & 3 deletions charts/templates/pre-delete-hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: kube-ovn-pre-delete-hook
namespace: kube-system
namespace: {{ .Values.namespace }}
annotations:
# This is what defines this resource as a hook. Without this line, the
# job is considered part of the release.
Expand Down Expand Up @@ -48,13 +48,13 @@ roleRef:
subjects:
- kind: ServiceAccount
name: kube-ovn-pre-delete-hook
namespace: kube-system
namespace: {{ .Values.namespace }}
---
apiVersion: batch/v1
kind: Job
metadata:
name: "{{ .Chart.Name }}-pre-delete-hook"
namespace: kube-system
namespace: {{ .Values.namespace }}
labels:
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
Expand Down
2 changes: 1 addition & 1 deletion charts/templates/sb-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kind: Service
apiVersion: v1
metadata:
name: ovn-sb
namespace: kube-system
namespace: {{ .Values.namespace }}
spec:
ports:
- name: ovn-sb
Expand Down
10 changes: 5 additions & 5 deletions charts/templates/upgrade-ovs-ovn.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{{ if (lookup "apps/v1" "DaemonSet" "kube-system" "ovs-ovn") }}
{{ if eq (lookup "apps/v1" "DaemonSet" "kube-system" "ovs-ovn").spec.updateStrategy.type "OnDelete" }}
{{ if (lookup "apps/v1" "DaemonSet" .Values.namespace "ovs-ovn") }}
{{ if eq (lookup "apps/v1" "DaemonSet" .Values.namespace "ovs-ovn").spec.updateStrategy.type "OnDelete" }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: ovs-ovn-upgrade
namespace: kube-system
namespace: {{ .Values.namespace }}
annotations:
# This is what defines this resource as a hook. Without this line, the
# job is considered part of the release.
Expand Down Expand Up @@ -65,13 +65,13 @@ roleRef:
subjects:
- kind: ServiceAccount
name: ovs-ovn-upgrade
namespace: kube-system
namespace: {{ .Values.namespace }}
---
apiVersion: batch/v1
kind: Job
metadata:
name: "{{ .Chart.Name }}-post-upgrade-hook"
namespace: kube-system
namespace: {{ .Values.namespace }}
labels:
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
Expand Down
2 changes: 1 addition & 1 deletion charts/templates/vpc-nat-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kind: ConfigMap
apiVersion: v1
metadata:
name: ovn-vpc-nat-config
namespace: kube-system
namespace: {{ .Values.namespace }}
annotations:
kubernetes.io/description: |
kube-ovn vpc-nat common config
Expand Down
2 changes: 1 addition & 1 deletion dist/images/start-ovs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function quit {
revision_hash=$(kubectl -n "${POD_NAMESPACE}" get pod "${POD_NAME}" -o jsonpath='{.metadata.labels.controller-revision-hash}')
revision=$(kubectl -n "${POD_NAMESPACE}" get controllerrevision "${gen_name}${revision_hash}" -o jsonpath='{.revision}')
ds_name=${gen_name%-}
latest_revision=$(kubectl -n kube-system get controllerrevision --no-headers | awk '$2 == "daemonset.apps/'$ds_name'" {print $3}' | sort -nr | head -n1)
latest_revision=$(kubectl -n "${POD_NAMESPACE}" get controllerrevision --no-headers | awk '$2 == "daemonset.apps/'$ds_name'" {print $3}' | sort -nr | head -n1)
if [ "x$latest_revision" = "x$revision" ]; then
# stop ovn-controller/ovs only when the processes are in the same cgroup
pid=$(/usr/share/ovn/scripts/ovn-ctl status_controller | awk '{print $NF}')
Expand Down

0 comments on commit 44654a9

Please sign in to comment.