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.

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

  • serewicz
    serewicz Posts: 1,000

    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,

  • btanoue
    btanoue Posts: 59

    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?

  • serewicz
    serewicz Posts: 1,000

    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,

  • btanoue
    btanoue Posts: 59

    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

  • serewicz
    serewicz Posts: 1,000

    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,

  • btanoue
    btanoue Posts: 59

    Thanks for the clarification.

  • Still not updated, just got hit by the same issue.

    @serewicz said:
    I'll make sure to update the content.
    Regards,

    >

  • mstepien
    mstepien Posts: 469

    @MichalWiczynski,

    It will be updated in the next course release.

Categories

Upcoming Training