Skip to content

Commit

Permalink
Merge pull request #3677 from kubernetes-sigs/release-3.13
Browse files Browse the repository at this point in the history
📖 Update the docs for release v3.13.0
  • Loading branch information
k8s-ci-robot committed Nov 3, 2023
2 parents b48f95c + c8a7cc5 commit de0d845
Show file tree
Hide file tree
Showing 356 changed files with 9,490 additions and 4,150 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/lint-sample.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copyright 2023 The Caramello-io Authors.

name: Sample Testdata Tests

on:
push:
pull_request:

jobs:
test:
name: "Testdata - make test"
runs-on: ubuntu-latest
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: Clone the code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '~1.20'
- name: Remove pre-installed kustomize
run: sudo rm -f /usr/local/bin/kustomize
- name: Run make test for project-v4-with-deploy-image
run: cd testdata/project-v4-with-deploy-image && go mod tidy && make all && make test
- name: Run make test for project-v4-multigroup-with-deploy-image
run: cd testdata/project-v4-multigroup-with-deploy-image && go mod tidy && make all && make test

lint:
name: "Testdata - Lint"
runs-on: ubuntu-latest
# Pull requests from the same repository won't trigger this checks as they were already triggered by the push
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '~1.20'
- name: Clone the code
uses: actions/checkout@v4
- name: Run linter
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
working-directory: testdata/project-v4-with-deploy-image
args: --config .golangci.yml ./...
skip-cache: true # first lint action will handle
- name: Run linter
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
working-directory: testdata/project-v4-multigroup-with-deploy-image
args: --config .golangci.yml ./...
skip-cache: true # first lint action will handle

1 change: 0 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
only-new-issues: true # Show only new issues if it's a pull request

yamllint:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
go-version: '~1.20'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
uses: goreleaser/goreleaser-action@v5
with:
version: v1.11.2
args: release -f ./build/.goreleaser.yml --rm-dist
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
steps:
- name: Verifier action
id: verifier
uses: kubernetes-sigs/kubebuilder-release-tools@v0.3.0
uses: kubernetes-sigs/kubebuilder-release-tools@v0.4.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ build: ## Build the project locally

.PHONY: install
install: build ## Build and install the binary with the current source code. Use it to test your changes locally.
rm -f $(GOBIN)/kubebuilder
cp ./bin/kubebuilder $(GOBIN)/kubebuilder

##@ Development
Expand Down Expand Up @@ -90,7 +91,7 @@ lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes

.PHONY: yamllint
yamllint:
@docker run --rm $$(tty -s && echo "-it" || echo) -v $(PWD):/data cytopia/yamllint:latest testdata -d "{extends: relaxed, rules: {line-length: {max: 120}}}" --no-warnings
@docker run --rm $$(tty -s && echo "-it" || echo) -v $(PWD):/data cytopia/yamllint:latest testdata -d '{extends: relaxed, rules: {line-length: {max: 120}}, ignore: "/testdata/project-v2/\n/testdata/project-v3/"}'

GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
golangci-lint:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ process was done to ensure that we have an aligned process under the org (simila
> **Note**
> - You will need to have checkout locally from the remote repository the previous branch
> - Also, ensure that you fetch all tags from the remote `git fetch --all --tags`
> - Also, if you face issues to generate the release notes you might want to able to sort it out by running i.e.:
> `go run sigs.k8s.io/kubebuilder-release-tools/notes --use-upstream=false --from=v3.11.0 --branch=release-X`

### Draft a new release from GitHub

Expand Down
5 changes: 5 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ import (
grafanav1alpha1 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/optional/grafana/v1alpha"
)

func init() {
// Disable timestamps on the default TextFormatter
logrus.SetFormatter(&logrus.TextFormatter{DisableTimestamp: true})
}

func main() {

const deprecateMessageGoV3Bundle = "This version is deprecated." +
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The kubebuilder book is served using [mdBook](https://github.com/rust-lang-nurse

1. Follow the instructions at [https://github.com/rust-lang-nursery/mdBook#installation](https://github.com/rust-lang-nursery/mdBook#installation) to
install mdBook.
2. Make sure [controller-gen](https://pkg.go.dev/sigs.k8s.io/controller-tools/cmd/controller-gen) is install in `$GOPATH`.
2. Make sure [controller-gen](https://pkg.go.dev/sigs.k8s.io/controller-tools/cmd/controller-gen) is installed in `$GOPATH`.
3. cd into the `docs/book` directory
4. Run `mdbook serve`
5. Visit [http://localhost:3000](http://localhost:3000)
Expand Down
8 changes: 6 additions & 2 deletions docs/book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

[Introduction](./introduction.md)

[Architecture](./architecture.md)

[Quick Start](./quick-start.md)

[Architecture](./architecture.md)
[Getting Started](./getting-started.md)

---

Expand Down Expand Up @@ -74,6 +76,8 @@
- [Migration by updating the files](migration/manually_migration_guide_gov3_to_gov4.md)
- [Single Group to Multi-Group](./migration/multi-group.md)

- [Project Upgrade Assistant](./reference/rescaffold.md)

---

- [Reference](./reference/reference.md)
Expand Down Expand Up @@ -121,7 +125,7 @@
- [go/v3 (Deprecated)](./plugins/go-v3-plugin.md)
- [go/v4 (Default init scaffold)](./plugins/go-v4-plugin.md)
- [To add optional features](./plugins/to-add-optional-features.md)
- [declarative/v1](./plugins/declarative-v1.md)
- [declarative/v1 (Deprecated)](./plugins/declarative-v1.md)
- [grafana/v1-alpha](./plugins/grafana-v1-alpha.md)
- [deploy-image/v1-alpha](./plugins/deploy-image-plugin-v1-alpha.md)
- [To be extended for others tools](./plugins/to-be-extended.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
run:
deadline: 5m
allow-parallel-runners: true

issues:
# don't skip warning about doc comments
# don't exclude the default set of lint
exclude-use-default: false
# restore some of the defaults
# (fill in the rest as needed)
exclude-rules:
- path: "api/*"
linters:
- lll
- path: "internal/*"
linters:
- dupl
- lll
linters:
disable-all: true
enable:
- dupl
- errcheck
- exportloopref
- goconst
- gocyclo
- gofmt
- goimports
- gosimple
- govet
- ineffassign
- lll
- misspell
- nakedret
- prealloc
- staticcheck
- typecheck
- unconvert
- unparam
- unused
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,22 @@ vet: ## Run go vet against code.
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out

GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.54.2
golangci-lint:
@[ -f $(GOLANGCI_LINT) ] || { \
set -e ;\
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) $(GOLANGCI_LINT_VERSION) ;\
}

.PHONY: lint
lint: golangci-lint ## Run golangci-lint linter & yamllint
$(GOLANGCI_LINT) run

.PHONY: lint-fix
lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
$(GOLANGCI_LINT) run --fix

##@ Build

.PHONY: build
Expand Down Expand Up @@ -139,7 +155,7 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest

## Tool Versions
KUSTOMIZE_VERSION ?= v5.1.1
KUSTOMIZE_VERSION ?= v5.2.1
CONTROLLER_TOOLS_VERSION ?= v0.13.0

.PHONY: kustomize
Expand Down
67 changes: 32 additions & 35 deletions docs/book/src/component-config-tutorial/testdata/project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,73 +5,70 @@
// TODO(user): An in-depth paragraph about your project and overview of use

## Getting Started
You’ll need a Kubernetes cluster to run against. You can use [KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or run against a remote cluster.
**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows).

### Running on the cluster
1. Install Instances of Custom Resources:
### Prerequisites
- go version v1.20.0+
- docker version 17.03+.
- kubectl version v1.11.3+.
- Access to a Kubernetes v1.11.3+ cluster.

```sh
kubectl apply -k config/samples/
```

2. Build and push your image to the location specified by `IMG`:
### To Deploy on the cluster
**Build and push your image to the location specified by `IMG`:**

```sh
make docker-build docker-push IMG=<some-registry>/project:tag
```

3. Deploy the controller to the cluster with the image specified by `IMG`:
**NOTE:** This image ought to be published in the personal registry you specified.
And it is required to have access to pull the image from the working environment.
Make sure you have the proper permission to the registry if the above commands don’t work.

**Install the CRDs into the cluster:**

```sh
make deploy IMG=<some-registry>/project:tag
make install
```

### Uninstall CRDs
To delete the CRDs from the cluster:
**Deploy the Manager to the cluster with the image specified by `IMG`:**

```sh
make uninstall
make deploy IMG=<some-registry>/project:tag
```

### Undeploy controller
UnDeploy the controller from the cluster:
> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin
privileges or be logged in as admin.

**Create instances of your solution**
You can apply the samples (examples) from the config/sample:

```sh
make undeploy
kubectl apply -k config/samples/
```

## Contributing
// TODO(user): Add detailed information on how you would like others to contribute to this project

### How it works
This project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).
>**NOTE**: Ensure that the samples has default values to test it out.
It uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/),
which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.

### Test It Out
1. Install the CRDs into the cluster:
### To Uninstall
**Delete the instances (CRs) from the cluster:**

```sh
make install
kubectl delete -k config/samples/
```

2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running):
**Delete the APIs(CRDs) from the cluster:**

```sh
make run
make uninstall
```

**NOTE:** You can also run this in one step by running: `make install run`

### Modifying the API definitions
If you are editing the API definitions, generate the manifests such as CRs or CRDs using:
**UnDeploy the controller from the cluster:**

```sh
make manifests
make undeploy
```

## Contributing
// TODO(user): Add detailed information on how you would like others to contribute to this project

**NOTE:** Run `make --help` for more information on all potential `make` targets

More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ patches:
#- path: patches/cainjection_in_projectconfigs.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch

# [WEBHOOK] To enable webhook, uncomment the following section
# the following config is for teaching kustomize how to do kustomization for CRDs.
configurations:
- kustomizeconfig.yaml

#configurations:
#- kustomizeconfig.yaml

This file was deleted.

This file was deleted.

Loading

0 comments on commit de0d845

Please sign in to comment.