Skip to content

Commit

Permalink
✨ (go/v4): upgrade to Support k8s 1.29 (#3749)
Browse files Browse the repository at this point in the history
- Upgrade from k8s 1.28 to 1.29
- Upgrade controller-runtime from 0.16.13 to 0.17.0
- Upgrade controller-tools from 0.13.0 to 0.14.0
- Revert change from tools in order to not let the setup for envtest relay on controller-runtime release branches
  • Loading branch information
camilamacedo86 committed Jan 28, 2024
1 parent c9b33d6 commit c09e66b
Show file tree
Hide file tree
Showing 107 changed files with 4,854 additions and 5,382 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test-sample-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
name: Run on Ubuntu
runs-on: ubuntu-latest
env:
KIND_K8S_VERSION: v1.28.0
tools_k8s_version: 1.28.0
kind_version: 0.15.0
KIND_K8S_VERSION: v1.29.0
tools_k8s_version: 1.29.0
kind_version: 0.20.0
steps:
- name: Clone the code
uses: actions/checkout@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.28.3
ENVTEST_K8S_VERSION = 1.29.0

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -164,8 +164,8 @@ GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-$(GOLANGCI_LINT_VERSION)

## Tool Versions
KUSTOMIZE_VERSION ?= v5.3.0
CONTROLLER_TOOLS_VERSION ?= v0.13.0
ENVTEST_VERSION ?= release-0.16
CONTROLLER_TOOLS_VERSION ?= v0.14.0
ENVTEST_VERSION ?= latest
GOLANGCI_LINT_VERSION ?= v1.54.2

.PHONY: kustomize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.13.0
controller-gen.kubebuilder.io/version: v0.14.0
name: projectconfigs.config.tutorial.kubebuilder.io
spec:
group: config.tutorial.kubebuilder.io
Expand All @@ -20,59 +20,71 @@ spec:
description: ProjectConfig is the Schema for the projectconfigs API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
cacheNamespace:
description: "CacheNamespace if specified restricts the manager's cache
to watch objects in the desired namespace Defaults to all namespaces
\n Note: If a namespace is specified, controllers can still Watch for
a cluster-scoped resource (e.g Node). For namespaced resources the
cache will only hold objects from the desired namespace."
description: |-
CacheNamespace if specified restricts the manager's cache to watch objects in
the desired namespace Defaults to all namespaces
Note: If a namespace is specified, controllers can still Watch for a
cluster-scoped resource (e.g Node). For namespaced resources the cache
will only hold objects from the desired namespace.
type: string
clusterName:
type: string
controller:
description: Controller contains global configuration options for controllers
description: |-
Controller contains global configuration options for controllers
registered within this manager.
properties:
cacheSyncTimeout:
description: CacheSyncTimeout refers to the time limit set to wait
for syncing caches. Defaults to 2 minutes if not set.
description: |-
CacheSyncTimeout refers to the time limit set to wait for syncing caches.
Defaults to 2 minutes if not set.
format: int64
type: integer
groupKindConcurrency:
additionalProperties:
type: integer
description: "GroupKindConcurrency is a map from a Kind to the number
of concurrent reconciliation allowed for that controller. \n When
a controller is registered within this manager using the builder
utilities, users have to specify the type the controller reconciles
in the For(...) call. If the object's kind passed matches one of
the keys in this map, the concurrency for that controller is set
to the number specified. \n The key is expected to be consistent
in form with GroupKind.String(), e.g. ReplicaSet in apps group (regardless
of version) would be `ReplicaSet.apps`."
description: |-
GroupKindConcurrency is a map from a Kind to the number of concurrent reconciliation
allowed for that controller.
When a controller is registered within this manager using the builder utilities,
users have to specify the type the controller reconciles in the For(...) call.
If the object's kind passed matches one of the keys in this map, the concurrency
for that controller is set to the number specified.
The key is expected to be consistent in form with GroupKind.String(),
e.g. ReplicaSet in apps group (regardless of version) would be `ReplicaSet.apps`.
type: object
recoverPanic:
description: RecoverPanic indicates if panics should be recovered.
type: boolean
type: object
gracefulShutDown:
description: GracefulShutdownTimeout is the duration given to runnable
to stop before the manager actually returns on stop. To disable graceful
shutdown, set to time.Duration(0) To use graceful shutdown without timeout,
set to a negative duration, e.G. time.Duration(-1) The graceful shutdown
is skipped for safety reasons in case the leader election lease is lost.
description: |-
GracefulShutdownTimeout is the duration given to runnable to stop before the manager actually returns on stop.
To disable graceful shutdown, set to time.Duration(0)
To use graceful shutdown without timeout, set to a negative duration, e.G. time.Duration(-1)
The graceful shutdown is skipped for safety reasons in case the leader election lease is lost.
type: string
health:
description: Health contains the controller health configuration
properties:
healthProbeBindAddress:
description: HealthProbeBindAddress is the TCP address that the controller
should bind to for serving health probes It can be set to "0" or
"" to disable serving the health probe.
description: |-
HealthProbeBindAddress is the TCP address that the controller should bind to
for serving health probes
It can be set to "0" or "" to disable serving the health probe.
type: string
livenessEndpointName:
description: LivenessEndpointName, defaults to "healthz"
Expand All @@ -82,49 +94,60 @@ spec:
type: string
type: object
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
leaderElection:
description: LeaderElection is the LeaderElection config to be used when
configuring the manager.Manager leader election
description: |-
LeaderElection is the LeaderElection config to be used when configuring
the manager.Manager leader election
properties:
leaderElect:
description: leaderElect enables a leader election client to gain
leadership before executing the main loop. Enable this when running
replicated components for high availability.
description: |-
leaderElect enables a leader election client to gain leadership
before executing the main loop. Enable this when running replicated
components for high availability.
type: boolean
leaseDuration:
description: leaseDuration is the duration that non-leader candidates
will wait after observing a leadership renewal until attempting
to acquire leadership of a led but unrenewed leader slot. This is
effectively the maximum duration that a leader can be stopped before
it is replaced by another candidate. This is only applicable if
leader election is enabled.
description: |-
leaseDuration is the duration that non-leader candidates will wait
after observing a leadership renewal until attempting to acquire
leadership of a led but unrenewed leader slot. This is effectively the
maximum duration that a leader can be stopped before it is replaced
by another candidate. This is only applicable if leader election is
enabled.
type: string
renewDeadline:
description: renewDeadline is the interval between attempts by the
acting master to renew a leadership slot before it stops leading.
This must be less than or equal to the lease duration. This is only
applicable if leader election is enabled.
description: |-
renewDeadline is the interval between attempts by the acting master to
renew a leadership slot before it stops leading. This must be less
than or equal to the lease duration. This is only applicable if leader
election is enabled.
type: string
resourceLock:
description: resourceLock indicates the resource object type that
will be used to lock during leader election cycles.
description: |-
resourceLock indicates the resource object type that will be used to lock
during leader election cycles.
type: string
resourceName:
description: resourceName indicates the name of resource object that
will be used to lock during leader election cycles.
description: |-
resourceName indicates the name of resource object that will be used to lock
during leader election cycles.
type: string
resourceNamespace:
description: resourceName indicates the namespace of resource object
that will be used to lock during leader election cycles.
description: |-
resourceName indicates the namespace of resource object that will be used to lock
during leader election cycles.
type: string
retryPeriod:
description: retryPeriod is the duration the clients should wait between
attempting acquisition and renewal of a leadership. This is only
applicable if leader election is enabled.
description: |-
retryPeriod is the duration the clients should wait between attempting
acquisition and renewal of a leadership. This is only applicable if
leader election is enabled.
type: string
required:
- leaderElect
Expand All @@ -141,9 +164,10 @@ spec:
description: Metrics contains the controller metrics configuration
properties:
bindAddress:
description: BindAddress is the TCP address that the controller should
bind to for serving prometheus metrics. It can be set to "0" to
disable the metrics serving.
description: |-
BindAddress is the TCP address that the controller should bind to
for serving prometheus metrics.
It can be set to "0" to disable the metrics serving.
type: string
type: object
spec:
Expand All @@ -158,31 +182,33 @@ spec:
description: ProjectConfigStatus defines the observed state of ProjectConfig
type: object
syncPeriod:
description: SyncPeriod determines the minimum frequency at which watched
resources are reconciled. A lower period will correct entropy more quickly,
but reduce responsiveness to change if there are many watched resources.
Change this value only if you know what you are doing. Defaults to 10
hours if unset. there will a 10 percent jitter between the SyncPeriod
of all controllers so that all controllers will not send list requests
simultaneously.
description: |-
SyncPeriod determines the minimum frequency at which watched resources are
reconciled. A lower period will correct entropy more quickly, but reduce
responsiveness to change if there are many watched resources. Change this
value only if you know what you are doing. Defaults to 10 hours if unset.
there will a 10 percent jitter between the SyncPeriod of all controllers
so that all controllers will not send list requests simultaneously.
type: string
webhook:
description: Webhook contains the controllers webhook configuration
properties:
certDir:
description: CertDir is the directory that contains the server key
and certificate. if not set, webhook server would look up the server
key and certificate in {TempDir}/k8s-webhook-server/serving-certs.
The server key and certificate must be named tls.key and tls.crt,
respectively.
description: |-
CertDir is the directory that contains the server key and certificate.
if not set, webhook server would look up the server key and certificate in
{TempDir}/k8s-webhook-server/serving-certs. The server key and certificate
must be named tls.key and tls.crt, respectively.
type: string
host:
description: Host is the hostname that the webhook server binds to.
description: |-
Host is the hostname that the webhook server binds to.
It is used to set webhook.Server.Host.
type: string
port:
description: Port is the port that the webhook server serves at. It
is used to set webhook.Server.Port.
description: |-
Port is the port that the webhook server serves at.
It is used to set webhook.Server.Port.
type: integer
type: object
type: object
Expand Down

0 comments on commit c09e66b

Please sign in to comment.