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: ...@@ -14,11 +14,11 @@ spec:
spec: spec:
containers: containers:
- name: l2sm-controller - name: l2sm-controller
image: alexdecb/l2sm-controller:latest image: alexdecb/l2sm-controller:2.2
# readinessProbe: readinessProbe:
# httpGet: httpGet:
# path: /onos/v1/l2sm/networks/status path: /onos/ui
# port: 8181 port: 8181
ports: ports:
- containerPort: 6633 - containerPort: 6633
- containerPort: 8181 - containerPort: 8181
......
...@@ -15,13 +15,19 @@ spec: ...@@ -15,13 +15,19 @@ spec:
l2sm-component: l2sm-opt l2sm-component: l2sm-opt
spec: spec:
serviceAccountName: l2sm-operator 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: 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 name: l2sm-opt-pod
env: env:
- name: CONTROLLER_IP - name: CONTROLLER_IP
value: l2sm-controller-service value: l2sm-controller-service
#command: ["sleep","infinity"]
- image: mysql/mysql-server:5.7 - image: mysql/mysql-server:5.7
name: mysql name: mysql
env: env:
......
...@@ -24,7 +24,7 @@ spec: ...@@ -24,7 +24,7 @@ spec:
effect: NoSchedule effect: NoSchedule
containers: containers:
- name: l2sm-switch - name: l2sm-switch
image: alexdecb/l2sm-switch:2.1 image: alexdecb/l2sm-switch:2.2
command: ["sleep","infinity"] command: ["sleep","infinity"]
#args: ["setup_switch.sh && sleep infinity"] #args: ["setup_switch.sh && sleep infinity"]
env: 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