Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
remove docker from provisioning install
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <[email protected]>
  • Loading branch information
jessfraz committed Jun 12, 2018
1 parent 613dee9 commit 2e7c87f
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 5 deletions.
5 changes: 5 additions & 0 deletions parts/k8s/kubernetesagentcustomdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ write_files:
content: !!binary |
{{WrapAsVariable "provisionSource"}}

{{if .RequiresDocker}}
{{if not .IsCoreOS}}
- path: "/etc/systemd/system/docker.service.d/clear_mount_propagation_flags.conf"
permissions: "0644"
Expand Down Expand Up @@ -43,6 +44,7 @@ write_files:
}
}{{end}}
}
{{end}}

- path: "/etc/kubernetes/certs/ca.crt"
permissions: "0644"
Expand Down Expand Up @@ -138,7 +140,10 @@ AGENT_ARTIFACTS_CONFIG_PLACEHOLDER
content: |
#!/bin/bash
/usr/bin/mkdir -p /etc/kubernetes/manifests
{{if .RequiresDocker}}
usermod -aG docker {{WrapAsVariable "username"}}
{{end}}
systemctl enable rpcbind
systemctl enable rpc-statd
Expand Down
10 changes: 5 additions & 5 deletions parts/k8s/kubernetescustomscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ function ensureKubelet() {

function extractHyperkube(){
TMP_DIR=$(mktemp -d)
retrycmd_if_failure 100 1 30 curl -sSL -o /usr/local/bin/img "https://github.com/genuinetools/img/releases/download/v0.3.1/img-linux-amd64"
retrycmd_if_failure 100 1 30 curl -sSL -o /usr/local/bin/img "https://github.com/genuinetools/img/releases/download/v0.3.3/img-linux-amd64"
chmod +x /usr/local/bin/img
retrycmd_if_failure 100 1 60 img pull $HYPERKUBE_URL || $ERR_K8S_DOWNLOAD_TIMEOUT
path=$(find /tmp/img -name "hyperkube")
Expand Down Expand Up @@ -523,6 +523,10 @@ if [[ ! -z "${MASTER_NODE}" ]]; then
echo `date`,`hostname`, configAddonsDone>>/opt/m
fi

# containerd needs to be installed before extractHyperkube
# so runc is present.
echo `date`,`hostname`, installContainerdStart>>/opt/m
installContainerd
echo `date`,`hostname`, extractHyperkubeStart>>/opt/m
extractHyperkube
echo `date`,`hostname`, extractHyperkubeDone>>/opt/m
Expand All @@ -533,10 +537,6 @@ if [[ "$CONTAINER_RUNTIME" == "clear-containers" ]]; then
installClearContainersRuntime
fi
fi
if [[ "$CONTAINER_RUNTIME" == "clear-containers" ]] || [[ "$CONTAINER_RUNTIME" == "containerd" ]]; then
echo `date`,`hostname`, installContainerdStart>>/opt/m
installContainerd
fi
echo `date`,`hostname`, ensureContainerdStart>>/opt/m
ensureContainerd

Expand Down
5 changes: 5 additions & 0 deletions parts/k8s/kubernetesmastercustomdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ write_files:
content: !!binary |
{{WrapAsVariable "provisionSource"}}

{{if .OrchestratorProfile.KubernetesConfig.RequiresDocker}}
{{if not .MasterProfile.IsCoreOS}}
- path: "/etc/systemd/system/docker.service.d/clear_mount_propagation_flags.conf"
permissions: "0644"
Expand Down Expand Up @@ -46,6 +47,7 @@ write_files:
"max-file": "5"
}
}
{{end}}

- path: "/etc/kubernetes/certs/ca.crt"
permissions: "0644"
Expand Down Expand Up @@ -373,7 +375,10 @@ MASTER_ARTIFACTS_CONFIG_PLACEHOLDER
systemctl restart etcd-member
retrycmd_if_failure 5 5 10 curl --retry 5 --retry-delay 10 --retry-max-time 10 --max-time 60 http://127.0.0.1:2379/v2/machines
mkdir -p /etc/kubernetes/manifests
{{if .OrchestratorProfile.KubernetesConfig.RequiresDocker}}
usermod -aG docker {{WrapAsVariable "username"}}
{{end}}
{{if EnableAggregatedAPIs}}
sudo bash /etc/kubernetes/generate-proxy-certs.sh
Expand Down
10 changes: 10 additions & 0 deletions pkg/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,11 @@ func (a *AgentPoolProfile) IsAcceleratedNetworkingEnabled() bool {
return a.AcceleratedNetworkingEnabled
}

// RequiresDocker returns if the kubernetes settings require docker to be installed.
func (a *AgentPoolProfile) RequiresDocker() bool {
return strings.ToLower(a.KubernetesConfig.ContainerRuntime) == "docker"
}

// HasSecrets returns true if the customer specified secrets to install
func (w *WindowsProfile) HasSecrets() bool {
return len(w.Secrets) > 0
Expand Down Expand Up @@ -984,3 +989,8 @@ func (k *KubernetesConfig) PrivateJumpboxProvision() bool {
}
return false
}

// RequiresDocker returns if the kubernetes settings require docker to be installed.
func (k *KubernetesConfig) RequiresDocker() bool {
return strings.ToLower(k.ContainerRuntime) == "docker"
}
10 changes: 10 additions & 0 deletions pkg/api/vlabs/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,17 @@ func (l *LinuxProfile) HasCustomNodesDNS() bool {
return false
}

// RequiresDocker returns if the kubernetes settings require docker to be installed.
func (a *AgentPoolProfile) RequiresDocker() bool {
return strings.ToLower(a.KubernetesConfig.ContainerRuntime) == "docker"
}

// IsSwarmMode returns true if this template is for Swarm Mode orchestrator
func (o *OrchestratorProfile) IsSwarmMode() bool {
return o.OrchestratorType == SwarmMode
}

// RequiresDocker returns if the kubernetes settings require docker to be installed.
func (k *KubernetesConfig) RequiresDocker() bool {
return strings.ToLower(k.ContainerRuntime) == "docker"
}

0 comments on commit 2e7c87f

Please sign in to comment.