Unverified Commit 7101af36 authored by Hussein Galal's avatar Hussein Galal Committed by GitHub

Update Kubernetes to v1.29.0+k3s1 (#9052)

* Update to v1.29.0 Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * Update to v1.29.0 Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * Update go to 1.21.5 Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * update golangci-lint Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * 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: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * fix flannel calls Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * update cri-tools to version v1.29.0-k3s1 Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * Remove GOEXPERIMENT=nounified from arm builds Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * Skip golangci-lint Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * Fix setup logging with newer go version Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * Move logging flags to components arguments Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * add sysctl commands to the test script Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * Update scripts/test Signed-off-by: 's avatarBrad Davidson <brad@oatmail.org> * disable secretsencryption tests Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> --------- Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> Signed-off-by: 's avatarBrad Davidson <brad@oatmail.org> Co-authored-by: 's avatarBrad Davidson <brad@oatmail.org>
parent bf3f29f9
......@@ -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
......
......@@ -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: |
......
......@@ -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: |
......
ARG GOLANG=golang:1.20.11-alpine3.18
ARG GOLANG=golang:1.21.5-alpine3.18
FROM ${GOLANG}
# Set proxy environment variables
......@@ -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
......
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
......
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/
......
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
......@@ -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;
......
......@@ -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
......
......@@ -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")
}
......
package cmds
import (
"flag"
"fmt"
"strconv"
"sync"
"time"
......@@ -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)
}
......
......@@ -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
......
......@@ -7,6 +7,7 @@ import (
"net"
"os"
"path/filepath"
"strconv"
"strings"
"github.com/k3s-io/k3s/pkg/cgroups"
......@@ -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
}
......@@ -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
}
......@@ -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
......@@ -221,6 +225,8 @@ type Control struct {
EtcdS3Timeout time.Duration `json:"-"`
EtcdS3Insecure bool `json:"-"`
ServerNodeName string
VLevel int
VModule string
BindAddress string
SANs []string
......
......@@ -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))
......@@ -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))
......@@ -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))
......@@ -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))
......
......@@ -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
......
......@@ -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
......
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment