From f06b971a7dee54c5b990883dd127a097824e6364 Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Thu, 17 Sep 2020 01:13:50 -0700 Subject: [PATCH] Add tags to prevent crashes when statically linking kubernetes binaries This fixes MOST things, we still have a few runtime links to address but this should at least prevent kubelet from segfaulting on startup. Also update k3s to master, as the last update apparently didn't get us to the rev we needed to be at to make the agent tunnel controller work with the RBAC changes. Signed-off-by: Brad Davidson --- Dockerfile | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- pkg/podexecutor/staticpod.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 32eb8367fb..24c42635a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ ARG KUBERNETES_VERSION=dev # Build environment -FROM rancher/hardened-build-base:v1.14.2-amd64 AS build +FROM rancher/hardened-build-base:v1.13.15-amd64 AS build RUN set -x \ && export DEBIAN_FRONTEND=noninteractive \ && apt-get -y update \ @@ -51,7 +51,7 @@ ARG TAG WORKDIR / RUN git clone -b ${KUBERNETES_VERSION} --depth=1 https://github.com/kubernetes/kubernetes.git WORKDIR /kubernetes -RUN make KUBE_GIT_VERSION=${TAG} GOLDFLAGS='-extldflags "-static"' WHAT='cmd/kube-apiserver cmd/kube-controller-manager cmd/kube-proxy cmd/kube-scheduler cmd/kubeadm cmd/kubectl cmd/kubelet vendor/k8s.io/apiextensions-apiserver' +RUN make KUBE_GIT_VERSION=${TAG} GOLDFLAGS='-extldflags "-static"' GOFLAGS='-tags=netgo,osusergo' WHAT='cmd/kube-apiserver cmd/kube-controller-manager cmd/kube-proxy cmd/kube-scheduler cmd/kubeadm cmd/kubectl cmd/kubelet vendor/k8s.io/apiextensions-apiserver' FROM registry.access.redhat.com/ubi7/ubi-minimal:latest AS kubernetes RUN microdnf update -y && \ diff --git a/go.mod b/go.mod index fcee850a0c..dc70fbc52d 100644 --- a/go.mod +++ b/go.mod @@ -59,7 +59,7 @@ require ( github.com/google/go-containerregistry v0.0.0-20190617215043-876b8855d23c github.com/pkg/errors v0.9.1 github.com/rancher/helm-controller v0.7.3 - github.com/rancher/k3s v1.19.1-rc2.0.20200916010251-ae5519c0472e + github.com/rancher/k3s v1.19.1-rc2.0.20200916233211-b66760fccddd github.com/rancher/wrangler v0.6.1 github.com/sirupsen/logrus v1.6.0 github.com/urfave/cli v1.22.2 diff --git a/go.sum b/go.sum index dc59da89af..3c716b0639 100644 --- a/go.sum +++ b/go.sum @@ -695,8 +695,8 @@ github.com/rancher/go-powershell v0.0.0-20200701184732-233247d45373 h1:BePi97poJ github.com/rancher/go-powershell v0.0.0-20200701184732-233247d45373/go.mod h1:Vz8oLnHgttpo/aZrTpjbcpZEDzzElqNau2zmorToY0E= github.com/rancher/helm-controller v0.7.3 h1:WTQHcNF2vl9w6Xd1eBtXDe0JUsYMFFstqX9ghGhI5Ac= github.com/rancher/helm-controller v0.7.3/go.mod h1:ZylsxIMGNADRPRNW+NiBWhrwwks9vnKLQiCHYWb6Bi0= -github.com/rancher/k3s v1.19.1-rc2.0.20200916010251-ae5519c0472e h1:Bngz9JRrYfVDBf+J1Ih9/iDaeiwITZCM59Ob1ldJ4kA= -github.com/rancher/k3s v1.19.1-rc2.0.20200916010251-ae5519c0472e/go.mod h1:KZ7cVGFco3Q8FfQGynHIZZ7MYVE+yPdk6TZB9s9YqWk= +github.com/rancher/k3s v1.19.1-rc2.0.20200916233211-b66760fccddd h1:BxaXJ6VOlfeKWvKsCrrbOG8TpHgvat9yxvkETfryxGY= +github.com/rancher/k3s v1.19.1-rc2.0.20200916233211-b66760fccddd/go.mod h1:KZ7cVGFco3Q8FfQGynHIZZ7MYVE+yPdk6TZB9s9YqWk= github.com/rancher/kine v0.4.0 h1:1IhWy3TzjExG8xnj46eyUEWdzqNAD1WrgL4eEBKm6Uc= github.com/rancher/kine v0.4.0/go.mod h1:IImtCJ68AIkE+VY/kUI0NkyJL5q5WzO8QvMsSXqbrpA= github.com/rancher/kubernetes v1.19.0-k3s1 h1:TPFj4qlQgZ2E9xE/ScFLtBQoymxPNCXAYHJpSZYRW3o= diff --git a/pkg/podexecutor/staticpod.go b/pkg/podexecutor/staticpod.go index e558f4ae0b..796a62ab48 100644 --- a/pkg/podexecutor/staticpod.go +++ b/pkg/podexecutor/staticpod.go @@ -57,7 +57,7 @@ func (s *StaticPodConfig) Kubelet(args []string) error { for { cmd := exec.Command("kubelet", args...) cmd.Stdout = os.Stdout - //cmd.Stderr = os.Stderr + cmd.Stderr = os.Stderr addDeathSig(cmd) err := cmd.Run()