From 36ca271340bf413a99008cb1d58b9b0935c04878 Mon Sep 17 00:00:00 2001 From: Camila Macedo Date: Sun, 22 Sep 2024 10:40:14 +0100 Subject: [PATCH] (doc): remove Makefile Helpers This section is outdated and does not seems that we need to keep it. If any requirement raise about how to do something via Makefile we can add in the FAQ section instead --- docs/book/src/SUMMARY.md | 1 - docs/book/src/reference/makefile-helpers.md | 49 --------------------- docs/book/src/reference/reference.md | 1 - 3 files changed, 51 deletions(-) delete mode 100644 docs/book/src/reference/makefile-helpers.md diff --git a/docs/book/src/SUMMARY.md b/docs/book/src/SUMMARY.md index 67590e84a28..1fa60c0b946 100644 --- a/docs/book/src/SUMMARY.md +++ b/docs/book/src/SUMMARY.md @@ -110,7 +110,6 @@ - [Reference](./reference/metrics-reference.md) - - [Makefile Helpers](./reference/makefile-helpers.md) - [Project config](./reference/project-config.md) --- diff --git a/docs/book/src/reference/makefile-helpers.md b/docs/book/src/reference/makefile-helpers.md deleted file mode 100644 index 984c4a9f2f5..00000000000 --- a/docs/book/src/reference/makefile-helpers.md +++ /dev/null @@ -1,49 +0,0 @@ -# Makefile Helpers - -By default, the projects are scaffolded with a `Makefile`. You can customize and update this file as please you. Here, you will find some helpers that can be useful. - -## To debug with go-delve - -The projects are built with Go and you have a lot of ways to do that. One of the options would be use [go-delve](https://github.com/go-delve/delve) for it: - -```makefile -# Run with Delve for development purposes against the configured Kubernetes cluster in ~/.kube/config -# Delve is a debugger for the Go programming language. More info: https://github.com/go-delve/delve -run-delve: generate fmt vet manifests - go build -gcflags "all=-trimpath=$(shell go env GOPATH)" -o bin/manager main.go - dlv --listen=:2345 --headless=true --api-version=2 --accept-multiclient exec ./bin/manager -``` - -## To change the version of CRDs - -The `controller-gen` program (from [controller-tools](https://github.com/kubernetes-sigs/controller-tools)) -generates CRDs for kubebuilder projects, wrapped in the following `make` rule: - -```makefile -manifests: controller-gen - $(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases -``` - -`controller-gen` lets you specify what CRD API version to generate (either "v1", the default, or "v1beta1"). -You can direct it to generate a specific version by adding `crd:crdVersions={}` to your `CRD_OPTIONS`, -found at the top of your Makefile: - -```makefile -CRD_OPTIONS ?= "crd:crdVersions={v1beta1},preserveUnknownFields=false" - -manifests: controller-gen - $(CONTROLLER_GEN) rbac:roleName=manager-role $(CRD_OPTIONS) webhook paths="./..." output:crd:artifacts:config=config/crd/bases -``` - -## To get all the manifests without deploying - -By adding `make dry-run` you can get the patched manifests in the dry-run folder, unlike `make depĺoy` which runs `kustomize` and `kubectl apply`. - -To accomplish this, add the following lines to the Makefile: - -```makefile -dry-run: manifests - cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} - mkdir -p dry-run - $(KUSTOMIZE) build config/default > dry-run/manifests.yaml -``` diff --git a/docs/book/src/reference/reference.md b/docs/book/src/reference/reference.md index 6a40cafa4bd..c27215f42a8 100644 --- a/docs/book/src/reference/reference.md +++ b/docs/book/src/reference/reference.md @@ -40,5 +40,4 @@ - [Metrics](metrics.md) - [Reference](metrics-reference.md) - - [Makefile Helpers](makefile-helpers.md) - [CLI plugins](../plugins/plugins.md)