13 lines
482 B
Bash
13 lines
482 B
Bash
#!/bin/bash
|
|
|
|
export name_space=ly
|
|
export new_tag=5.1.0
|
|
export deployment_name=cmii-uav-tower
|
|
|
|
image_prefix=$(kubectl -n ${name_space} get deployment ${deployment_name} -o=jsonpath='{.spec.template.spec.containers[*].image}' | cut -d":" -f1)
|
|
|
|
echo "image grep is => ${image_prefix}"
|
|
|
|
kubectl -n ${name_space} patch deployment ${deployment_name} -p "{\"spec\":{\"template\":{\"spec\":{\"containers\":[{\"name\":\"${deployment_name}\",\"image\": \"${image_prefix}:${new_tag}\"}]}}}}"
|
|
|