Welcome to the new 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.

Use "kubectl options" for a list of global command-line options (applies to all commands).

unknown flag: --record

The Deployment doesn't seem to like the record switch.
Is there another I can try?

Comments

  • serewiczserewicz Posts: 497

    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,

  • btanouebtanoue Posts: 53

    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?

  • serewiczserewicz Posts: 497

    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,

  • btanouebtanoue Posts: 53

    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

  • serewiczserewicz Posts: 497

    Hello,
    I wrote the command a few posts back:

    You could use: kubectl run --generator=deployment/apps.v1beta1 oldstyle --image=nginx --record
    You will get a deprecation warning, but it will work.

    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,

  • btanouebtanoue Posts: 53

    Thanks for the clarification.

Sign In or Register to comment.