I am creating a deployment and using imperative command i was able to create one.
Then I created a yaml file and was trying to specify the strategy type as a rolling update with parameters maxUnavailable and maxSurge. Having said that where i struggled was to find the exact syntax that i should be putting within yaml file for maxUnavailable and maxSurge.
I searched in the documentation but could not find the exact syntax for these 2 parameters for a yaml file. Refer to the attached screenshot.
Can someone guide me on how I should perform a search so that i land the exact syntax that should be specified in the yaml file? Does the documentation does not contain examples of these 2 parameters ( maxUnavailable and maxSurge) in a yaml format ?
Hi @Neeraj Vasudeva fyr:
Thanks @unnivkn., this help !
Apparently, when i was trying earlier, i used --dry-run=client which prevented this syntax to be generated. Refer to the below screenshot specifically highlighted in yellow vs green.
Could you also point me to the actual documentation page/link where it’s shown in yaml format like this?
Also please check/validate the difference in the code between
k run webapp --image=nginx --dry-run=client -oyaml &
k run webapp --image=nginx --dry-run=server -oyaml
@unnivkn Well, the link that you posted doesn’t have any ref. to maxUnavailable and maxSurge and that’s where i struggled and spent good amount of time within doc. while i was doing the lightning lab.
With regards to the code that you posted, I ran that and I see that the --dry-run=server produces a lot more information compared to the --dry-run=client version. Thanks for the tip.
I have always been using --dry-run=client as shown in the course.
Would you say that I should switch to --dry-run=server for generating the syntax?
yup… you will get that code only with
--dry-run=server, or else you have to create a deployment & try to get the code with
k get deploy <deploy-name> -o yaml command. I agree with you, k8s docs are not full fledged, few items we need to explore & find out.