use drop in configuration files for crio
parent
6189742a25
commit
921816747a
|
@ -0,0 +1,8 @@
|
|||
[crio.image]
|
||||
# pause_image = ""
|
||||
|
||||
[crio.network]
|
||||
# cni_default_network = ""
|
||||
|
||||
[crio.runtime]
|
||||
# cgroup_manager = ""
|
|
@ -39,6 +39,7 @@ endef
|
|||
define CRIO_BIN_INSTALL_TARGET_CMDS
|
||||
mkdir -p $(TARGET_DIR)/usr/share/containers/oci/hooks.d
|
||||
mkdir -p $(TARGET_DIR)/etc/containers/oci/hooks.d
|
||||
mkdir -p $(TARGET_DIR)/etc/crio/crio.conf.d
|
||||
|
||||
$(INSTALL) -Dm755 \
|
||||
$(@D)/bin/crio \
|
||||
|
@ -55,6 +56,9 @@ define CRIO_BIN_INSTALL_TARGET_CMDS
|
|||
$(INSTALL) -Dm644 \
|
||||
$(CRIO_BIN_PKGDIR)/registries.conf \
|
||||
$(TARGET_DIR)/etc/containers/registries.conf
|
||||
$(INSTALL) -Dm644 \
|
||||
$(CRIO_BIN_PKGDIR)/02-crio.conf \
|
||||
$(TARGET_DIR)/etc/crio/crio.conf.d/02-crio.conf
|
||||
|
||||
mkdir -p $(TARGET_DIR)/etc/sysconfig
|
||||
echo 'CRIO_OPTIONS="--log-level=debug"' > $(TARGET_DIR)/etc/sysconfig/crio
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
[crio.image]
|
||||
# pause_image = ""
|
||||
|
||||
[crio.network]
|
||||
# cni_default_network = ""
|
||||
|
||||
[crio.runtime]
|
||||
# cgroup_manager = ""
|
|
@ -43,6 +43,7 @@ ARG CRIO_VERSION="1.22"
|
|||
# copy in static files (configs, scripts)
|
||||
COPY deploy/kicbase/10-network-security.conf /etc/sysctl.d/10-network-security.conf
|
||||
COPY deploy/kicbase/11-tcp-mtu-probing.conf /etc/sysctl.d/11-tcp-mtu-probing.conf
|
||||
COPY deploy/kicbase/02-crio.conf /etc/crio/crio.conf.d/02-crio.conf
|
||||
COPY deploy/kicbase/clean-install /usr/local/bin/clean-install
|
||||
COPY deploy/kicbase/entrypoint /usr/local/bin/entrypoint
|
||||
COPY --from=0 /src/cmd/auto-pause/auto-pause /bin/auto-pause
|
||||
|
|
|
@ -41,7 +41,7 @@ import (
|
|||
|
||||
const (
|
||||
// CRIOConfFile is the path to the CRI-O configuration
|
||||
crioConfigFile = "/etc/crio/crio.conf"
|
||||
crioConfigFile = "/etc/crio/crio.conf.d/02-crio.conf"
|
||||
)
|
||||
|
||||
// CRIO contains CRIO runtime state
|
||||
|
@ -57,7 +57,7 @@ type CRIO struct {
|
|||
func generateCRIOConfig(cr CommandRunner, imageRepository string, kv semver.Version) error {
|
||||
pauseImage := images.Pause(kv, imageRepository)
|
||||
|
||||
c := exec.Command("/bin/bash", "-c", fmt.Sprintf("sudo sed -e 's|^pause_image = .*$|pause_image = \"%s\"|' -i %s", pauseImage, crioConfigFile))
|
||||
c := exec.Command("/bin/bash", "-c", fmt.Sprintf("sudo sed -e 's|^.*pause_image = .*$|pause_image = \"%s\"|' -i %s", pauseImage, crioConfigFile))
|
||||
if _, err := cr.RunCmd(c); err != nil {
|
||||
return errors.Wrap(err, "generateCRIOConfig")
|
||||
}
|
||||
|
@ -73,8 +73,7 @@ func generateCRIOConfig(cr CommandRunner, imageRepository string, kv semver.Vers
|
|||
}
|
||||
|
||||
func (r *CRIO) forceSystemd() error {
|
||||
// remove `cgroup_manager` since cri-o defaults to `systemd` if nothing set
|
||||
c := exec.Command("/bin/bash", "-c", fmt.Sprintf("sudo sed -e 's|^cgroup_manager = .*$||' -i %s", crioConfigFile))
|
||||
c := exec.Command("/bin/bash", "-c", fmt.Sprintf("sudo sed -e 's|^.*cgroup_manager = .*$|cgroup_manager = \"systemd\"|' -i %s", crioConfigFile))
|
||||
if _, err := r.Runner.RunCmd(c); err != nil {
|
||||
return errors.Wrap(err, "force systemd")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue