[ -n "${INSTALL_NGSA}" ] || OSM_HELM_OPTS="${OSM_HELM_OPTS} --set global.oldServiceAssurance=true"
if [ -n "${OSM_BEHIND_PROXY}" ]; then
OSM_HELM_OPTS="${OSM_HELM_OPTS} --set global.behindHttpProxy=true"
- [ -n "${HTTP_PROXY}" ] && OSM_HELM_OPTS="${OSM_HELM_OPTS} --set global.httpProxy.HTTP_PROXY=${HTTP_PROXY}"
- [ -n "${HTTPS_PROXY}" ] && OSM_HELM_OPTS="${OSM_HELM_OPTS} --set global.httpProxy.HTTPS_PROXY=${HTTPS_PROXY}"
- [ -n "${NO_PROXY}" ] && OSM_HELM_OPTS="${OSM_HELM_OPTS} --set global.httpProxy.NO_PROXY=${NO_PROXY}"
+ [ -n "${HTTP_PROXY}" ] && OSM_HELM_OPTS="${OSM_HELM_OPTS} --set global.httpProxy.HTTP_PROXY=\"${HTTP_PROXY}\""
+ [ -n "${HTTPS_PROXY}" ] && OSM_HELM_OPTS="${OSM_HELM_OPTS} --set global.httpProxy.HTTPS_PROXY=\"${HTTPS_PROXY}\""
+ if [ -n "${NO_PROXY}" ]; then
+ if [[ ! "${NO_PROXY}" =~ .*".svc".* ]]; then
+ NO_PROXY="${NO_PROXY},.svc"
+ fi
+ if [[ ! "${NO_PROXY}" =~ .*".cluster.local".* ]]; then
+ NO_PROXY="${NO_PROXY},.cluster.local"
+ fi
+ OSM_HELM_OPTS="${OSM_HELM_OPTS} --set global.httpProxy.NO_PROXY=\"${NO_PROXY//,/\,}\""
+ fi
fi
if [ -n "${INSTALL_JUJU}" ]; then
set +eux
+function configure_containerd() {
+ echo "Configuring containerd to expose CRI and use systemd cgroup"
+ 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/SystemdCgroup = false/SystemdCgroup = true/' /etc/containerd/config.toml
+ if [ -n "${DOCKER_PROXY_URL}" ]; then
+ echo "Configuring ${DOCKER_PROXY_URL} as registry mirror in /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
+ fi
+ if [ -n "${OSM_BEHIND_PROXY}" ] ; then
+ echo "Configuring http proxies in /etc/systemd/system/containerd.service.d/http-proxy.conf"
+ if ! [ -f /etc/systemd/system/containerd.service.d/http-proxy.conf ] ; then
+ sudo mkdir -p /etc/systemd/system/containerd.service.d
+ cat << EOF | sudo tee -a /etc/systemd/system/containerd.service.d/http-proxy.conf
+[Service]
+EOF
+ fi
+ [ -n "${HTTP_PROXY}" ] && sudo bash -c "cat <<EOF >> /etc/systemd/system/containerd.service.d/http-proxy.conf
+Environment=\"HTTP_PROXY=${HTTP_PROXY}\"
+EOF"
+ [ -n "${HTTPS_PROXY}" ] && sudo bash -c "cat <<EOF >> /etc/systemd/system/containerd.service.d/http-proxy.conf
+Environment=\"HTTPS_PROXY=${HTTPS_PROXY}\"
+EOF"
+ [ -n "${NO_PROXY}" ] && sudo bash -c "cat <<EOF >> /etc/systemd/system/containerd.service.d/http-proxy.conf
+Environment=\"NO_PROXY=${NO_PROXY}\"
+EOF"
+ fi
+ sudo systemctl restart containerd
+}
+
function install_docker_ce() {
# installs and configures Docker CE
[ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
echo "... restarted Docker service"
fi
- echo "Configuring containerd to expose CRI, use systemd cgroup and use DOCKER_PROXY_URL as registry mirror"
- 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/SystemdCgroup = false/SystemdCgroup = true/' /etc/containerd/config.toml
- if [ -n "${DOCKER_PROXY_URL}" ]; then
- 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
- fi
- sudo systemctl restart containerd
+ configure_containerd
[ -z "${DEBUG_INSTALL}" ] || ! echo "File: /etc/docker/daemon.json" || cat /etc/docker/daemon.json
echo "Testing Docker CE installation ..."