From 6471390eeaa99314cf324bf8128b362620daf1ea Mon Sep 17 00:00:00 2001 From: Majid Garoosi Date: Tue, 26 Sep 2023 10:51:40 +0330 Subject: [PATCH] Update kubebuilder demo svg in README --- README.md | 2 +- docs/gif/kb-demo.v3.11.1.svg | 1 + scripts/demo/README.md | 4 +++- scripts/demo/run.sh | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 docs/gif/kb-demo.v3.11.1.svg diff --git a/README.md b/README.md index 7ec6dd5ab8a..c1dc36984fa 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Follow the [instructions](https://book.kubebuilder.io/quick-start.html#installat See the [Getting Started](https://book.kubebuilder.io/quick-start.html) documentation. -![Quick Start](docs/gif/kb-demo.v2.0.1.svg) +![Quick Start](docs/gif/kb-demo.v3.11.1.svg) Also, ensure that you check out the [Deploy Image](https://book.kubebuilder.io/plugins/deploy-image-plugin-v1-alpha.html) Plugin. This plugin allows users to scaffold API/Controllers to deploy and manage an diff --git a/docs/gif/kb-demo.v3.11.1.svg b/docs/gif/kb-demo.v3.11.1.svg new file mode 100644 index 00000000000..4310d233cb3 --- /dev/null +++ b/docs/gif/kb-demo.v3.11.1.svg @@ -0,0 +1 @@ +$$#$#InitializeGomodules$gomodinitdemo.kubebuilder.iogo:creatingnewgo.mod:moduledemo.kubebuilder.io$#Let'sinitializetheproject$k$kub$kubebu$kubebuil$kubebuilder$kubebuilderinit--domaintutorial.kubebuilder.ioINFO[0000]Addingexternalplugin:sampleexternalpluginWritingkustomizemanifestsforyoutoedit...Writingscaffoldforyoutoedit...Getcontrollerruntime:$gogetsigs.k8s.io/controller-runtime@v0.15.0Updatedependencies:$gomodtidyNext:definearesourcewith:$kubebuildercreateapi##Examinescaffoldedfiles...$t$tre$tree..├──Dockerfile├──Makefile├──PROJECT├──README.md├──cmd└──main.go├──config├──default├──kustomization.yaml├──manager_auth_proxy_patch.yaml└──manager_config_patch.yaml├──manager└──manager.yaml├──prometheus└──monitor.yaml└──rbac├──auth_proxy_client_clusterrole.yaml├──auth_proxy_role.yaml├──auth_proxy_role_binding.yaml├──auth_proxy_service.yaml├──kustomization.yaml├──leader_election_role.yaml├──leader_election_role_binding.yaml├──role_binding.yaml└──service_account.yaml├──go.mod├──go.sum└──hack└──boilerplate.go.txt7directories,24files#Createourcustomcronjobapi$kubebuildercreateapi--groupbatch--versionv1--kindCronJobCreateResource[y/n]yCreateController[y/n]api/v1/cronjob_types.goapi/v1/groupversion_info.gointernal/controller/suite_test.gointernal/controller/cronjob_controller.goRunningmake:$makegeneratemkdir-p/tmp/kb-demo/bintest-s/tmp/kb-demo/bin/controller-gen&&/tmp/kb-demo/bin/controller-gen--version|grep-qv0.12.0||\GOBIN=/tmp/kb-demo/bingoinstallsigs.k8s.io/controller-tools/cmd/controller-gen@v0.12.0/tmp/kb-demo/bin/controller-genobject:headerFile="hack/boilerplate.go.txt"paths="./..."Next:implementyournewAPIandgeneratethemanifests(e.g.CRDs,CRs)with:$makemanifests#Let'stakealookattheAPIandControllerfiles$tree./api./internal/controller./api└──v1├──cronjob_types.go├──groupversion_info.go└──zz_generated.deepcopy.go./internal/controller├──cronjob_controller.go└──suite_test.go0directories,2files#InstallCRDsinKubernetescluster$m$mak$makeinstall/tmp/kb-demo/bin/controller-genrbac:roleName=manager-rolecrdwebhookpaths="./..."output:crd:artifacts:config=config/crd/basestest-s/tmp/kb-demo/bin/kustomize||GOBIN=/tmp/kb-demo/binGO111MODULE=ongoinstallsigs.k8s.io/kustomize/kustomize/v5@v5.0.1/tmp/kb-demo/bin/kustomizebuildconfig/crd|kubectlapply-f-customresourcedefinition.apiextensions.k8s.io/cronjobs.batch.tutorial.kubebuilder.iocreated#Runcontrollermanagerlocally$makerungofmt./...govet./...gorun./cmd/main.go2023-09-26T10:41:42+03:30INFOcontroller-runtime.metricsMetricsserverisstartingtolisten{"addr":":8080"}2023-09-26T10:41:42+03:30INFOsetupstartingmanager2023-09-26T10:41:42+03:30INFOstartingserver{"path":"/metrics","kind":"metrics","addr":"[::]:8080"}2023-09-26T10:41:42+03:30INFOStartingserver{"kind":"healthprobe","addr":"[::]:8081"}2023-09-26T10:41:42+03:30INFOStartingEventSource{"controller":"cronjob","controllerGroup":"batch.tutorial.kubebuilder.io","controllerKind":"CronJob","source":"kindsource:*v1.CronJob"}2023-09-26T10:41:42+03:30INFOStartingController{"controller":"cronjob","controllerGroup":"batch.tutorial.kubebuilder.io","controllerKind":"CronJob"}2023-09-26T10:41:42+03:30INFOStartingworkers{"controller":"cronjob","controllerGroup":"batch.tutorial.kubebuilder.io","controllerKind":"CronJob","workercount":1}^C2023-09-26T10:41:47+03:30INFOStoppingandwaitingfornonleaderelectionrunnables2023-09-26T10:41:47+03:30INFOshuttingdownserver{"path":"/metrics","kind":"metrics","addr":"[::]:8080"}2023-09-26T10:41:47+03:30INFOStoppingandwaitingforleaderelectionrunnables2023-09-26T10:41:47+03:30INFOShutdownsignalreceived,waitingforallworkerstofinish{"controller":"cronjob","controllerGroup":"batch.tutorial.kubebuilder.io","controllerKind":"CronJob"}2023-09-26T10:41:47+03:30INFOAllworkersfinished{"controller":"cronjob","controllerGroup":"batch.tutorial.kubebuilder.io","controllerKind":"CronJob"}2023-09-26T10:41:47+03:30INFOStoppingandwaitingforcaches$#I$#Init$#Initia$#Initializ$#Initialize$#InitializeGo$#InitializeGomo$#InitializeGomodul$g$go$gomod$gomodi$gomodinit$gomodinitd$gomodinitdemo$gomodinitdemo.k$gomodinitdemo.kube$gomodinitdemo.kubebu$gomodinitdemo.kubebuild$gomodinitdemo.kubebuilder$#L$#Let'$#Let's$#Let'sini$#Let'siniti$#Let'sinitiali$#Let'sinitialize$#Let'sinitializeth$#Let'sinitializethe$#Let'sinitializethepro$#Let'sinitializetheproje$kubebuilderi$kubebuilderinit$kubebuilderinit-$kubebuilderinit--do$kubebuilderinit--doma$kubebuilderinit--domain$kubebuilderinit--domaintu$kubebuilderinit--domaintutor$kubebuilderinit--domaintutoria$kubebuilderinit--domaintutorial.k$kubebuilderinit--domaintutorial.kub$kubebuilderinit--domaintutorial.kubebu$kubebuilderinit--domaintutorial.kubebuil$kubebuilderinit--domaintutorial.kubebuilder$kubebuilderinit--domaintutorial.kubebuilder.i#E#Exam#Examin#Examines#Examinesca#Examinescaffo#Examinescaffold#Examinescaffolded#Examinescaffoldedfi#Examinescaffoldedfiles#Examinescaffoldedfiles..#C#Crea#Create#Createou#Createour#Createourcus#Createourcusto#Createourcustomc#Createourcustomcro#Createourcustomcronjo#Createourcustomcronjob$kubebuilderc$kubebuildercrea$kubebuildercreate$kubebuildercreateap$kubebuildercreateapi$kubebuildercreateapi--g$kubebuildercreateapi--gro$kubebuildercreateapi--group$kubebuildercreateapi--groupba$kubebuildercreateapi--groupbatch$kubebuildercreateapi--groupbatch-$kubebuildercreateapi--groupbatch--ve$kubebuildercreateapi--groupbatch--vers$kubebuildercreateapi--groupbatch--version$kubebuildercreateapi--groupbatch--versionv$kubebuildercreateapi--groupbatch--versionv1-$kubebuildercreateapi--groupbatch--versionv1--k$kubebuildercreateapi--groupbatch--versionv1--kind$kubebuildercreateapi--groupbatch--versionv1--kindC$kubebuildercreateapi--groupbatch--versionv1--kindCron$kubebuildercreateapi--groupbatch--versionv1--kindCronJo#L#Let'#Let's#Let'stak#Let'stake#Let'stakeal#Let'stakealoo#Let'stakealooka#Let'stakealookat#Let'stakealookatthe#Let'stakealookattheA#Let'stakealookattheAPI#Let'stakealookattheAPIan#Let'stakealookattheAPIandC#Let'stakealookattheAPIandCon#Let'stakealookattheAPIandContro#Let'stakealookattheAPIandControll#Let'stakealookattheAPIandController#Let'stakealookattheAPIandControllerfi$tree./a$tree./api$tree./api./$tree./api./int$tree./api./inter$tree./api./internal$tree./api./internal/c$tree./api./internal/cont$tree./api./internal/contro$tree./api./internal/controlle#I#Inst#Instal#InstallC#InstallCRD#InstallCRDsi#InstallCRDsin#InstallCRDsinKub#InstallCRDsinKuber#InstallCRDsinKubernet#InstallCRDsinKubernetes#InstallCRDsinKubernetescl#InstallCRDsinKubernetesclus$makei$makeins$makeinstal#R#Run#Runco#Runcontr#Runcontrol#Runcontroller#Runcontrollerm#Runcontrollermana#Runcontrollermanage#Runcontrollermanagerl#Runcontrollermanagerloc#Runcontrollermanagerlocall$maker^C2023-09-26T10:41:47+03:30INFOStoppingandwaitingforwebhooks2023-09-26T10:41:47+03:30INFOWaitcompleted,proceedingtoshutdownthemanager \ No newline at end of file diff --git a/scripts/demo/README.md b/scripts/demo/README.md index cb33d6ddd7c..96f6fe6e4a1 100644 --- a/scripts/demo/README.md +++ b/scripts/demo/README.md @@ -20,6 +20,8 @@ cd /tmp/kb-demo asciinema rec /scripts/demo/run.sh +# After each step, press to proceed to the next step + to terminate the script to terminate the asciinema recording to save the recording locally @@ -27,5 +29,5 @@ asciinema rec # Edit the recorded file by editing the controller-gen path # Once you are happy with the recording, use svg-term program to generate the svg -svg-term --cast= --out demo.svg --window +svg-term --in= --out demo.svg --window ``` diff --git a/scripts/demo/run.sh b/scripts/demo/run.sh index 50837e0a2ec..bbd8980d647 100755 --- a/scripts/demo/run.sh +++ b/scripts/demo/run.sh @@ -32,7 +32,7 @@ run "kubebuilder create api --group batch --version v1 --kind CronJob" clear desc "Let's take a look at the API and Controller files" -run "tree ./api ./controllers" +run "tree ./api ./internal/controller" clear desc "Install CRDs in Kubernetes cluster"