[oleg@workstation ~]$ cd src/cgit.wugi.info/wigust/
[oleg@workstation wigust]$ ls
dotfiles
[oleg@workstation wigust]$ ls dotfiles/
Jenkinsfile  deploy.sh             dot_ansible.cfg      dot_config     dot_gnus.el   dot_mailcap                          dot_myclirc           dot_sshrc              dotfiles             private_dot_vnc
Makefile     dhall                 dot_bash.d           dot_digrc      dot_groovy    dot_mongorc.js                       dot_nanorc            dot_sshrc.d            etc                  run-guix-workstation.sh
README.md    doc                   dot_bash_completion  dot_direnvrc   dot_guile     dot_muttrc_i18n.wugi_yandex.tmpl     dot_pythonrc          dot_stumpwm.d          guix.scm             src
apps         dot_Xmodmap           dot_bash_guix        dot_emacs      dot_inputrc   dot_muttrc_localhost.tmpl            dot_ratpoisonrc       dot_tmux.conf          infrastructure       stream
cilium       dot_Xresources        dot_bash_profile     dot_gdbinit    dot_keynavrc  dot_muttrc_oleg_wugi.tmpl            dot_sbcl_completions  dot_tmuxifier-layouts  majordomo            tests
clusters     dot_alerta.conf.tmpl  dot_bash_vterm       dot_ghci       dot_kodirc    dot_muttrc_test-mail_majordomo.tmpl  dot_screenrc          dot_toprc              private_dot_emacs.d  vosk
configure    dot_ansible           dot_bashrc           dot_gitconfig  dot_local     dot_muttrc_wigust_wugi.tmpl          dot_slacktee.tmpl     dot_xkb                private_dot_gnupg
[oleg@workstation wigust]$ mkdir
[oleg@workstation wigust]$ mkdir workstation-controller
[oleg@workstation wigust]$ cd workstation-controller
[oleg@workstation workstation-controller]$
[oleg@workstation workstation-controller]$ kubebuilder init --domain wugi.info --repo wugi.info/workstation-controller
INFO Writing kustomize manifests for you to edit...
INFO Writing scaffold for you to edit...
INFO Get controller runtime:
$ go get sigs.k8s.io/controller-runtime@v0.19.4
go: downloading sigs.k8s.io/controller-runtime v0.19.4
go: downloading k8s.io/apimachinery v0.31.0
go: downloading k8s.io/api v0.31.0
go: downloading github.com/go-logr/logr v1.4.2
go: downloading k8s.io/client-go v0.31.0
go: downloading k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
go: downloading k8s.io/klog/v2 v2.130.1
go: downloading golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc
go: downloading github.com/evanphx/json-patch/v5 v5.9.0
go: downloading github.com/prometheus/client_golang v1.19.1
go: downloading gomodules.xyz/jsonpatch/v2 v2.4.0
go: downloading k8s.io/apiextensions-apiserver v0.31.0
go: downloading github.com/gogo/protobuf v1.3.2
go: downloading sigs.k8s.io/structured-merge-diff/v4 v4.4.1
go: downloading github.com/google/gofuzz v1.2.0
go: downloading sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd
go: downloading k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340
go: downloading github.com/google/uuid v1.6.0
go: downloading github.com/pkg/errors v0.9.1
go: downloading github.com/prometheus/client_model v0.6.1
go: downloading github.com/prometheus/common v0.55.0
go: downloading github.com/fsnotify/fsnotify v1.7.0
go: downloading golang.org/x/net v0.26.0
go: downloading golang.org/x/time v0.3.0
go: downloading github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/imdario/mergo v0.3.6
go: downloading golang.org/x/term v0.21.0
go: downloading github.com/golang/protobuf v1.5.4
go: downloading github.com/google/gnostic-models v0.6.8
go: downloading gopkg.in/inf.v0 v0.9.1
go: downloading sigs.k8s.io/yaml v1.4.0
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/cespare/xxhash/v2 v2.3.0
go: downloading github.com/prometheus/procfs v0.15.1
go: downloading golang.org/x/sys v0.21.0
go: downloading google.golang.org/protobuf v1.34.2
go: downloading golang.org/x/oauth2 v0.21.0
go: downloading github.com/json-iterator/go v1.1.12
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/fxamacker/cbor/v2 v2.7.0
go: downloading github.com/google/go-cmp v0.6.0
go: downloading github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
go: downloading github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading golang.org/x/text v0.16.0
go: downloading github.com/go-openapi/jsonreference v0.20.2
go: downloading github.com/go-openapi/swag v0.22.4
go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: downloading github.com/x448/float16 v0.8.4
go: downloading github.com/modern-go/reflect2 v1.0.2
go: downloading github.com/emicklei/go-restful/v3 v3.11.0
go: downloading github.com/go-openapi/jsonpointer v0.19.6
go: downloading github.com/mailru/easyjson v0.7.7
go: downloading github.com/josharian/intern v1.0.0
INFO Update dependencies:
$ go mod tidy
go: downloading github.com/onsi/ginkgo/v2 v2.19.0
go: downloading github.com/onsi/gomega v1.33.1
go: downloading github.com/stretchr/testify v1.9.0
go: downloading k8s.io/apiserver v0.31.0
go: downloading github.com/go-logr/zapr v1.3.0
go: downloading go.uber.org/zap v1.26.0
go: downloading go.uber.org/goleak v1.3.0
go: downloading github.com/evanphx/json-patch v0.5.2
go: downloading gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
go: downloading gopkg.in/evanphx/json-patch.v4 v4.12.0
go: downloading github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
go: downloading github.com/kr/pretty v0.3.1
go: downloading github.com/rogpeppe/go-internal v1.12.0
go: downloading github.com/kr/text v0.2.0
go: downloading github.com/go-task/slim-sprig/v3 v3.0.0
go: downloading golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d
go: downloading github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af
go: downloading go.uber.org/multierr v1.11.0
go: downloading k8s.io/component-base v0.31.0
go: downloading golang.org/x/sync v0.7.0
go: downloading go.opentelemetry.io/otel/trace v1.28.0
go: downloading github.com/google/cel-go v0.20.1
go: downloading google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157
go: downloading go.opentelemetry.io/otel v1.28.0
go: downloading google.golang.org/grpc v1.65.0
go: downloading google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d
go: downloading sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3
go: downloading github.com/blang/semver/v4 v4.0.0
go: downloading go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0
go: downloading go.opentelemetry.io/otel/sdk v1.28.0
go: downloading go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0
go: downloading go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0
go: downloading github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a
go: downloading github.com/stoewer/go-strcase v1.2.0
go: downloading github.com/antlr4-go/antlr/v4 v4.13.0
go: downloading github.com/spf13/cobra v1.8.1
go: downloading google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094
go: downloading go.opentelemetry.io/otel/metric v1.28.0
go: downloading github.com/go-logr/stdr v1.2.2
go: downloading go.opentelemetry.io/proto/otlp v1.3.1
go: downloading github.com/cenkalti/backoff/v4 v4.3.0
go: downloading github.com/inconshreveable/mousetrap v1.1.0
go: downloading github.com/felixge/httpsnoop v1.0.4
go: downloading github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0
go: downloading github.com/grpc-ecosystem/grpc-gateway v1.16.0
Next: define a resource with:
$ kubebuilder create api
[oleg@workstation workstation-controller]$ echo kubebuilder init --domain wugi.info --repo wugi.info/workstation-controller >> todo.org
[oleg@workstation workstation-controller]$ kubebuilder create api --group workstation --version v1 --kind Workstation
INFO Create Resource [y/n]
y
INFO Create Controller [y/n]
y
INFO Writing kustomize manifests for you to edit...
INFO Writing scaffold for you to edit...
INFO api/v1/workstation_types.go
INFO api/v1/groupversion_info.go
INFO internal/controller/suite_test.go
INFO internal/controller/workstation_controller.go
INFO internal/controller/workstation_controller_test.go
INFO Update dependencies:
$ go mod tidy
INFO Running make:
$ make generate
mkdir -p /home/oleg/src/cgit.wugi.info/wigust/workstation-controller/bin
Downloading sigs.k8s.io/controller-tools/cmd/controller-gen@v0.17.0
go: downloading sigs.k8s.io/controller-tools v0.17.0
go: downloading golang.org/x/tools v0.28.0
go: downloading k8s.io/apiextensions-apiserver v0.32.0
go: downloading k8s.io/apimachinery v0.32.0
go: downloading k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738
go: downloading github.com/gobuffalo/flect v1.0.3
go: downloading k8s.io/api v0.32.0
go: downloading github.com/fatih/color v1.18.0
go: downloading github.com/mattn/go-isatty v0.0.20
go: downloading github.com/mattn/go-colorable v0.1.13
go: downloading golang.org/x/sys v0.28.0
go: downloading sigs.k8s.io/structured-merge-diff/v4 v4.4.2
go: downloading sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3
go: downloading golang.org/x/net v0.33.0
go: downloading golang.org/x/sync v0.10.0
go: downloading golang.org/x/mod v0.22.0
go: downloading golang.org/x/text v0.21.0
/home/oleg/src/cgit.wugi.info/wigust/workstation-controller/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
Next: implement your new API and generate the manifests (e.g. CRDs,CRs) with:
$ make manifests

[oleg@workstation workstation-controller]$ make install
/home/oleg/src/cgit.wugi.info/wigust/workstation-controller/bin/controller-gen rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
Downloading sigs.k8s.io/kustomize/kustomize/v5@v5.5.0
go: downloading sigs.k8s.io/kustomize/kustomize/v5 v5.5.0
go: downloading sigs.k8s.io/kustomize/kyaml v0.18.1
go: downloading sigs.k8s.io/kustomize/api v0.18.0
go: downloading sigs.k8s.io/kustomize/cmd/config v0.15.0
go: downloading github.com/spf13/cobra v1.8.0
go: downloading github.com/go-errors/errors v1.4.2
go: downloading k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00
go: downloading github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
go: downloading google.golang.org/protobuf v1.33.0
go: downloading github.com/sergi/go-diff v1.2.0
go: downloading github.com/xlab/treeprint v1.2.0
go: downloading github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00
go: downloading github.com/golang/protobuf v1.5.3
/home/oleg/src/cgit.wugi.info/wigust/workstation-controller/bin/kustomize build config/crd | kubectl apply -f -
customresourcedefinition.apiextensions.k8s.io/workstations.workstation.wugi.info created
