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

Commit

Permalink
k8s provision only in CSE (#2881)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfrancis authored May 16, 2018
1 parent e5d9caf commit c151aad
Show file tree
Hide file tree
Showing 6 changed files with 304 additions and 329 deletions.
33 changes: 4 additions & 29 deletions parts/k8s/kubernetesagentcustomdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,38 +174,13 @@ coreos:
ExecStart=/opt/azure/containers/provision-setup.sh
{{else}}
runcmd:
- echo `date`,`hostname`, startruncmd>>/opt/m
# the first arg is the number of retries, the second arg is the wait duration between two retries and the rest of the args are the cmd to run
- set -x
- . /opt/azure/containers/provision_source.sh
- retrycmd_if_failure 20 1 5 apt-mark hold walinuxagent{{GetKubernetesAgentPreprovisionYaml .}}
- echo `date`,`hostname`, preaptupdate>>/opt/m
- apt_get_update
- echo `date`,`hostname`, postaptupdate>>/opt/m
- retrycmd_if_failure 5 10 120 apt-get install -y apt-transport-https ca-certificates nfs-common iptables iproute2 socat util-linux mount ebtables ethtool init-system-helpers
- echo `date`,`hostname`, aptinstall>>/opt/m
- retrycmd_if_failure 10 1 3 systemctl enable rpcbind rpc-statd
- systemctl_restart 20 1 10 rpcbind
- systemctl_restart 20 1 10 rpc-statd
- echo `date`,`hostname`, predockerinstall>>/opt/m
- retrycmd_if_failure_no_stats 180 1 5 curl -fsSL https://aptdocker.azureedge.net/gpg > /tmp/aptdocker.gpg
- retrycmd_if_failure 10 1 5 apt-key add /tmp/aptdocker.gpg
- echo "deb {{WrapAsVariable "dockerEngineDownloadRepo"}} ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
- "echo \"Package: docker-engine\nPin: version {{WrapAsVariable "dockerEngineVersion"}}\nPin-Priority: 550\n\" > /etc/apt/preferences.d/docker.pref"
- apt_get_update
- retrycmd_if_failure 20 1 120 apt-get install -y ebtables docker-engine
- echo "ExecStartPost=/sbin/iptables -P FORWARD ACCEPT" >> /etc/systemd/system/docker.service.d/exec_start.conf
- touch /opt/azure/containers/dockerinstall.complete
- echo `date`,`hostname`, postdockerinstall>>/opt/m
- mkdir -p /etc/kubernetes/manifests
- usermod -aG docker {{WrapAsVariable "username"}}
- timeout 10 apt-mark hold walinuxagent{{GetKubernetesAgentPreprovisionYaml .}}
- timeout 10 apt-mark unhold walinuxagent
{{if IsNSeriesSKU .}}
- . /opt/azure/containers/provision_source.sh
{{GetGPUDriversInstallScript .}}
{{end}}
- echo `date`,`hostname`, PRE-APT-SYSTEMD-DAILY>>/opt/m
- retrycmd_if_failure 20 1 10 /usr/lib/apt/apt.systemd.daily
- echo `date`,`hostname`, POST-APT-SYSTEMD-DAILY>>/opt/m
- retrycmd_if_failure 20 5 5 apt-mark unhold walinuxagent
- mkdir -p /opt/azure/containers && touch /opt/azure/containers/runcmd.complete
- echo `date`,`hostname`, endruncmd>>/opt/m
- mkdir -p /var/log/azure && touch /var/log/azure/cloud-init.complete
{{end}}
Loading

0 comments on commit c151aad

Please sign in to comment.