Unverified Commit f8b661d5 authored by Hussein Galal's avatar Hussein Galal Committed by GitHub

Update to v1.26.0-k3s1 (#6370)

* Update to v1.26.0-alpha.2 Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * go generate Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * Default CURRENT_VERSION to VERSION_TAG for alpha versions Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * remove containerd package Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * Update k8s to v1.26.0-rc.0-k3s1 cri-tools cri-dockerd and cadvisor Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * replace cri-api reference to the new api Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * go mod tidy Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * Fix version script to allow rc and alphas Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * Fix version script to allow rc and alphas Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * Fix version script to allow rc and alphas Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * Update to Kubernetes 1.26.0-rc.1 Signed-off-by: 's avatarBrad Davidson <brad.davidson@rancher.com> * Undo helm-controller pin Signed-off-by: 's avatarBrad Davidson <brad.davidson@rancher.com> * Bump containerd to -k3s2 for stargz fix Signed-off-by: 's avatarBrad Davidson <brad.davidson@rancher.com> * DevicePlugins featuregate is locked to on Signed-off-by: 's avatarBrad Davidson <brad.davidson@rancher.com> * Bump kine for DeleteRange fix Signed-off-by: 's avatarBrad Davidson <brad.davidson@rancher.com> * Update to v1.26.0-k3s1 Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * go mod tidy Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * Bring back snapshotter checks and update golang to 1.19.4 Signed-off-by: 's avatargalal-hussein <hussein.galal.ahmed.11@gmail.com> * fix windows containerd snapshotter checks 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.davidson@rancher.com> Co-authored-by: 's avatarBrad Davidson <brad.davidson@rancher.com>
parent b5d39df9
ARG GOLANG=golang:1.19.3-alpine3.16 ARG GOLANG=golang:1.19.4-alpine3.17
FROM ${GOLANG} FROM ${GOLANG}
ARG http_proxy=$http_proxy ARG http_proxy=$http_proxy
......
...@@ -19,11 +19,11 @@ import ( ...@@ -19,11 +19,11 @@ import (
"strings" "strings"
"time" "time"
"github.com/k3s-io/k3s/pkg/agent/containerd"
"github.com/k3s-io/k3s/pkg/agent/proxy" "github.com/k3s-io/k3s/pkg/agent/proxy"
agentutil "github.com/k3s-io/k3s/pkg/agent/util" agentutil "github.com/k3s-io/k3s/pkg/agent/util"
"github.com/k3s-io/k3s/pkg/cli/cmds" "github.com/k3s-io/k3s/pkg/cli/cmds"
"github.com/k3s-io/k3s/pkg/clientaccess" "github.com/k3s-io/k3s/pkg/clientaccess"
"github.com/k3s-io/k3s/pkg/containerd"
"github.com/k3s-io/k3s/pkg/daemons/config" "github.com/k3s-io/k3s/pkg/daemons/config"
"github.com/k3s-io/k3s/pkg/daemons/control/deps" "github.com/k3s-io/k3s/pkg/daemons/control/deps"
"github.com/k3s-io/k3s/pkg/util" "github.com/k3s-io/k3s/pkg/util"
......
...@@ -9,6 +9,9 @@ import ( ...@@ -9,6 +9,9 @@ import (
"time" "time"
"github.com/containerd/containerd" "github.com/containerd/containerd"
overlayutils "github.com/containerd/containerd/snapshots/overlay/overlayutils"
fuseoverlayfs "github.com/containerd/fuse-overlayfs-snapshotter"
stargz "github.com/containerd/stargz-snapshotter/service"
"github.com/docker/docker/pkg/parsers/kernel" "github.com/docker/docker/pkg/parsers/kernel"
"github.com/k3s-io/k3s/pkg/agent/templates" "github.com/k3s-io/k3s/pkg/agent/templates"
util2 "github.com/k3s-io/k3s/pkg/agent/util" util2 "github.com/k3s-io/k3s/pkg/agent/util"
...@@ -21,7 +24,7 @@ import ( ...@@ -21,7 +24,7 @@ import (
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
"google.golang.org/grpc" "google.golang.org/grpc"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
"k8s.io/kubernetes/pkg/kubelet/util" "k8s.io/kubernetes/pkg/kubelet/util"
) )
...@@ -131,3 +134,15 @@ func Client(address string) (*containerd.Client, error) { ...@@ -131,3 +134,15 @@ func Client(address string) (*containerd.Client, error) {
return containerd.New(addr) return containerd.New(addr)
} }
func OverlaySupported(root string) error {
return overlayutils.Supported(root)
}
func FuseoverlayfsSupported(root string) error {
return fuseoverlayfs.Supported(root)
}
func StargzSupported(root string) error {
return stargz.Supported(root)
}
...@@ -12,10 +12,12 @@ import ( ...@@ -12,10 +12,12 @@ import (
"github.com/k3s-io/k3s/pkg/agent/templates" "github.com/k3s-io/k3s/pkg/agent/templates"
util2 "github.com/k3s-io/k3s/pkg/agent/util" util2 "github.com/k3s-io/k3s/pkg/agent/util"
"github.com/k3s-io/k3s/pkg/daemons/config" "github.com/k3s-io/k3s/pkg/daemons/config"
util3 "github.com/k3s-io/k3s/pkg/util"
"github.com/pkg/errors"
"github.com/rancher/wharfie/pkg/registries" "github.com/rancher/wharfie/pkg/registries"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"google.golang.org/grpc" "google.golang.org/grpc"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
"k8s.io/kubernetes/pkg/kubelet/util" "k8s.io/kubernetes/pkg/kubelet/util"
) )
...@@ -98,3 +100,15 @@ func Client(address string) (*containerd.Client, error) { ...@@ -98,3 +100,15 @@ func Client(address string) (*containerd.Client, error) {
return containerd.New(addr) return containerd.New(addr)
} }
func OverlaySupported(root string) error {
return errors.Wrapf(util3.ErrUnsupportedPlatform, "overlayfs is not supported")
}
func FuseoverlayfsSupported(root string) error {
return errors.Wrapf(util3.ErrUnsupportedPlatform, "fuse-overlayfs is not supported")
}
func StargzSupported(root string) error {
return errors.Wrapf(util3.ErrUnsupportedPlatform, "stargz is not supported")
}
...@@ -27,7 +27,7 @@ import ( ...@@ -27,7 +27,7 @@ import (
"github.com/rancher/wrangler/pkg/merr" "github.com/rancher/wrangler/pkg/merr"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"google.golang.org/grpc" "google.golang.org/grpc"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
) )
const ( const (
......
//go:build ctrd
// +build ctrd
/*
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package containerd
// register containerd builtins here
import (
_ "github.com/containerd/containerd/diff/walking/plugin"
_ "github.com/containerd/containerd/gc/scheduler"
_ "github.com/containerd/containerd/runtime/restart/monitor"
_ "github.com/containerd/containerd/services/containers"
_ "github.com/containerd/containerd/services/content"
_ "github.com/containerd/containerd/services/diff"
_ "github.com/containerd/containerd/services/events"
_ "github.com/containerd/containerd/services/healthcheck"
_ "github.com/containerd/containerd/services/images"
_ "github.com/containerd/containerd/services/introspection"
_ "github.com/containerd/containerd/services/leases"
_ "github.com/containerd/containerd/services/namespaces"
_ "github.com/containerd/containerd/services/opt"
_ "github.com/containerd/containerd/services/snapshots"
_ "github.com/containerd/containerd/services/tasks"
_ "github.com/containerd/containerd/services/version"
)
//go:build ctrd
// +build ctrd
/*
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package containerd
import _ "github.com/containerd/containerd/pkg/cri"
//go:build ctrd
// +build ctrd
/*
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package containerd
import (
_ "github.com/containerd/containerd/metrics/cgroups"
_ "github.com/containerd/containerd/runtime/v2"
_ "github.com/containerd/containerd/runtime/v2/runc/options"
_ "github.com/containerd/containerd/snapshots/btrfs/plugin"
_ "github.com/containerd/containerd/snapshots/native/plugin"
_ "github.com/containerd/containerd/snapshots/overlay/plugin"
_ "github.com/containerd/fuse-overlayfs-snapshotter/plugin"
_ "github.com/containerd/stargz-snapshotter/service/plugin"
)
//go:build ctrd
// +build ctrd
package containerd
import (
"fmt"
"os"
"github.com/containerd/containerd/cmd/containerd/command"
"github.com/containerd/containerd/pkg/seed"
)
func Main() {
//klog.InitFlags(nil)
seed.WithTimeAndRand()
app := command.App()
if err := app.Run(os.Args); err != nil {
fmt.Fprintf(os.Stderr, "containerd: %s\n", err)
os.Exit(1)
}
}
//go:build linux
package containerd
import (
"github.com/containerd/containerd/snapshots/overlay/overlayutils"
fuseoverlayfs "github.com/containerd/fuse-overlayfs-snapshotter"
stargz "github.com/containerd/stargz-snapshotter/service"
)
func OverlaySupported(root string) error {
return overlayutils.Supported(root)
}
func FuseoverlayfsSupported(root string) error {
return fuseoverlayfs.Supported(root)
}
func StargzSupported(root string) error {
return stargz.Supported(root)
}
//go:build windows
// +build windows
package containerd
import (
util2 "github.com/k3s-io/k3s/pkg/util"
"github.com/pkg/errors"
)
func OverlaySupported(root string) error {
return errors.Wrapf(util2.ErrUnsupportedPlatform, "overlayfs is not supported")
}
func FuseoverlayfsSupported(root string) error {
return errors.Wrapf(util2.ErrUnsupportedPlatform, "fuse-overlayfs is not supported")
}
func StargzSupported(root string) error {
return errors.Wrapf(util2.ErrUnsupportedPlatform, "stargz is not supported")
}
...@@ -11,7 +11,6 @@ import ( ...@@ -11,7 +11,6 @@ import (
"github.com/k3s-io/k3s/pkg/cgroups" "github.com/k3s-io/k3s/pkg/cgroups"
"github.com/k3s-io/k3s/pkg/daemons/config" "github.com/k3s-io/k3s/pkg/daemons/config"
"github.com/k3s-io/k3s/pkg/util" "github.com/k3s-io/k3s/pkg/util"
"github.com/opencontainers/runc/libcontainer/userns"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
"k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/pkg/util/net"
...@@ -141,9 +140,6 @@ func kubeletArgs(cfg *config.Agent) map[string]string { ...@@ -141,9 +140,6 @@ func kubeletArgs(cfg *config.Agent) map[string]string {
if runtimeRoot != "" { if runtimeRoot != "" {
argsMap["runtime-cgroups"] = runtimeRoot argsMap["runtime-cgroups"] = runtimeRoot
} }
if userns.RunningInUserNS() {
argsMap["feature-gates"] = util.AddFeatureGate(argsMap["feature-gates"], "DevicePlugins=false")
}
argsMap["node-labels"] = strings.Join(cfg.NodeLabels, ",") argsMap["node-labels"] = strings.Join(cfg.NodeLabels, ",")
if len(cfg.NodeTaints) > 0 { if len(cfg.NodeTaints) > 0 {
......
...@@ -33,8 +33,7 @@ type Interface interface { ...@@ -33,8 +33,7 @@ type Interface interface {
K3sV1() k3sv1.K3sV1Interface K3sV1() k3sv1.K3sV1Interface
} }
// Clientset contains the clients for groups. Each group has exactly one // Clientset contains the clients for groups.
// version included in a Clientset.
type Clientset struct { type Clientset struct {
*discovery.DiscoveryClient *discovery.DiscoveryClient
k3sV1 *k3sv1.K3sV1Client k3sV1 *k3sv1.K3sV1Client
......
...@@ -15,8 +15,11 @@ REPO=${REPO:-rancher} ...@@ -15,8 +15,11 @@ REPO=${REPO:-rancher}
IMAGE_NAME=${IMAGE_NAME:-k3s} IMAGE_NAME=${IMAGE_NAME:-k3s}
CURRENT_CHANNEL=$(grep 'k8s.io/kubernetes v' go.mod | head -n1 | awk '{print $2}' | awk -F. '{print "v1." $2}') CURRENT_CHANNEL=$(grep 'k8s.io/kubernetes v' go.mod | head -n1 | awk '{print $2}' | awk -F. '{print "v1." $2}')
CURRENT_VERSION=$(curl -s https://update.k3s.io/v1-release/channels/${CURRENT_CHANNEL} -o /dev/null -w '%{redirect_url}' | awk -F/ '{print gensub(/\+/, "-", "g", $NF)}') CURRENT_VERSION=$(curl -s https://update.k3s.io/v1-release/channels/${CURRENT_CHANNEL} -o /dev/null -w '%{redirect_url}' | awk -F/ '{print gensub(/\+/, "-", "g", $NF)}')
export K3S_IMAGE_SERVER=${REPO}/${IMAGE_NAME}:${CURRENT_VERSION} if [ -z "${CURRENT_VERSION}" ]; then
export K3S_IMAGE_AGENT=${REPO}/${IMAGE_NAME}:${CURRENT_VERSION} CURRENT_VERSION=${VERSION_TAG}
fi
export K3S_IMAGE_SERVER=${REPO}/${IMAGE_NAME}:${CURRENT_VERSION}${SUFFIX}
export K3S_IMAGE_AGENT=${REPO}/${IMAGE_NAME}:${CURRENT_VERSION}${SUFFIX}
server-pre-hook(){ server-pre-hook(){
local testID=$(basename $TEST_DIR) local testID=$(basename $TEST_DIR)
......
...@@ -24,14 +24,15 @@ fi ...@@ -24,14 +24,15 @@ fi
# We're building k3s against containerd 1.5 in go.mod because 1.6 has dependency # We're building k3s against containerd 1.5 in go.mod because 1.6 has dependency
# conflicts with Kubernetes, but we still need to bundle containerd 1.6. # conflicts with Kubernetes, but we still need to bundle containerd 1.6.
VERSION_CONTAINERD="v1.6.10-k3s1" VERSION_CONTAINERD="v1.6.12-k3s1"
VERSION_CRICTL=$(grep github.com/kubernetes-sigs/cri-tools go.mod | head -n1 | awk '{print $4}') VERSION_CRICTL=$(grep github.com/kubernetes-sigs/cri-tools go.mod | head -n1 | awk '{print $4}')
if [ -z "$VERSION_CRICTL" ]; then if [ -z "$VERSION_CRICTL" ]; then
VERSION_CRICTL="v0.0.0" VERSION_CRICTL="v0.0.0"
fi fi
VERSION_K8S=$(grep 'k8s.io/kubernetes v' go.mod | head -n1 | awk '{print $2}') VERSION_K8S_K3S=$(grep 'k8s.io/kubernetes =>' go.mod | head -n1 | awk '{print $4}')
VERSION_K8S=${VERSION_K8S_K3S%"-k3s1"}
if [ -z "$VERSION_K8S" ]; then if [ -z "$VERSION_K8S" ]; then
VERSION_K8S="v0.0.0" VERSION_K8S="v0.0.0"
fi fi
......
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