Remove the rkt container runtime
It has not been updated since kubernetes 1.9 or sopull/3944/head
parent
702d471308
commit
2590fc7b9a
|
@ -1,2 +1 @@
|
||||||
rkt -1 rkt -1 - /home/rkt /bin/bash rkt-admin,wheel,vboxsf -
|
docker -1 docker -1 =tcuser /home/docker /bin/bash wheel,vboxsf -
|
||||||
docker -1 docker -1 =tcuser /home/docker /bin/bash rkt,rkt-admin,wheel,vboxsf -
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
menu "System tools"
|
menu "System tools"
|
||||||
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/rkt-bin/Config.in"
|
|
||||||
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/rktlet-master/Config.in"
|
|
||||||
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/runc-master/Config.in"
|
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/runc-master/Config.in"
|
||||||
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/podman/Config.in"
|
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/podman/Config.in"
|
||||||
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/crio-bin/Config.in"
|
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/crio-bin/Config.in"
|
||||||
|
|
|
@ -129,28 +129,6 @@ if [ -n "$BOOT2DOCKER_DATA" ]; then
|
||||||
mkdir /tmp/hostpath-provisioner
|
mkdir /tmp/hostpath-provisioner
|
||||||
mount --bind /mnt/$PARTNAME/hostpath-provisioner /tmp/hostpath-provisioner
|
mount --bind /mnt/$PARTNAME/hostpath-provisioner /tmp/hostpath-provisioner
|
||||||
|
|
||||||
rm -rf /var/lib/rkt
|
|
||||||
if [ ! -d /mnt/$PARTNAME/var/lib/rkt ]; then
|
|
||||||
mkdir -p /mnt/$PARTNAME/var/lib/rkt
|
|
||||||
chown root:rkt /mnt/$PARTNAME/var/lib/rkt
|
|
||||||
fi
|
|
||||||
mkdir /var/lib/rkt
|
|
||||||
mount --bind /mnt/$PARTNAME/var/lib/rkt /var/lib/rkt
|
|
||||||
|
|
||||||
if [ ! -d /mnt/$PARTNAME/var/lib/rkt-etc ]; then
|
|
||||||
mkdir -p /mnt/$PARTNAME/var/lib/rkt-etc
|
|
||||||
cp -rp /etc/rkt/* /mnt/$PARTNAME/var/lib/rkt-etc
|
|
||||||
chown root:rkt-admin /mnt/$PARTNAME/var/lib/rkt-etc
|
|
||||||
chmod ug+rw /mnt/$PARTNAME/var/lib/rkt-etc
|
|
||||||
fi
|
|
||||||
rm -rf /etc/rkt
|
|
||||||
mkdir /etc/rkt
|
|
||||||
mount --bind /mnt/$PARTNAME/var/lib/rkt-etc /etc/rkt
|
|
||||||
|
|
||||||
if [ ! -d /var/lib/rkt/pods ]; then
|
|
||||||
systemd-tmpfiles --create rkt.conf
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e "/userdata.tar" ]; then
|
if [ -e "/userdata.tar" ]; then
|
||||||
mv /userdata.tar /var/lib/boot2docker/
|
mv /userdata.tar /var/lib/boot2docker/
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=minikube automount
|
Description=minikube automount
|
||||||
Requires=systemd-udev-settle.service
|
Requires=systemd-udev-settle.service
|
||||||
Before=docker.service rkt-api.service rkt-metadata.service
|
Before=docker.service
|
||||||
After=systemd-udev-settle.service
|
After=systemd-udev-settle.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
config BR2_PACKAGE_RKT_BIN
|
|
||||||
bool "rkt-bin"
|
|
||||||
default y
|
|
||||||
depends on BR2_x86_64
|
|
|
@ -1,9 +0,0 @@
|
||||||
sha256 7e7c122f92f1dd8e621580869903a367e6ba2dd80f3ab9bf40b089d972d0c827 rkt-v1.14.0.tar.gz
|
|
||||||
sha256 dd514db743e9f8bdae9169bf416d6ed8a83e862e0621ce57a9d20a4f7bb1adbb rkt-v1.14.0.tar.gz.asc
|
|
||||||
sha256 2c00e816a5b470f29483d9660bd62e80da8f14e2a0ba79c841e15e1a28fbf975 rkt-v1.23.0.tar.gz
|
|
||||||
sha256 5aa2c2ac71f21bf3fc8a94b1bdd0b2c0f4060ad9054502b0a693f4632b093c2e rkt-v1.23.0.tar.gz.asc
|
|
||||||
sha256 0ec396f1af7782e402d789e6e34e9257033efac5db71d740f9742f3469d02298 rkt-v1.24.0.tar.gz
|
|
||||||
sha256 577a7a7e3512c0116b3642c710304d4f36a1f66c7e34ec8753dae168a29761e3 rkt-v1.24.0.tar.gz.asc
|
|
||||||
sha256 f6a51fe1d11aaecef965cca729f260f9ea691f6576e8698b49a2daedfc48c427 rkt-v1.30.0.tar.gz
|
|
||||||
sha256 874d8bcf9dd09599b2d090259485a49a6c1f4a74f55065dec8ac37e283c27592 rkt-v1.30.0.tar.gz.asc
|
|
||||||
sha256 b7a769456e62d10a042a4fad79f1fe595d8c392490a6ff611c759c0669d99a97 app-signing-pubkey.gpg
|
|
|
@ -1,74 +0,0 @@
|
||||||
################################################################################
|
|
||||||
#
|
|
||||||
# rkt
|
|
||||||
#
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
RKT_BIN_VERSION = 1.30.0
|
|
||||||
RKT_BIN_SITE = https://github.com/coreos/rkt/releases/download/v$(RKT_BIN_VERSION)
|
|
||||||
RKT_BIN_SOURCE = rkt-v$(RKT_BIN_VERSION).tar.gz
|
|
||||||
|
|
||||||
RKT_BIN_EXTRA_DOWNLOADS = \
|
|
||||||
https://github.com/coreos/rkt/releases/download/v$(RKT_BIN_VERSION)/rkt-v$(RKT_BIN_VERSION).tar.gz.asc \
|
|
||||||
https://coreos.com/dist/pubkeys/app-signing-pubkey.gpg
|
|
||||||
|
|
||||||
define RKT_BIN_USERS
|
|
||||||
- -1 rkt-admin -1 - - - - -
|
|
||||||
- -1 rkt -1 - - - - -
|
|
||||||
endef
|
|
||||||
|
|
||||||
define RKT_BIN_BUILD_CMDS
|
|
||||||
gpg2 --import $(BR2_DL_DIR)/rkt-bin/app-signing-pubkey.gpg
|
|
||||||
|
|
||||||
gpg2 \
|
|
||||||
--trusted-key `gpg2 --with-colons --keyid-format long -k security@coreos.com | egrep ^pub | cut -d ':' -f5` \
|
|
||||||
--verify-files $(BR2_DL_DIR)/rkt-bin/rkt-v$(RKT_BIN_VERSION).tar.gz.asc
|
|
||||||
|
|
||||||
mkdir -p $(TARGET_DIR)/var/lib/rkt
|
|
||||||
endef
|
|
||||||
|
|
||||||
define RKT_BIN_INSTALL_TARGET_CMDS
|
|
||||||
$(INSTALL) -D -m 0755 \
|
|
||||||
$(@D)/rkt \
|
|
||||||
$(TARGET_DIR)/bin/rkt
|
|
||||||
|
|
||||||
mkdir -p $(TARGET_DIR)/etc/bash_completion.d
|
|
||||||
|
|
||||||
$(INSTALL) -D -m 644 \
|
|
||||||
$(@D)/bash_completion/rkt.bash \
|
|
||||||
$(TARGET_DIR)/etc/bash_completion.d/rkt
|
|
||||||
|
|
||||||
mkdir -p $(TARGET_DIR)/usr/lib/rkt/stage1-images
|
|
||||||
|
|
||||||
install -Dm644 \
|
|
||||||
$(@D)/stage1-coreos.aci \
|
|
||||||
$(TARGET_DIR)/usr/lib/rkt/stage1-images/stage1-coreos.aci
|
|
||||||
endef
|
|
||||||
|
|
||||||
define RKT_BIN_INSTALL_INIT_SYSTEMD
|
|
||||||
mkdir -p $(TARGET_DIR)/usr/lib/tmpfiles.d
|
|
||||||
|
|
||||||
$(INSTALL) -D -m 644 \
|
|
||||||
$(@D)/init/systemd/tmpfiles.d/rkt.conf \
|
|
||||||
$(TARGET_DIR)/usr/lib/tmpfiles.d/rkt.conf
|
|
||||||
|
|
||||||
$(call rkt-install-service,rkt-api.service)
|
|
||||||
$(call rkt-install-service,rkt-gc.timer)
|
|
||||||
$(call rkt-install-service,rkt-gc.service)
|
|
||||||
$(call rkt-install-service,rkt-metadata.socket)
|
|
||||||
$(call rkt-install-service,rkt-metadata.service)
|
|
||||||
endef
|
|
||||||
|
|
||||||
define rkt-install-service
|
|
||||||
$(INSTALL) -D -m 644 \
|
|
||||||
$(@D)/init/systemd/$(1) \
|
|
||||||
$(TARGET_DIR)/usr/lib/systemd/system/$(1)
|
|
||||||
$(call link-service,$(1))
|
|
||||||
endef
|
|
||||||
|
|
||||||
define link-service
|
|
||||||
ln -fs /usr/lib/systemd/system/$(1) \
|
|
||||||
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/$(1)
|
|
||||||
endef
|
|
||||||
|
|
||||||
$(eval $(generic-package))
|
|
|
@ -1,16 +0,0 @@
|
||||||
config BR2_PACKAGE_RKTLET_MASTER
|
|
||||||
bool "rktlet-master"
|
|
||||||
default y
|
|
||||||
depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
|
|
||||||
depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
|
|
||||||
depends on BR2_TOOLCHAIN_HAS_THREADS
|
|
||||||
help
|
|
||||||
The rkt implementation of the Kubernetes
|
|
||||||
Container Runtime Interface.
|
|
||||||
|
|
||||||
https://github.com/kubernetes-incubator/rktlet
|
|
||||||
|
|
||||||
comment "rktlet needs a toolchain w/ threads"
|
|
||||||
depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS && \
|
|
||||||
BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
|
|
||||||
depends on !BR2_TOOLCHAIN_HAS_THREADS
|
|
Binary file not shown.
|
@ -1,2 +0,0 @@
|
||||||
# Locally computed
|
|
||||||
sha256 12254af0f8d9b1f653f20e943dbbda42b74f6eafe7331db74a32857e44efdc6f fd7fc6bf4a25f03c22e5f6e30f3d9f12c468afcb.tar.gz
|
|
|
@ -1,59 +0,0 @@
|
||||||
################################################################################
|
|
||||||
#
|
|
||||||
# rktlet
|
|
||||||
#
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
# HEAD as of 2018-05-28
|
|
||||||
RKTLET_MASTER_COMMIT = fd7fc6bf4a25f03c22e5f6e30f3d9f12c468afcb
|
|
||||||
RKTLET_MASTER_VERSION = v0.1.0-21-gfd7fc6b
|
|
||||||
RKTLET_MASTER_SITE = https://github.com/kubernetes-incubator/rktlet/archive
|
|
||||||
RKTLET_MASTER_SOURCE = $(RKTLET_MASTER_COMMIT).tar.gz
|
|
||||||
RKTLET_MASTER_LICENSE = Apache-2.0
|
|
||||||
RKTLET_MASTER_LICENSE_FILES = LICENSE
|
|
||||||
|
|
||||||
RKTLET_MASTER_DEPENDENCIES = host-go
|
|
||||||
|
|
||||||
RKTLET_MASTER_GOPATH = "$(@D)/Godeps/_workspace"
|
|
||||||
RKTLET_MASTER_MAKE_ENV = $(HOST_GO_TARGET_ENV) \
|
|
||||||
CGO_ENABLED=1 \
|
|
||||||
GOBIN="$(@D)/bin" \
|
|
||||||
GOPATH="$(RKTLET_MASTER_GOPATH)" \
|
|
||||||
PATH=$(BR_PATH)
|
|
||||||
|
|
||||||
RKTLET_MASTER_GLDFLAGS = \
|
|
||||||
-buildmode=pie -X github.com/kubernetes-incubator/rktlet/version.Version=$(RKTLET_MASTER_VERSION)
|
|
||||||
|
|
||||||
ifeq ($(BR2_STATIC_LIBS),y)
|
|
||||||
RKTLET_MASTER_GLDFLAGS += -extldflags '-static'
|
|
||||||
endif
|
|
||||||
|
|
||||||
RKTLET_MASTER_GOTAGS = cgo static_build
|
|
||||||
|
|
||||||
ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
|
|
||||||
RKTLET_MASTER_GOTAGS += seccomp
|
|
||||||
RKTLET_MASTER_DEPENDENCIES += libseccomp host-pkgconf
|
|
||||||
endif
|
|
||||||
|
|
||||||
define RKTLET_MASTER_CONFIGURE_CMDS
|
|
||||||
mkdir -p $(RKTLET_MASTER_GOPATH)/src/github.com/kubernetes-incubator
|
|
||||||
ln -s $(@D) $(RKTLET_MASTER_GOPATH)/src/github.com/kubernetes-incubator/rktlet
|
|
||||||
endef
|
|
||||||
|
|
||||||
define RKTLET_MASTER_BUILD_CMDS
|
|
||||||
cd $(@D) && $(RKTLET_MASTER_MAKE_ENV) $(HOST_DIR)/usr/bin/go \
|
|
||||||
build -v -o $(@D)/bin/rktlet \
|
|
||||||
-tags "$(RKTLET_MASTER_GOTAGS)" -ldflags "$(RKTLET_MASTER_GLDFLAGS)" github.com/kubernetes-incubator/rktlet/cmd/server
|
|
||||||
endef
|
|
||||||
|
|
||||||
define RKTLET_MASTER_INSTALL_TARGET_CMDS
|
|
||||||
$(INSTALL) -D -m 0755 $(@D)/bin/rktlet $(TARGET_DIR)/usr/bin/rktlet
|
|
||||||
endef
|
|
||||||
|
|
||||||
define RKTLET_MASTER_INSTALL_INIT_SYSTEMD
|
|
||||||
$(INSTALL) -Dm644 \
|
|
||||||
$(BR2_EXTERNAL_MINIKUBE_PATH)/package/rktlet-master/rktlet.service \
|
|
||||||
$(TARGET_DIR)/usr/lib/systemd/system/rktlet.service
|
|
||||||
endef
|
|
||||||
|
|
||||||
$(eval $(generic-package))
|
|
|
@ -1,12 +0,0 @@
|
||||||
[Unit]
|
|
||||||
Description=rktlet: The rkt implementation of a Kubernetes Container Runtime
|
|
||||||
Documentation=https://github.com/kubernetes-incubator/rktlet/tree/master/docs
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
ExecStart=/usr/bin/rktlet
|
|
||||||
Restart=always
|
|
||||||
StartLimitInterval=0
|
|
||||||
RestartSec=10
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
## Cluster Configuration
|
## Cluster Configuration
|
||||||
|
|
||||||
* **Alternative Runtimes** ([alternative_runtimes.md](alternative_runtimes.md)): How to run minikube with rkt as the container runtime
|
* **Alternative Runtimes** ([alternative_runtimes.md](alternative_runtimes.md)): How to run minikube without Docker as the container runtime
|
||||||
|
|
||||||
* **Environment Variables** ([env_vars.md](env_vars.md)): The different environment variables that minikube understands
|
* **Environment Variables** ([env_vars.md](env_vars.md)): The different environment variables that minikube understands
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,5 @@
|
||||||
# Alternative runtimes
|
# Alternative runtimes
|
||||||
|
|
||||||
## Using rkt container engine
|
|
||||||
|
|
||||||
To use [rkt](https://github.com/coreos/rkt) as the container runtime run:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ minikube start --container-runtime=rkt
|
|
||||||
```
|
|
||||||
|
|
||||||
## Using CRI-O
|
## Using CRI-O
|
||||||
|
|
||||||
To use [CRI-O](https://github.com/kubernetes-sigs/cri-o) as the container runtime, run:
|
To use [CRI-O](https://github.com/kubernetes-sigs/cri-o) as the container runtime, run:
|
||||||
|
|
|
@ -5,7 +5,6 @@ This includes the configuration for an alternative bootable ISO image meant to b
|
||||||
It includes:
|
It includes:
|
||||||
|
|
||||||
- systemd as the init system
|
- systemd as the init system
|
||||||
- rkt
|
|
||||||
- docker
|
- docker
|
||||||
- CRI-O
|
- CRI-O
|
||||||
|
|
||||||
|
@ -40,7 +39,6 @@ The bootable ISO image will be available in `out/minikube.iso`.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ ./out/minikube start \
|
$ ./out/minikube start \
|
||||||
--container-runtime=rkt \
|
|
||||||
--iso-url=file://$GOPATH/src/k8s.io/minikube/out/minikube.iso
|
--iso-url=file://$GOPATH/src/k8s.io/minikube/out/minikube.iso
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ We'll cover these in detail below:
|
||||||
|
|
||||||
* When run in `none` mode, minikube has no built-in resource limit mechanism, which means you could deploy pods which would consume all of the hosts resources.
|
* When run in `none` mode, minikube has no built-in resource limit mechanism, which means you could deploy pods which would consume all of the hosts resources.
|
||||||
|
|
||||||
* minikube and the Kubernetes services it starts may interfere with other running software on the system. For instance, minikube will start and stop container runtimes via systemd, such as docker, rkt, containerd, cri-o.
|
* minikube and the Kubernetes services it starts may interfere with other running software on the system. For instance, minikube will start and stop container runtimes via systemd, such as docker, containerd, cri-o.
|
||||||
|
|
||||||
### Data loss
|
### Data loss
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,6 @@ var styles = map[string]style{
|
||||||
"celebrate": {Prefix: "🎉 "},
|
"celebrate": {Prefix: "🎉 "},
|
||||||
"container-runtime": {Prefix: "🎁 "},
|
"container-runtime": {Prefix: "🎁 "},
|
||||||
"Docker": {Prefix: "🐳 "},
|
"Docker": {Prefix: "🐳 "},
|
||||||
"rkt": {Prefix: "🚀 "},
|
|
||||||
"CRI-O": {Prefix: "🎁 "}, // This should be a snow-flake, but the emoji has a strange width on macOS
|
"CRI-O": {Prefix: "🎁 "}, // This should be a snow-flake, but the emoji has a strange width on macOS
|
||||||
"containerd": {Prefix: "📦 "},
|
"containerd": {Prefix: "📦 "},
|
||||||
"permissions": {Prefix: "🔑 "},
|
"permissions": {Prefix: "🔑 "},
|
||||||
|
|
|
@ -80,8 +80,6 @@ func New(c Config) (Manager, error) {
|
||||||
switch c.Type {
|
switch c.Type {
|
||||||
case "", "docker":
|
case "", "docker":
|
||||||
return &Docker{Socket: c.Socket, Runner: c.Runner}, nil
|
return &Docker{Socket: c.Socket, Runner: c.Runner}, nil
|
||||||
case "rkt":
|
|
||||||
return &Rkt{Socket: c.Socket, Runner: c.Runner}, nil
|
|
||||||
case "crio", "cri-o":
|
case "crio", "cri-o":
|
||||||
return &CRIO{Socket: c.Socket, Runner: c.Runner}, nil
|
return &CRIO{Socket: c.Socket, Runner: c.Runner}, nil
|
||||||
case "containerd":
|
case "containerd":
|
||||||
|
@ -94,7 +92,7 @@ func New(c Config) (Manager, error) {
|
||||||
// disableOthers disables all other runtimes except for me.
|
// disableOthers disables all other runtimes except for me.
|
||||||
func disableOthers(me Manager, cr CommandRunner) error {
|
func disableOthers(me Manager, cr CommandRunner) error {
|
||||||
// valid values returned by manager.Name()
|
// valid values returned by manager.Name()
|
||||||
runtimes := []string{"containerd", "crio", "rkt", "docker"}
|
runtimes := []string{"containerd", "crio", "docker"}
|
||||||
for _, name := range runtimes {
|
for _, name := range runtimes {
|
||||||
r, err := New(Config{Type: name, Runner: cr})
|
r, err := New(Config{Type: name, Runner: cr})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -33,7 +33,6 @@ func TestName(t *testing.T) {
|
||||||
}{
|
}{
|
||||||
{"", "Docker"},
|
{"", "Docker"},
|
||||||
{"docker", "Docker"},
|
{"docker", "Docker"},
|
||||||
{"rkt", "rkt"},
|
|
||||||
{"crio", "CRI-O"},
|
{"crio", "CRI-O"},
|
||||||
{"cri-o", "CRI-O"},
|
{"cri-o", "CRI-O"},
|
||||||
{"containerd", "containerd"},
|
{"containerd", "containerd"},
|
||||||
|
|
|
@ -1,140 +0,0 @@
|
||||||
/*
|
|
||||||
Copyright 2019 The Kubernetes Authors All rights reserved.
|
|
||||||
|
|
||||||
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 cruntime
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/golang/glog"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Rkt contains rkt runtime state
|
|
||||||
type Rkt struct {
|
|
||||||
Socket string
|
|
||||||
Runner CommandRunner
|
|
||||||
}
|
|
||||||
|
|
||||||
// Name is a human readable name for rkt
|
|
||||||
func (r *Rkt) Name() string {
|
|
||||||
return "rkt"
|
|
||||||
}
|
|
||||||
|
|
||||||
// Version retrieves the current version of this runtime
|
|
||||||
func (r *Rkt) Version() (string, error) {
|
|
||||||
ver, err := r.Runner.CombinedOutput("rkt version")
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
|
|
||||||
// rkt Version: 1.24.0
|
|
||||||
// appc Version: 0.8.10
|
|
||||||
line := strings.Split(ver, "\n")[0]
|
|
||||||
return strings.Replace(line, "rkt Version: ", "", 1), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// SocketPath returns the path to the socket file for rkt/rktlet
|
|
||||||
func (r *Rkt) SocketPath() string {
|
|
||||||
if r.Socket != "" {
|
|
||||||
return r.Socket
|
|
||||||
}
|
|
||||||
return "/var/run/rktlet.sock"
|
|
||||||
}
|
|
||||||
|
|
||||||
// DefaultCNI returns whether to use CNI networking by default
|
|
||||||
func (r *Rkt) DefaultCNI() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// Active returns if rkt is active on the host
|
|
||||||
func (r *Rkt) Active() bool {
|
|
||||||
err := r.Runner.Run("systemctl is-active --quiet service rkt-api")
|
|
||||||
return err == nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Available returns an error if it is not possible to use this runtime on a host
|
|
||||||
func (r *Rkt) Available() error {
|
|
||||||
return r.Runner.Run("command -v rkt")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Enable idempotently enables rkt on a host
|
|
||||||
func (r *Rkt) Enable() error {
|
|
||||||
if err := disableOthers(r, r.Runner); err != nil {
|
|
||||||
glog.Warningf("disableOthers: %v", err)
|
|
||||||
}
|
|
||||||
if err := populateCRIConfig(r.Runner, r.SocketPath()); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := enableIPForwarding(r.Runner); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
err := r.Runner.Run("sudo systemctl start rkt-api")
|
|
||||||
if err == nil {
|
|
||||||
err = r.Runner.Run("sudo systemctl start rkt-metadata")
|
|
||||||
}
|
|
||||||
if err == nil {
|
|
||||||
// Note: this is currently not included in minikube
|
|
||||||
err = r.Runner.Run("sudo systemctl start rktlet")
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Disable idempotently disables rkt on a host
|
|
||||||
func (r *Rkt) Disable() error {
|
|
||||||
err := r.Runner.Run("sudo systemctl stop rkt-api")
|
|
||||||
if err == nil {
|
|
||||||
err = r.Runner.Run("sudo systemctl stop rkt-metadata")
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// LoadImage loads an image into this runtime
|
|
||||||
func (r *Rkt) LoadImage(path string) error {
|
|
||||||
glog.Infof("Loading image: %s", path)
|
|
||||||
// Note: this command (import) does not currently exist for rkt
|
|
||||||
return r.Runner.Run(fmt.Sprintf("sudo rkt image import %s", path))
|
|
||||||
}
|
|
||||||
|
|
||||||
// KubeletOptions returns kubelet options for a rkt
|
|
||||||
func (r *Rkt) KubeletOptions() map[string]string {
|
|
||||||
return map[string]string{
|
|
||||||
"container-runtime": "remote",
|
|
||||||
"container-runtime-endpoint": fmt.Sprintf("unix://%s", r.SocketPath()),
|
|
||||||
"image-service-endpoint": fmt.Sprintf("unix://%s", r.SocketPath()),
|
|
||||||
"runtime-request-timeout": "15m",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ListContainers returns a list of managed by this container runtime
|
|
||||||
func (r *Rkt) ListContainers(filter string) ([]string, error) {
|
|
||||||
return listCRIContainers(r.Runner, filter)
|
|
||||||
}
|
|
||||||
|
|
||||||
// KillContainers removes containers based on ID
|
|
||||||
func (r *Rkt) KillContainers(ids []string) error {
|
|
||||||
return killCRIContainers(r.Runner, ids)
|
|
||||||
}
|
|
||||||
|
|
||||||
// StopContainers stops containers based on ID
|
|
||||||
func (r *Rkt) StopContainers(ids []string) error {
|
|
||||||
return stopCRIContainers(r.Runner, ids)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ContainerLogCmd returns the command to retrieve the log for a container based on ID
|
|
||||||
func (r *Rkt) ContainerLogCmd(id string, len int, follow bool) string {
|
|
||||||
return criContainerLogCmd(id, len, follow)
|
|
||||||
}
|
|
|
@ -89,7 +89,6 @@ func testPersistence(t *testing.T) {
|
||||||
"/var/lib/cni",
|
"/var/lib/cni",
|
||||||
"/var/lib/kubelet",
|
"/var/lib/kubelet",
|
||||||
"/var/lib/minikube",
|
"/var/lib/minikube",
|
||||||
"/var/lib/rkt",
|
|
||||||
"/var/lib/boot2docker",
|
"/var/lib/boot2docker",
|
||||||
} {
|
} {
|
||||||
output, err := minikubeRunner.SSH(fmt.Sprintf("df %s | tail -n 1 | awk '{print $1}'", dir))
|
output, err := minikubeRunner.SSH(fmt.Sprintf("df %s | tail -n 1 | awk '{print $1}'", dir))
|
||||||
|
|
Loading…
Reference in New Issue