upgrade crio to 1.18.3, ubuntu to 20.04 and add terrible hack to fix restarts for cri-o

pull/8895/head
Sharif Elgamal 2020-07-30 15:11:30 -07:00
parent de922efcb0
commit 61583d6249
3 changed files with 48 additions and 29 deletions

View File

@ -202,6 +202,13 @@ func runStart(cmd *cobra.Command, args []string) {
} }
} }
if existing != nil && existing.KubernetesConfig.ContainerRuntime == "crio" && driver.IsKIC(existing.Driver) {
// Stop and start again if it's crio because crio is bad and dumb
out.WarningT("CRI-O currently has an issue and your cluster needs to be restarted.")
stopProfile(existing.Name)
starter, err = provisionWithDriver(cmd, ds, existing)
}
kubeconfig, err := startWithDriver(cmd, starter, existing) kubeconfig, err := startWithDriver(cmd, starter, existing)
if err != nil { if err != nil {
node.MaybeExitWithAdvice(err) node.MaybeExitWithAdvice(err)

View File

@ -80,30 +80,8 @@ func runStop(cmd *cobra.Command, args []string) {
} }
stoppedNodes := 0 stoppedNodes := 0
for _, profile := range profilesToStop { for _, profile := range profilesToStop {
register.Reg.SetStep(register.Stopping) stoppedNodes = stopProfile(profile)
// end new code
api, cc := mustload.Partial(profile)
defer api.Close()
for _, n := range cc.Nodes {
machineName := driver.MachineName(*cc, n)
nonexistent := stop(api, machineName)
if !nonexistent {
stoppedNodes++
}
}
if err := killMountProcess(); err != nil {
out.WarningT("Unable to kill mount process: {{.error}}", out.V{"error": err})
}
if err := kubeconfig.UnsetCurrentContext(profile, kubeconfig.PathFromEnv()); err != nil {
exit.WithError("update config", err)
}
} }
register.Reg.SetStep(register.Done) register.Reg.SetStep(register.Done)
@ -112,6 +90,34 @@ func runStop(cmd *cobra.Command, args []string) {
} }
} }
func stopProfile(profile string) int {
stoppedNodes := 0
register.Reg.SetStep(register.Stopping)
// end new code
api, cc := mustload.Partial(profile)
defer api.Close()
for _, n := range cc.Nodes {
machineName := driver.MachineName(*cc, n)
nonexistent := stop(api, machineName)
if !nonexistent {
stoppedNodes++
}
}
if err := killMountProcess(); err != nil {
out.WarningT("Unable to kill mount process: {{.error}}", out.V{"error": err})
}
if err := kubeconfig.UnsetCurrentContext(profile, kubeconfig.PathFromEnv()); err != nil {
exit.WithError("update config", err)
}
return stoppedNodes
}
func stop(api libmachine.API, machineName string) bool { func stop(api libmachine.API, machineName string) bool {
nonexistent := false nonexistent := false

View File

@ -12,25 +12,31 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
docker.io \ docker.io \
openssh-server \ openssh-server \
dnsutils \ dnsutils \
runc \
# libglib2.0-0 is required for conmon, which is required for podman # libglib2.0-0 is required for conmon, which is required for podman
libglib2.0-0 \ libglib2.0-0 \
# removing kind's crictl config # removing kind's crictl config
&& rm /etc/crictl.yaml && rm /etc/crictl.yaml
# install cri-o based on https://github.com/cri-o/cri-o/commit/96b0c34b31a9fc181e46d7d8e34fb8ee6c4dc4e1#diff-04c6e90faac2675aa89e2176d2eec7d8R128 # Install cri-o/podman dependencies:
RUN sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" && \ RUN sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" && \
curl -LO https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_20.04/Release.key && \ curl -LO https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_20.04/Release.key && \
apt-key add - < Release.key && apt-get update && \ apt-key add - < Release.key && apt-get update && \
apt-get install -y --no-install-recommends cri-o-1.17 apt-get install -y --no-install-recommends containers-common catatonit conmon containernetworking-plugins podman-plugins varlink
# install cri-o based on https://github.com/cri-o/cri-o/commit/96b0c34b31a9fc181e46d7d8e34fb8ee6c4dc4e1#diff-04c6e90faac2675aa89e2176d2eec7d8R128
RUN sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/1.18:/1.18.3/xUbuntu_20.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" && \
curl -LO https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/1.18:/1.18.3/xUbuntu_20.04/Release.key && \
apt-key add - < Release.key && apt-get update && \
apt-get install -y --no-install-recommends cri-o=1.18.3~2
# install podman # install podman
RUN sh -c "echo 'deb https://dl.bintray.com/afbjorklund/podman focal main' > /etc/apt/sources.list.d/podman.list" && \ RUN sh -c "echo 'deb https://dl.bintray.com/afbjorklund/podman focal main' > /etc/apt/sources.list.d/podman.list" && \
curl -L https://bintray.com/user/downloadSubjectPublicKey?username=afbjorklund -o afbjorklund-public.key.asc && \ curl -L https://bintray.com/user/downloadSubjectPublicKey?username=afbjorklund -o afbjorklund-public.key.asc && \
apt-key add - < afbjorklund-public.key.asc && apt-get update && \ apt-key add - < afbjorklund-public.key.asc && apt-get update && \
apt-get install -y --no-install-recommends podman=1.8.2~2 apt-get install -y --no-install-recommends podman=1.9.3~1
# install varlink RUN mkdir -p /usr/lib/cri-o-runc/sbin && cp /usr/local/sbin/runc /usr/lib/cri-o-runc/sbin/runc
RUN apt-get install -y --no-install-recommends varlink
COPY entrypoint /usr/local/bin/entrypoint COPY entrypoint /usr/local/bin/entrypoint
# automount service # automount service