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

fix(ovn): bootstrap clusters correctly #907

Closed
wants to merge 2 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ limitations under the License.
set -ex

chown ${NEUTRON_USER_UID} /var/lib/neutron/openstack-helm
{{- if (has "ovn" .Values.network.backend) }}
chown ${NEUTRON_USER_UID} /run/openvswitch/db.sock
{{- end }}

{{- if and ( empty .Values.conf.neutron.DEFAULT.host ) ( .Values.pod.use_fqdn.neutron_agent ) }}
mkdir -p /tmp/pod-shared
Expand Down
2 changes: 2 additions & 0 deletions charts/neutron/templates/daemonset-ovn-metadata-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ spec:
command:
- /tmp/neutron-metadata-agent-init.sh
volumeMounts:
- name: run
mountPath: /run
- name: pod-tmp
mountPath: /tmp
- name: neutron-bin
Expand Down
39 changes: 0 additions & 39 deletions charts/ovn/templates/bin/_ovn-controller.sh.tpl

This file was deleted.

57 changes: 0 additions & 57 deletions charts/ovn/templates/bin/_ovn-northd.sh.tpl

This file was deleted.

72 changes: 0 additions & 72 deletions charts/ovn/templates/bin/_ovsdb-server.sh.tpl

This file was deleted.

6 changes: 0 additions & 6 deletions charts/ovn/templates/configmap-bin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ data:
image-repo-sync.sh: |
{{- include "helm-toolkit.scripts.image_repo_sync" . | indent 4 }}
{{- end }}
ovsdb-server.sh: |
{{ tuple "bin/_ovsdb-server.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
ovn-northd.sh: |
{{ tuple "bin/_ovn-northd.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
ovn-controller-init.sh: |
{{ tuple "bin/_ovn-controller-init.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
ovn-controller.sh: |
{{ tuple "bin/_ovn-controller.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
{{- end }}
45 changes: 31 additions & 14 deletions charts/ovn/templates/daemonset-controller-gw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ See the License for the specific language governing permissions and
limitations under the License.
*/}}

{{- define "controllerGatewayReadinessProbeTemplate" }}
exec:
command:
- /usr/bin/ovn-kube-util
- readiness-probe
- -t
- ovn-controller
{{- end }}

{{- if .Values.manifests.daemonset_ovn_controller_gw }}
{{- $envAll := . }}

Expand Down Expand Up @@ -76,25 +85,33 @@ spec:
readOnly: true
containers:
- name: controller
command:
- /root/ovnkube.sh
- ovn-controller
{{ tuple $envAll "ovn_controller" | include "helm-toolkit.snippets.image" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.server | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
{{ dict "envAll" $envAll "application" "ovn_controller_gw" "container" "controller" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
command:
- /tmp/ovn-controller.sh
- start
lifecycle:
preStop:
exec:
command:
- /tmp/ovn-controller.sh
- stop
{{ dict "envAll" . "component" "ovn_controller_gw" "container" "controller" "type" "readiness" "probeTemplate" (include "controllerGatewayReadinessProbeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
env:
- name: OVN_DAEMONSET_VERSION
value: "3"
- name: OVN_LOGLEVEL_CONTROLLER
value: "-vconsole:info -vfile:info"
- name: OVN_KUBERNETES_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: OVN_KUBERNETES_NB_STATEFULSET
value: ovn-ovsdb-nb
- name: OVN_KUBERNETES_SB_STATEFULSET
value: ovn-ovsdb-sb
- name: OVN_SSL_ENABLE
value: "no"
volumeMounts:
- name: ovn-bin
mountPath: /tmp/ovn-controller.sh
subPath: ovn-controller.sh
readOnly: true
- name: run-openvswitch
mountPath: /run/openvswitch
mountPath: /var/run/ovn
- name: run-openvswitch
mountPath: /var/run/openvswitch
volumes:
- name: ovn-bin
configMap:
Expand Down
45 changes: 31 additions & 14 deletions charts/ovn/templates/daemonset-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ See the License for the specific language governing permissions and
limitations under the License.
*/}}

{{- define "controllerReadinessProbeTemplate" }}
exec:
command:
- /usr/bin/ovn-kube-util
- readiness-probe
- -t
- ovn-controller
{{- end }}

{{- if .Values.manifests.daemonset_ovn_controller }}
{{- $envAll := . }}

Expand Down Expand Up @@ -76,25 +85,33 @@ spec:
readOnly: true
containers:
- name: controller
command:
- /root/ovnkube.sh
- ovn-controller
{{ tuple $envAll "ovn_controller" | include "helm-toolkit.snippets.image" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.server | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
{{ dict "envAll" $envAll "application" "ovn_controller" "container" "controller" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
command:
- /tmp/ovn-controller.sh
- start
lifecycle:
preStop:
exec:
command:
- /tmp/ovn-controller.sh
- stop
{{ dict "envAll" . "component" "ovn_controller" "container" "controller" "type" "readiness" "probeTemplate" (include "controllerReadinessProbeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
env:
- name: OVN_DAEMONSET_VERSION
value: "3"
- name: OVN_LOGLEVEL_CONTROLLER
value: "-vconsole:info -vfile:info"
- name: OVN_KUBERNETES_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: OVN_KUBERNETES_NB_STATEFULSET
value: ovn-ovsdb-nb
- name: OVN_KUBERNETES_SB_STATEFULSET
value: ovn-ovsdb-sb
- name: OVN_SSL_ENABLE
value: "no"
volumeMounts:
- name: ovn-bin
mountPath: /tmp/ovn-controller.sh
subPath: ovn-controller.sh
readOnly: true
- name: run-openvswitch
mountPath: /run/openvswitch
mountPath: /var/run/ovn
- name: run-openvswitch
mountPath: /var/run/openvswitch
volumes:
- name: ovn-bin
configMap:
Expand Down
Loading
Loading