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

Commit

Permalink
add requiresDocker parameter
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
  • Loading branch information
jessfraz committed Jun 19, 2018
1 parent 1a781dc commit 977bf3b
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 4 deletions.
9 changes: 7 additions & 2 deletions parts/k8s/kubernetesagentcustomdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ write_files:
content: !!binary |
{{WrapAsVariable "provisionSource"}}

{{if not .IsCoreOS}}
{{if .KubernetesConfig.RequiresDocker}}
{{if not .IsCoreOS}}
- path: "/etc/systemd/system/docker.service.d/clear_mount_propagation_flags.conf"
permissions: "0644"
owner: "root"
content: |
[Service]
MountFlags=shared
{{end}}
{{end}}
- path: "/etc/systemd/system/docker.service.d/exec_start.conf"
permissions: "0644"
owner: "root"
Expand Down Expand Up @@ -43,6 +44,7 @@ write_files:
}
}{{end}}
}
{{end}}

- path: "/etc/kubernetes/certs/ca.crt"
permissions: "0644"
Expand Down Expand Up @@ -139,7 +141,10 @@ AGENT_ARTIFACTS_CONFIG_PLACEHOLDER
content: |
#!/bin/bash
/usr/bin/mkdir -p /etc/kubernetes/manifests
{{if .KubernetesConfig.RequiresDocker}}
usermod -aG docker {{WrapAsVariable "username"}}
{{end}}
systemctl enable rpcbind
systemctl enable rpc-statd
Expand Down
10 changes: 8 additions & 2 deletions parts/k8s/kubernetescustomscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,15 @@ if [ -f $CUSTOM_SEARCH_DOMAIN_SCRIPT ]; then
fi

installDeps
installDocker

if [[ "$CONTAINER_RUNTIME" == "docker" ]]; then
installDocker
ensureDocker
fi

runAptDaily
configureK8s
ensureDocker

configNetworkPlugin

if [[ ! -z "${MASTER_NODE}" ]]; then
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 @@ -376,7 +378,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
6 changes: 6 additions & 0 deletions pkg/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -978,3 +978,9 @@ func (k *KubernetesConfig) PrivateJumpboxProvision() bool {
}
return false
}

// RequiresDocker returns if the kubernetes settings require docker to be installed.
func (k *KubernetesConfig) RequiresDocker() bool {
runtime := strings.ToLower(k.ContainerRuntime)
return runtime == "docker" || runtime == ""
}
6 changes: 6 additions & 0 deletions pkg/api/vlabs/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,3 +633,9 @@ func (l *LinuxProfile) HasCustomNodesDNS() bool {
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 {
runtime := strings.ToLower(k.ContainerRuntime)
return runtime == "docker" || runtime == ""
}

0 comments on commit 977bf3b

Please sign in to comment.