Skip to content
Snippets Groups Projects
Commit 368600d1 authored by Alex ubuntu vm's avatar Alex ubuntu vm
Browse files

deployment: Added readiness checks and initContainers

Implemented readinessProbe in l2sm-controller Deployment and added initContainers in l2sm-operator Deployment to ensure proper synchronization with l2sm-controller pod status before starting.

This change ensures that l2sm-operator does not start until l2sm-controller pod is in the Running state.
parent 6cdab8d2
No related branches found
No related tags found
1 merge request!2repo: added new directory where utils scripts will be
......@@ -14,11 +14,11 @@ spec:
spec:
containers:
- name: l2sm-controller
image: alexdecb/l2sm-controller:latest
# readinessProbe:
# httpGet:
# path: /onos/v1/l2sm/networks/status
# port: 8181
image: alexdecb/l2sm-controller:2.2
readinessProbe:
httpGet:
path: /onos/ui
port: 8181
ports:
- containerPort: 6633
- containerPort: 8181
......
......@@ -15,13 +15,19 @@ spec:
l2sm-component: l2sm-opt
spec:
serviceAccountName: l2sm-operator
initContainers:
- name: wait-for-l2sm-controller
image: busybox:1.31
command: ["/bin/sh", "-c", "set -x; while true; do status_code=$(wget --spider -S http://l2sm-controller-service:8181/onos/ui 2>&1 | grep 'HTTP/' | awk '{print $2}'); [ -z $status_code ] && sleep 15 || [ $status_code -eq 200 ] && break || sleep 15; done"]
containers:
- image: alexdecb/l2sm-operator:2.1
- name: wait-test
image: busybox:1.31
command: ["sleep","infinity"]
- image: alexdecb/l2sm-operator:2.2
name: l2sm-opt-pod
env:
- name: CONTROLLER_IP
value: l2sm-controller-service
#command: ["sleep","infinity"]
- image: mysql/mysql-server:5.7
name: mysql
env:
......
......@@ -24,7 +24,7 @@ spec:
effect: NoSchedule
containers:
- name: l2sm-switch
image: alexdecb/l2sm-switch:2.1
image: alexdecb/l2sm-switch:2.2
command: ["sleep","infinity"]
#args: ["setup_switch.sh && sleep infinity"]
env:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment