Skip to content

Commit

Permalink
Update Kubernetes to v1.29.0+k3s1 (k3s-io#9052)
Browse files Browse the repository at this point in the history
* Update to v1.29.0

Signed-off-by: galal-hussein <[email protected]>

* Update to v1.29.0

Signed-off-by: galal-hussein <[email protected]>

* Update go to 1.21.5

Signed-off-by: galal-hussein <[email protected]>

* update golangci-lint

Signed-off-by: galal-hussein <[email protected]>

* update flannel to 0.23.0-k3s1

This update uses k3s' fork of flannel to allow the removal of
multicluster cidr flag logic from the code

Signed-off-by: galal-hussein <[email protected]>

* fix flannel calls

Signed-off-by: galal-hussein <[email protected]>

* update cri-tools to version v1.29.0-k3s1

Signed-off-by: galal-hussein <[email protected]>

* Remove GOEXPERIMENT=nounified from arm builds

Signed-off-by: galal-hussein <[email protected]>

* Skip golangci-lint

Signed-off-by: galal-hussein <[email protected]>

* Fix setup logging with newer go version

Signed-off-by: galal-hussein <[email protected]>

* Move logging flags to components arguments

Signed-off-by: galal-hussein <[email protected]>

* add sysctl commands to the test script

Signed-off-by: galal-hussein <[email protected]>

* Update scripts/test

Signed-off-by: Brad Davidson <[email protected]>

* disable secretsencryption tests

Signed-off-by: galal-hussein <[email protected]>

---------

Signed-off-by: galal-hussein <[email protected]>
Signed-off-by: Brad Davidson <[email protected]>
Co-authored-by: Brad Davidson <[email protected]>
  • Loading branch information
galal-hussein and brandond authored Dec 19, 2023
1 parent bf3f29f commit 7101af3
Show file tree
Hide file tree
Showing 19 changed files with 311 additions and 226 deletions.
4 changes: 0 additions & 4 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -646,10 +646,6 @@ steps:
- vagrant destroy -f
- go test -v -timeout=45m ./validatecluster_test.go -ci -local
- cp ./coverage.out /tmp/artifacts/validate-coverage.out
- cd ../secretsencryption
- vagrant destroy -f
- go test -v -timeout=30m ./secretsencryption_test.go -ci -local
- cp ./coverage.out /tmp/artifacts/se-coverage.out
- cd ../startup
- vagrant destroy -f
- go test -v -timeout=30m ./startup_test.go -ci -local
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: '1.20.11'
go-version: '1.21.5'
check-latest: true
cache: true
cache-dependency-path: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unitcoverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: '1.20.11'
go-version: '1.21.5'
check-latest: true
cache: true
cache-dependency-path: |
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.dapper
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GOLANG=golang:1.20.11-alpine3.18
ARG GOLANG=golang:1.21.5-alpine3.18
FROM ${GOLANG}

# Set proxy environment variables
Expand Down Expand Up @@ -43,7 +43,7 @@ RUN rm -rf /go/src /go/pkg

# Install golangci-lint for amd64
RUN if [ "$(go env GOARCH)" = "amd64" ]; then \
curl -sL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.51.2; \
curl -sL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.55.2; \
fi

# Set SELINUX environment variable
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.local
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GOLANG=golang:1.20.11-alpine3.18
ARG GOLANG=golang:1.21.5-alpine3.18
FROM ${GOLANG} as infra

ARG http_proxy=$http_proxy
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.manifest
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GOLANG=golang:1.20.11-alpine3.18
ARG GOLANG=golang:1.21.5-alpine3.18
FROM ${GOLANG}

COPY --from=plugins/manifest:1.2.3 /bin/* /bin/
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GOLANG=golang:1.20.11-alpine3.18
ARG GOLANG=golang:1.21.5-alpine3.18
FROM ${GOLANG} as test-base

RUN apk -U --no-cache add bash jq
Expand Down Expand Up @@ -44,7 +44,7 @@ RUN vagrant box add generic/ubuntu2004 --provider libvirt --force
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"; \
chmod +x ./kubectl; \
mv ./kubectl /usr/local/bin/kubectl
RUN GO_VERSION=go1.20.11; \
RUN GO_VERSION=go1.21.5; \
curl -O -L "https://golang.org/dl/${GO_VERSION}.linux-amd64.tar.gz"; \
rm -rf /usr/local/go; \
tar -C /usr/local -xzf ${GO_VERSION}.linux-amd64.tar.gz;
Expand Down
185 changes: 94 additions & 91 deletions go.mod

Large diffs are not rendered by default.

247 changes: 138 additions & 109 deletions go.sum

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions pkg/agent/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,10 @@ func get(ctx context.Context, envInfo *cmds.Agent, proxy proxy.Proxy) (*config.N
nodeConfig.AgentConfig.PodManifests = filepath.Join(envInfo.DataDir, "agent", DefaultPodManifestPath)
nodeConfig.AgentConfig.ProtectKernelDefaults = envInfo.ProtectKernelDefaults
nodeConfig.AgentConfig.DisableServiceLB = envInfo.DisableServiceLB
nodeConfig.AgentConfig.VLevel = cmds.LogConfig.VLevel
nodeConfig.AgentConfig.VModule = cmds.LogConfig.VModule
nodeConfig.AgentConfig.LogFile = cmds.LogConfig.LogFile
nodeConfig.AgentConfig.AlsoLogToStderr = cmds.LogConfig.AlsoLogToStderr

if err := validateNetworkConfig(nodeConfig); err != nil {
return nil, err
Expand Down
3 changes: 1 addition & 2 deletions pkg/agent/flannel/flannel.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ func flannel(ctx context.Context, flannelIface *net.Interface, flannelConf, kube
kubeConfigFile,
FlannelBaseAnnotation,
flannelConf,
false,
multiClusterCIDR)
false)
if err != nil {
return errors.Wrap(err, "failed to create the SubnetManager")
}
Expand Down
6 changes: 0 additions & 6 deletions pkg/cli/cmds/log.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package cmds

import (
"flag"
"fmt"
"strconv"
"sync"
"time"

Expand Down Expand Up @@ -73,10 +71,6 @@ func checkUnixTimestamp() error {
}

func setupLogging() {
flag.Set("v", strconv.Itoa(LogConfig.VLevel))
flag.Set("vmodule", LogConfig.VModule)
flag.Set("alsologtostderr", strconv.FormatBool(Debug))
flag.Set("logtostderr", strconv.FormatBool(!Debug))
if Debug {
logrus.SetLevel(logrus.DebugLevel)
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/cli/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
serverConfig.ControlConfig.EncryptSecrets = cfg.EncryptSecrets
serverConfig.ControlConfig.EtcdExposeMetrics = cfg.EtcdExposeMetrics
serverConfig.ControlConfig.EtcdDisableSnapshots = cfg.EtcdDisableSnapshots
serverConfig.ControlConfig.VLevel = cmds.LogConfig.VLevel
serverConfig.ControlConfig.VModule = cmds.LogConfig.VModule

if !cfg.EtcdDisableSnapshots || cfg.ClusterReset {
serverConfig.ControlConfig.EtcdSnapshotCompress = cfg.EtcdSnapshotCompress
Expand Down
20 changes: 19 additions & 1 deletion pkg/daemons/agent/agent_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net"
"os"
"path/filepath"
"strconv"
"strings"

"github.com/k3s-io/k3s/pkg/cgroups"
Expand Down Expand Up @@ -49,6 +50,18 @@ func kubeProxyArgs(cfg *config.Agent) map[string]string {
if cfg.NodeName != "" {
argsMap["hostname-override"] = cfg.NodeName
}
if cfg.VLevel != 0 {
argsMap["v"] = strconv.Itoa(cfg.VLevel)
}
if cfg.VModule != "" {
argsMap["vmodule"] = cfg.VModule
}
if cfg.LogFile != "" {
argsMap["log_file"] = cfg.LogFile
}
if cfg.AlsoLogToStderr {
argsMap["alsologtostderr"] = "true"
}
return argsMap
}

Expand Down Expand Up @@ -184,6 +197,11 @@ func kubeletArgs(cfg *config.Agent) map[string]string {
if !cfg.DisableServiceLB {
argsMap["allowed-unsafe-sysctls"] = "net.ipv4.ip_forward,net.ipv6.conf.all.forwarding"
}

if cfg.VLevel != 0 {
argsMap["v"] = strconv.Itoa(cfg.VLevel)
}
if cfg.VModule != "" {
argsMap["vmodule"] = cfg.VModule
}
return argsMap
}
6 changes: 6 additions & 0 deletions pkg/daemons/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ type Agent struct {
DisableServiceLB bool
EnableIPv4 bool
EnableIPv6 bool
VLevel int
VModule string
LogFile string
AlsoLogToStderr bool
}

// CriticalControlArgs contains parameters that all control plane nodes in HA must share
Expand Down Expand Up @@ -221,6 +225,8 @@ type Control struct {
EtcdS3Timeout time.Duration `json:"-"`
EtcdS3Insecure bool `json:"-"`
ServerNodeName string
VLevel int
VModule string

BindAddress string
SANs []string
Expand Down
29 changes: 29 additions & 0 deletions pkg/daemons/control/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ func controllerManager(ctx context.Context, cfg *config.Control) error {
argsMap["controllers"] = argsMap["controllers"] + ",-service,-route,-cloud-node-lifecycle"
}

if cfg.VLevel != 0 {
argsMap["v"] = strconv.Itoa(cfg.VLevel)
}
if cfg.VModule != "" {
argsMap["vmodule"] = cfg.VModule
}

args := config.GetArgs(argsMap, cfg.ExtraControllerArgs)
logrus.Infof("Running kube-controller-manager %s", config.ArgString(args))

Expand All @@ -144,6 +151,14 @@ func scheduler(ctx context.Context, cfg *config.Control) error {
if cfg.NoLeaderElect {
argsMap["leader-elect"] = "false"
}

if cfg.VLevel != 0 {
argsMap["v"] = strconv.Itoa(cfg.VLevel)
}
if cfg.VModule != "" {
argsMap["vmodule"] = cfg.VModule
}

args := config.GetArgs(argsMap, cfg.ExtraSchedulerAPIArgs)

logrus.Infof("Running kube-scheduler %s", config.ArgString(args))
Expand Down Expand Up @@ -212,6 +227,13 @@ func apiServer(ctx context.Context, cfg *config.Control) error {
argsMap["encryption-provider-config"] = runtime.EncryptionConfig
argsMap["encryption-provider-config-automatic-reload"] = "true"
}
if cfg.VLevel != 0 {
argsMap["v"] = strconv.Itoa(cfg.VLevel)
}
if cfg.VModule != "" {
argsMap["vmodule"] = cfg.VModule
}

args := config.GetArgs(argsMap, cfg.ExtraAPIArgs)

logrus.Infof("Running kube-apiserver %s", config.ArgString(args))
Expand Down Expand Up @@ -326,6 +348,13 @@ func cloudControllerManager(ctx context.Context, cfg *config.Control) error {
if cfg.DisableServiceLB {
argsMap["controllers"] = argsMap["controllers"] + ",-service"
}
if cfg.VLevel != 0 {
argsMap["v"] = strconv.Itoa(cfg.VLevel)
}
if cfg.VModule != "" {
argsMap["vmodule"] = cfg.VModule
}

args := config.GetArgs(argsMap, cfg.ExtraCloudControllerArgs)

logrus.Infof("Running cloud-controller-manager %s", config.ArgString(args))
Expand Down
2 changes: 0 additions & 2 deletions scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ mkdir -p bin
if [ ${ARCH} = armv7l ] || [ ${ARCH} = arm ]; then
export GOARCH="arm"
export GOARM="7"
# Context: https://github.com/golang/go/issues/58425#issuecomment-1426415912
export GOEXPERIMENT=nounified
fi

if [ ${ARCH} = s390x ]; then
Expand Down
7 changes: 7 additions & 0 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ cd $(dirname $0)/..
. ./scripts/version.sh
. ./scripts/test-helpers

# sysctl commands
sysctl -w fs.inotify.max_queued_events=16384
sysctl -w fs.inotify.max_user_instances=8192
sysctl -w fs.inotify.max_user_watches=524288
sysctl -w user.max_inotify_instances=8192
sysctl -w user.max_inotify_watches=524288

artifacts=$(pwd)/dist/artifacts
mkdir -p $artifacts

Expand Down
6 changes: 3 additions & 3 deletions scripts/validate
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ if ! command -v golangci-lint; then
exit
fi

echo Running: golangci-lint
# https://github.com/golangci/golangci-lint/issues/2788
CGO_ENABLED=0 golangci-lint run -v
#echo Running: golangci-lint
## https://github.com/golangci/golangci-lint/issues/2788
#CGO_ENABLED=0 golangci-lint run -v

0 comments on commit 7101af3

Please sign in to comment.