Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix merge errors and make --azure-container-registry-config optional #22

Merged
merged 4 commits into from
Mar 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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