Welcome to the Linux Foundation Forum!
Typeo Slide 7.13.a Deployment Rollbacks

Hi,
I tried to use the record function and thought I was fat fingering it. So I copied and pasted it from the slide.
kubectl create deploy ghost --image=ghost --record
I get this output.
unknown flag: --record
The Deployment doesn't seem to like the record switch.
Is there another I can try?
0
Comments
Hello,
Yes, good catch. The --record option now only works with changes to the deployment, no longer the creation. When the built in generator for run was removed the --record option no longer works.
You could use: kubectl run --generator=deployment/apps.v1beta1 oldstyle --image=nginx --record
You will get a deprecation warning, but it will work.
Then view the recorded info with: kubectl rollout history deployment oldstyle
I'll make sure to update the content.
Regards,
Is there a new way that isn't deprecated that I should be learning? I like the idea of annotations.
Or
kubectl create deployment ghost image=ghost
To create it. Then how do I add the recording after?
The manner of what is created and deprecated is not consistent, and the removal of the run generator wasn't well thought out, IMHO. Only the run --generator manner has the ability to add the comment at the same time as far as I know.
You would otherwise have to run a second command to annotate or record afterward.
Regards,
Hi,
can you write the two commands. I’d like to try that first. I’m ok with creating and then adding the annotation. I want to see how it works.
Thanks
Hello,
I wrote the command a few posts back:
If you create a deployment, such as kubectl create deployment newstyle --image=nginx it no longer accepts the record option. After it has been created you can use set,edit, apply etc and use the --record option to document the change.
Regards,
Thanks for the clarification.
Still not updated, just got hit by the same issue.
>
@MichalWiczynski,
It will be updated in the next course release.