mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-05-05 23:17:34 +00:00
kata-deploy: Use readinessProbe to ensure everything is ready
readinessProbe will help us to only have the kata-deploy pod marked as Ready when it finishes all the needed configurations in the node. Related: #6649 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
parent
ea386700fe
commit
5ec9ae0f04
@ -21,6 +21,9 @@ spec:
|
|||||||
image: quay.io/kata-containers/kata-deploy:latest
|
image: quay.io/kata-containers/kata-deploy:latest
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
command: [ "bash", "-c", "/opt/kata-artifacts/scripts/kata-deploy.sh reset" ]
|
command: [ "bash", "-c", "/opt/kata-artifacts/scripts/kata-deploy.sh reset" ]
|
||||||
|
readinessProbe:
|
||||||
|
exec:
|
||||||
|
command: [ "bash", "-c", "[ -f /opt/kata/kata-deployed ]", "&&", "bash", "-c", "[ $? == 1 ]" ]
|
||||||
env:
|
env:
|
||||||
- name: NODE_NAME
|
- name: NODE_NAME
|
||||||
valueFrom:
|
valueFrom:
|
||||||
|
@ -18,6 +18,9 @@ spec:
|
|||||||
- name: kube-kata
|
- name: kube-kata
|
||||||
image: quay.io/kata-containers/kata-deploy:latest
|
image: quay.io/kata-containers/kata-deploy:latest
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
|
readinessProbe:
|
||||||
|
exec:
|
||||||
|
command: [ "bash", "-c", "[ -f /opt/kata/kata-deployed ]", "&&", "bash", "-c", "[ $? == 0 ]" ]
|
||||||
lifecycle:
|
lifecycle:
|
||||||
preStop:
|
preStop:
|
||||||
exec:
|
exec:
|
||||||
|
@ -310,11 +310,13 @@ function main() {
|
|||||||
install_artifacts
|
install_artifacts
|
||||||
configure_cri_runtime "$runtime"
|
configure_cri_runtime "$runtime"
|
||||||
kubectl label node "$NODE_NAME" --overwrite katacontainers.io/kata-runtime=true
|
kubectl label node "$NODE_NAME" --overwrite katacontainers.io/kata-runtime=true
|
||||||
|
touch /opt/kata/kata-deployed
|
||||||
;;
|
;;
|
||||||
cleanup)
|
cleanup)
|
||||||
cleanup_cri_runtime "$runtime"
|
cleanup_cri_runtime "$runtime"
|
||||||
kubectl label node "$NODE_NAME" --overwrite katacontainers.io/kata-runtime=cleanup
|
kubectl label node "$NODE_NAME" --overwrite katacontainers.io/kata-runtime=cleanup
|
||||||
remove_artifacts
|
remove_artifacts
|
||||||
|
rm /opt/kata/kata-deployed
|
||||||
;;
|
;;
|
||||||
reset)
|
reset)
|
||||||
reset_runtime $runtime
|
reset_runtime $runtime
|
||||||
|
Loading…
Reference in New Issue
Block a user