Skip to content

Commit

Permalink
Fix merge errors (#22)
Browse files Browse the repository at this point in the history
* move sed to kubelet.sh, remove unnecessary exit 0 (Azure#2520)

* move sed to kubelet.sh, remove unnecessary exit 0

* circleci bump

* circleci bump

* fix merge errors and deployment succeeded

* added example

* sanitize example
  • Loading branch information
yolocs authored and wenwu449 committed Mar 27, 2018
1 parent 5639dce commit d0ebb9e
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 21 deletions.
90 changes: 90 additions & 0 deletions examples/kubernetes-aci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"apiVersion": "vlabs",
"plan": {},
"properties": {
"provisioningState": "",
"orchestratorProfile": {
"orchestratorType": "Kubernetes",
"orchestratorVersion": "1.8.2",
"kubernetesConfig": {
"networkPolicy": "none",
"kubeletConfig": {
"--cloud-provider": "",
"--cloud-config": "",
"--azure-container-registry-config": ""
},
"addons": [
{
"name": "tiller",
"enabled" : false
},
{
"name": "kubernetes-dashboard",
"enabled" : false
}
]
}
},
"masterProfile": {
"count": 1,
"dnsPrefix": "caas-test-eastus-linux-03",
"vmSize": "Standard_D2_v2",
"firstConsecutiveStaticIP": "10.240.255.5"
},
"agentPoolProfiles": [
{
"name": "system",
"count": 2,
"vmSize": "Standard_F1",
"availabilityProfile": "AvailabilitySet",
"storageProfile": "StorageAccount",
"osType": "Linux"
},
{
"name": "agentpool1",
"count": 2,
"vmSize": "Standard_F2",
"availabilityProfile": "AvailabilitySet",
"storageProfile": "StorageAccount",
"osType": "Linux"
},
{
"name": "agentpool2",
"count": 3,
"vmSize": "Standard_F1",
"availabilityProfile": "AvailabilitySet",
"storageProfile": "StorageAccount",
"osType": "Linux",
"osDiskSizeGB": 50
},
{
"name": "agentpool3",
"count": 3,
"vmSize": "Standard_F1",
"availabilityProfile": "AvailabilitySet",
"storageProfile": "StorageAccount",
"osType": "Linux",
"osDiskSizeGB": 50
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": ""
}
]
}
},
"windowsProfile": {
"adminUsername": "",
"adminPassword": ""
},
"servicePrincipalProfile": {
"clientId": "",
"secret": ""
},
"certificateProfile": {}
}
}
8 changes: 3 additions & 5 deletions parts/k8s/kubernetesagentcustomdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,9 @@ AGENT_ARTIFACTS_CONFIG_PLACEHOLDER
# SNAT outbound traffic from pods to destinations outside of VNET.
iptables -t nat -A POSTROUTING -m iprange ! --dst-range 168.63.129.16 -m addrtype ! --dst-type local ! -d {{WrapAsVariable "vnetCidr"}} -j MASQUERADE
{{end}}

exit 0
{{if not EnablePodSecurityPolicy}}
sed -i "s|apparmor_parser|d|g" "/etc/systemd/system/kubelet.service"
{{end}}

- path: "/opt/azure/containers/provision.sh"
permissions: "0744"
Expand Down Expand Up @@ -168,9 +169,6 @@ coreos:
[Service]
ExecStart=/opt/azure/containers/provision-setup.sh
{{else}}
{{if not EnablePodSecurityPolicy}}
sed -i "s|apparmor_parser|d|g" "/etc/systemd/system/kubelet.service"
{{end}}
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
Expand Down
7 changes: 5 additions & 2 deletions parts/k8s/kubernetesmastercustomscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ touch "${APISERVER_PUBLIC_KEY_PATH}"
chmod 0644 "${APISERVER_PUBLIC_KEY_PATH}"
chown root:root "${APISERVER_PUBLIC_KEY_PATH}"

set +x
echo "${KUBELET_PRIVATE_KEY}" | base64 --decode > "${KUBELET_PRIVATE_KEY_PATH}"
echo "${APISERVER_PUBLIC_KEY}" | base64 --decode > "${APISERVER_PUBLIC_KEY_PATH}"
set -x

if [[ ! -z "${MASTER_NODE}" ]]; then
echo "MASTER_NODE is non-empty, master node, configure azure json."

Expand All @@ -143,8 +148,6 @@ if [[ ! -z "${MASTER_NODE}" ]]; then
chown root:root "${AZURE_JSON_PATH}"

set +x
echo "${KUBELET_PRIVATE_KEY}" | base64 --decode > "${KUBELET_PRIVATE_KEY_PATH}"
echo "${APISERVER_PUBLIC_KEY}" | base64 --decode > "${APISERVER_PUBLIC_KEY_PATH}"
cat << EOF > "${AZURE_JSON_PATH}"
{
"cloud":"${TARGET_ENVIRONMENT}",
Expand Down
28 changes: 14 additions & 14 deletions pkg/acsengine/defaults-kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ func setKubeletConfig(cs *api.ContainerService) {
"--cgroups-per-qos": "true",
"--enforce-node-allocatable": "pods",
"--kubeconfig": "/var/lib/kubelet/kubeconfig",
"--azure-container-registry-config": "/etc/kubernetes/azure.json",
"--keep-terminated-pod-volumes": "false",
}

Expand All @@ -32,19 +31,20 @@ func setKubeletConfig(cs *api.ContainerService) {

// Default Kubelet config
defaultKubeletConfig := map[string]string{
"--cluster-domain": "cluster.local",
"--network-plugin": "cni",
"--pod-infra-container-image": cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase + KubeConfigs[o.OrchestratorVersion]["pause"],
"--max-pods": strconv.Itoa(DefaultKubernetesKubeletMaxPods),
"--eviction-hard": DefaultKubernetesHardEvictionThreshold,
"--node-status-update-frequency": KubeConfigs[o.OrchestratorVersion]["nodestatusfreq"],
"--image-gc-high-threshold": strconv.Itoa(DefaultKubernetesGCHighThreshold),
"--image-gc-low-threshold": strconv.Itoa(DefaultKubernetesGCLowThreshold),
"--non-masquerade-cidr": DefaultNonMasqueradeCidr,
"--cloud-provider": "azure",
"--cloud-config": "/etc/kubernetes/azure.json",
"--event-qps": DefaultKubeletEventQPS,
"--cadvisor-port": DefaultKubeletCadvisorPort,
"--cluster-domain": "cluster.local",
"--network-plugin": "cni",
"--pod-infra-container-image": cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase + KubeConfigs[o.OrchestratorVersion]["pause"],
"--max-pods": strconv.Itoa(DefaultKubernetesKubeletMaxPods),
"--eviction-hard": DefaultKubernetesHardEvictionThreshold,
"--node-status-update-frequency": KubeConfigs[o.OrchestratorVersion]["nodestatusfreq"],
"--image-gc-high-threshold": strconv.Itoa(DefaultKubernetesGCHighThreshold),
"--image-gc-low-threshold": strconv.Itoa(DefaultKubernetesGCLowThreshold),
"--non-masquerade-cidr": DefaultNonMasqueradeCidr,
"--cloud-provider": "azure",
"--cloud-config": "/etc/kubernetes/azure.json",
"--azure-container-registry-config": "/etc/kubernetes/azure.json",
"--event-qps": DefaultKubeletEventQPS,
"--cadvisor-port": DefaultKubeletCadvisorPort,
}

// If no user-configurable kubelet config values exists, use the defaults
Expand Down

0 comments on commit d0ebb9e

Please sign in to comment.