From 45331ff185461ed65a0e2bfd4d51e84327c2130b Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Wed, 7 Jun 2023 12:53:25 +0200 Subject: [PATCH] Fix default installer to make local cluster pull images from docker proxy This change also reverts previous commit bc5422cf9fd9d21d7028d445fe1982080101611a. Change-Id: Ia72ce8677a8ebe15f15e6f79d8b158654393f93a Signed-off-by: garciadeblas --- installers/full_install_osm.sh | 14 +------------- installers/install_docker_ce.sh | 8 ++++++++ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index 3ca7db7a..03439a1c 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -216,22 +216,10 @@ function docker_login() { [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function } -function create_k8s_secret_regcred() { - [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function - echo "Creating K8s secret regcred with the docker registry credentials from $HOME/.docker/config.json" - kubectl -n osm create secret generic regcred \ - --from-file=.dockerconfigjson=$HOME/.docker/config.json \ - --type=kubernetes.io/dockerconfigjson - [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function -} - function pull_docker_images() { [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function echo "Pulling docker images" - if [ -n "${DOCKER_REGISTRY_URL}" ]; then - docker_login - create_k8s_secret_registrycreds - fi + [ -n "${DOCKER_REGISTRY_URL}" ] && docker_login echo "Pulling non-OSM docker images" if [ -z "$TO_REBUILD" ] || echo $TO_REBUILD | grep -q KAFKA ; then diff --git a/installers/install_docker_ce.sh b/installers/install_docker_ce.sh index 7a15d638..64c23c28 100755 --- a/installers/install_docker_ce.sh +++ b/installers/install_docker_ce.sh @@ -89,6 +89,14 @@ EOF" sudo service docker restart echo "... restarted Docker service again" fi + + echo "Configuring containerd" + sudo mv /etc/containerd/config.toml /etc/containerd/config.toml.orig 2>/dev/null + sudo bash -c "containerd config default > /etc/containerd/config.toml" + sudo sed -i "s#\[plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors\]#\[plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors\]\n \[plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors.\"docker.io\"\]\n endpoint = \[\"${DOCKER_PROXY_URL}\"\]\n \[plugins.\"io.containerd.grpc.v1.cri\".registry.mirrors.\"registry.hub.docker.com\"]\n endpoint = \[\"${DOCKER_PROXY_URL}\"]#" /etc/containerd/config.toml + sudo diff /etc/containerd/config.toml.orig /etc/containerd/config.toml + sudo service containerd restart + [ -z "${DEBUG_INSTALL}" ] || ! echo "File: /etc/docker/daemon.json" || cat /etc/docker/daemon.json sg docker -c "docker version" || FATAL "Docker installation failed" echo "... Docker CE installation done" -- 2.25.1