Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
af81fa1
Fix misspelling in book introduction
pjbgf Oct 31, 2021
5616b95
Merge pull request #2415 from pjbgf/master
k8s-ci-robot Nov 1, 2021
7c3fdc4
Update cert-manager installation url since it changed
rocrisp Nov 10, 2021
4990c4e
Merge pull request #2418 from rocrisp/certmanagerlink
k8s-ci-robot Nov 11, 2021
c33da2d
Remove unused removeString function
yozel Nov 16, 2021
6f91f0f
Merge pull request #2420 from yozel/master
k8s-ci-robot Nov 17, 2021
efda3e7
update word error of til
lonelyCZ Nov 22, 2021
bc4381c
Merge pull request #2422 from lonelyCZ/master
k8s-ci-robot Nov 22, 2021
d64c1bd
:book: Utilize controllerutil.ContainsFinalizer inside kubebuilder bo…
dmvolod Nov 25, 2021
ef5364a
Add style guide to the Contribution doc
sayantani11 Nov 26, 2021
2526ae5
Merge pull request #2427 from sayantani11/issue2423
k8s-ci-robot Nov 26, 2021
e51c785
Merge pull request #2426 from dmvolod/issue-2425
k8s-ci-robot Nov 28, 2021
4a97f8c
Add resource requests and limits to kube-rbac-proxy
fgiloux Nov 29, 2021
4ef2eb6
Merge pull request #2429 from fgiloux/master
k8s-ci-robot Dec 1, 2021
85aa9e0
fix link for controllermanager component config
varshaprasad96 Dec 2, 2021
4904573
Bump golang.org/x/text to v0.3.7
pjbgf Dec 2, 2021
a184cb1
Merge pull request #2436 from varshaprasad96/fix/link-componentconfig
k8s-ci-robot Dec 3, 2021
c7d73bc
remove debug logging from the manager auth proxy patch
geezyx Dec 2, 2021
c869ec1
Merge pull request #2435 from geezyx/master
k8s-ci-robot Dec 3, 2021
0036a35
Merge pull request #2438 from pjbgf/bump-text
k8s-ci-robot Dec 5, 2021
60fa3a4
add notes for docker build/pull commands
ycyaoxdu Dec 10, 2021
e0c0bb5
update docs to fix typo
anfoxtrot Dec 11, 2021
11426d5
Update docs/book/src/cronjob-tutorial/running-webhook.md
ycyaoxdu Dec 13, 2021
771ff9e
add email to commit
anfoxtrot Dec 13, 2021
3caf64a
Update go version to 1.17
ryantking Dec 13, 2021
9155233
Merge pull request #2445 from anfoxtrot/docs/cli-init-cmd-typo
k8s-ci-robot Dec 13, 2021
f4dbb5c
Merge pull request #2441 from ycyaoxdu/book-tutorial1-modify
k8s-ci-robot Dec 13, 2021
6ac7704
fix typos
devinleee Dec 20, 2021
83fcc5f
Merge pull request #2454 from yuswift/fix-docs
k8s-ci-robot Jan 6, 2022
f6c27b5
update license header to 2022
ryantking Jan 6, 2022
019c185
Merge pull request #2472 from ryantking/2022_license
k8s-ci-robot Jan 6, 2022
d16bf5e
Merge branch 'master' into go1.17
ryantking Jan 6, 2022
0108a48
go mod tidy
ryantking Jan 6, 2022
b772ff9
regenerate everything
ryantking Jan 6, 2022
d572e54
Merge pull request #2446 from ryantking/go1.17
k8s-ci-robot Jan 6, 2022
84c45ff
Update reference links
buraksekili Dec 22, 2021
c8b0546
:warning: (go/v3) upgrade controller-runtime from 0.10.0 to 0.11.0 an…
ankitm123 Jan 6, 2022
6e99dc7
Merge pull request #2455 from buraksekili/cronjob-example
k8s-ci-robot Jan 11, 2022
acdede5
:warning: (go/v3) upgrade controller-runtime from 0.10.0 to 0.11.0, k…
camilamacedo86 Jan 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/apidiff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.16'
go-version: '1.17'
- name: Execute go-apidiff
uses: joelanford/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.16'
go-version: '1.17'
- name: Remove pre-installed kustomize
# This step is needed as the following one tries to remove
# kustomize for each test but has no permission to do so
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.16'
go-version: '1.17'
# This step is needed as the following one tries to remove
# kustomize for each test but has no permission to do so
- name: Remove pre-installed kustomize
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.16'
go-version: '1.17'
- name: Generate the coverage output
run: make test-coverage
- name: Send the coverage output
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ The docs are published off of three branches:

See [VERSIONING.md](VERSIONING.md#book-releases) for more information.

There are certain writing style guidelines for Kubernetes documentation, checkout [style guide](https://kubernetes.io/docs/contribute/style/style-guide/) for more information.

### How to preview the changes performed in the docs

Check the CI job after to do the Pull Request and then, click on in the `Details` of `netlify/kubebuilder/deploy-preview`
Expand Down
2 changes: 1 addition & 1 deletion build/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ builds:
- linux_ppc64le
- darwin_amd64
env:
- KUBERNETES_VERSION=1.22.1
- KUBERNETES_VERSION=1.23.1
- CGO_ENABLED=0

# Only binaries of the form "kubebuilder_${goos}_${goarch}" will be released.
Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/component-config-tutorial/api-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var configFile string
flag.StringVar(&configFile, "config", "",
"The controller will load its initial configuration from this file. "+
"Omit this flag to use the default configuration values. "+
"Command-line flags override configuration from this file."
"Command-line flags override configuration from this file.")
```

Now, we can setup the `Options` struct and check if the `configFile` is set,
Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/component-config-tutorial/define-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ values that are passed into the controller, to do this we can take a look at
To see all the available fields you can look at the `v1alpha` Controller
Runtime config [ControllerManagerConfiguration](configtype)

[configtype]: https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/config/v1alpha1/#ControllerManagerConfigurationSpec
[configtype]: https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/config/v1alpha1#ControllerManagerConfigurationSpec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.16 as builder
FROM golang:1.17 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021 The Kubernetes authors.
Copyright 2022 The Kubernetes authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021 The Kubernetes authors.
Copyright 2022 The Kubernetes authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 62 additions & 1 deletion docs/book/src/component-config-tutorial/testdata/project/go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,70 @@
module tutorial.kubebuilder.io/project

go 1.16
go 1.17

require (
k8s.io/apimachinery v0.21.2
k8s.io/client-go v0.21.2
sigs.k8s.io/controller-runtime v0.9.2
)

require (
cloud.google.com/go v0.54.0 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.12 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.5 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.0 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/evanphx/json-patch v4.11.0+incompatible // indirect
github.com/form3tech-oss/jwt-go v3.2.2+incompatible // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/go-logr/logr v0.4.0 // indirect
github.com/go-logr/zapr v0.4.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.5 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/json-iterator/go v1.1.11 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.11.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.26.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.17.0 // indirect
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 // indirect
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 // indirect
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 // indirect
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect
golang.org/x/text v0.3.6 // indirect
golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.26.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/api v0.21.2 // indirect
k8s.io/apiextensions-apiserver v0.21.2 // indirect
k8s.io/component-base v0.21.2 // indirect
k8s.io/klog/v2 v2.8.0 // indirect
k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 // indirect
k8s.io/utils v0.0.0-20210527160623-6fdb442a123b // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.1.0 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021 The Kubernetes authors.
Copyright 2022 The Kubernetes authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021 The Kubernetes authors.
Copyright 2022 The Kubernetes authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/cronjob-tutorial/cert-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ provisioning the certificates for the webhook server. Other solutions should
also work as long as they put the certificates in the desired location.

You can follow
[the cert manager documentation](https://docs.cert-manager.io/en/latest/getting-started/install/kubernetes.html)
[the cert manager documentation](https://cert-manager.io/docs/installation/)
to install it.

Cert manager also has a component called CA injector, which is responsible for
Expand Down
3 changes: 3 additions & 0 deletions docs/book/src/cronjob-tutorial/cronjob-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,6 @@ Otherwise `--repo=<module path>` must be set.
Read the [Go modules blogpost][go-modules-blogpost] if unfamiliar with the module system.

</aside>

[GOPATH-golang-docs]: https://golang.org/doc/code.html#GOPATH
[go-modules-blogpost]: https://blog.golang.org/using-go-modules
8 changes: 4 additions & 4 deletions docs/book/src/cronjob-tutorial/running-webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ You need to follow [this](./cert-manager.md) to install the cert manager bundle.
Run the following command to build your image locally.

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

You don't need to push the image to a remote container registry if you are using
a kind cluster. You can directly load your local image to your kind cluster:
a kind cluster. You can directly load your local image to your specified kind cluster:

```bash
kind load docker-image your-image-name:your-tag
kind load docker-image <your-image-name>:tag --name <your-kind-cluster-name>
```

## Deploy Webhooks
Expand All @@ -50,7 +50,7 @@ Now you can deploy it to your cluster by
make deploy IMG=<some-registry>/<project-name>:tag
```

Wait a while til the webhook pod comes up and the certificates are provisioned.
Wait a while till the webhook pod comes up and the certificates are provisioned.
It usually completes within 1 minute.

Now you can create a valid CronJob to test your webhooks. The creation should
Expand Down
8 changes: 8 additions & 0 deletions docs/book/src/cronjob-tutorial/running.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,13 @@ make docker-build docker-push IMG=<some-registry>/<project-name>:tag
make deploy IMG=<some-registry>/<project-name>:tag
```

<aside class="note">
<h1>registry permission</h1>

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.

</aside>

If we list cronjobs again like we did before, we should see the controller
functioning again!
2 changes: 1 addition & 1 deletion docs/book/src/cronjob-tutorial/testdata/emptyapi.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021.
Copyright 2022.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/cronjob-tutorial/testdata/emptycontroller.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021.
Copyright 2022.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/cronjob-tutorial/testdata/emptymain.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021 The Kubernetes authors.
Copyright 2022 The Kubernetes authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
23 changes: 2 additions & 21 deletions docs/book/src/cronjob-tutorial/testdata/finalizer_example.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ func (r *CronJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
// The object is not being deleted, so if it does not have our finalizer,
// then lets add the finalizer and update the object. This is equivalent
// registering our finalizer.
if !containsString(cronJob.GetFinalizers(), myFinalizerName) {
if !controllerutil.ContainsFinalizer(cronJob, myFinalizerName) {
controllerutil.AddFinalizer(cronJob, myFinalizerName)
if err := r.Update(ctx, cronJob); err != nil {
return ctrl.Result{}, err
}
}
} else {
// The object is being deleted
if containsString(cronJob.GetFinalizers(), myFinalizerName) {
if controllerutil.ContainsFinalizer(cronJob, myFinalizerName) {
// our finalizer is present, so lets handle any external dependency
if err := r.deleteExternalResources(cronJob); err != nil {
// if fail to delete the external dependency here, return with error
Expand Down Expand Up @@ -106,22 +106,3 @@ func (r *Reconciler) deleteExternalResources(cronJob *batch.CronJob) error {
// multiple times for same object.
}

// Helper functions to check and remove string from a slice of strings.
func containsString(slice []string, s string) bool {
for _, item := range slice {
if item == s {
return true
}
}
return false
}

func removeString(slice []string, s string) (result []string) {
for _, item := range slice {
if item == s {
continue
}
result = append(result, item)
}
return
}
2 changes: 1 addition & 1 deletion docs/book/src/cronjob-tutorial/testdata/project/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.16 as builder
FROM golang:1.17 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021 The Kubernetes authors.
Copyright 2022 The Kubernetes authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021 The Kubernetes authors.
Copyright 2022 The Kubernetes authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021 The Kubernetes authors.
Copyright 2022 The Kubernetes authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021 The Kubernetes authors.
Copyright 2022 The Kubernetes authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021 The Kubernetes authors.
Copyright 2022 The Kubernetes authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ First, it will contain the necessary imports.
*/

/*
Copyright 2021 The Kubernetes authors.
Copyright 2022 The Kubernetes authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Loading