-
Notifications
You must be signed in to change notification settings - Fork 56
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
chore: set master distro to aks-ubuntu-18.04 for master branch jobs #178
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
46 changes: 16 additions & 30 deletions
46
extensions/master_extension/v1/win-e2e-master-extension.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,28 @@ | ||
#!/bin/bash | ||
|
||
echo "start master extension" >> /tmp/master_extension.log | ||
|
||
KUBECONFIG="$(find /home/*/.kube/config)" | ||
KUBECTL="kubectl --kubeconfig=${KUBECONFIG}" | ||
|
||
# Wait for coredns pod to be ready | ||
while true; do | ||
COREDNS_READY=$(${KUBECTL} get pods -l k8s-app=kube-dns -n kube-system -o custom-columns=STATUS:status.containerStatuses[0].ready --no-headers) | ||
if [ "${COREDNS_READY}" = "true" ]; then | ||
echo "$(date -R) - coredns is ready" >> /tmp/master_extension.log | ||
${KUBECTL} get pods --all-namespaces >> /tmp/master_extension.log | ||
break | ||
fi | ||
sleep 2 | ||
done | ||
wait_for_kube_system_pods() { | ||
while true; do | ||
NOTREADY_PODS=$(${KUBECTL} get pods -n kube-system -o custom-columns=STATUS:status.containerStatuses[0].ready --no-headers | grep -v "true") | ||
if [ -z "${NOTREADY_PODS}" ]; then | ||
echo "$(date -R) - All kube-system pods are ready" >> /tmp/master_extension.log | ||
${KUBECTL} get pods --all-namespaces >> /tmp/master_extension.log | ||
break | ||
fi | ||
sleep 2 | ||
done | ||
} | ||
|
||
# Wait for all pods in kube-system namespace to be ready before applying taints | ||
while true; do | ||
NOTREADY_PODS=$(${KUBECTL} get pods -n kube-system -o custom-columns=STATUS:status.containerStatuses[0].ready --no-headers | grep -v "true") | ||
if [ -z "${NOTREADY_PODS}" ]; then | ||
echo "$(date -R) - All kube-system pods are ready" >> /tmp/master_extension.log | ||
${KUBECTL} get pods --all-namespaces >> /tmp/master_extension.log | ||
break | ||
fi | ||
sleep 2 | ||
done | ||
export -f wait_for_kube_system_pods | ||
timeout 300 bash -c wait_for_kube_system_pods || exit 1 | ||
|
||
master_node=$(${KUBECTL} get nodes | grep master | awk '{print $1}') | ||
|
||
${KUBECTL} taint nodes "$master_node" node-role.kubernetes.io/master=:NoSchedule | ||
${KUBECTL} label nodes "$master_node" node-role.kubernetes.io/master=NoSchedule | ||
|
||
# Prepull images | ||
${KUBECTL} create -f https://raw.githubusercontent.com/kubernetes-sigs/windows-testing/master/gce/prepull.yaml | ||
# Wait 15 minutes for the test images to be pulled onto the nodes. | ||
sleep 15m | ||
# Check the status of the pods. | ||
${KUBECTL} get pods -o wide >> /tmp/master_extension.log | ||
# Delete the pods anyway since pre-pulling is best-effort | ||
${KUBECTL} delete -f https://raw.githubusercontent.com/kubernetes-sigs/windows-testing/master/gce/prepull.yaml | ||
# Wait a few more minutes for the pod to be cleaned up. | ||
sleep 3m | ||
echo "finish master extension" >> /tmp/master_extension.log |
1 change: 1 addition & 0 deletions
1
extensions/master_extension_prepull/v1/supported-orchestrators.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
["Kubernetes"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"name": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), 'win-e2e-master-extension')]", | ||
"type": "Microsoft.Resources/deployments", | ||
"apiVersion": "[variables('apiVersionDeployments')]", | ||
"dependsOn": [ | ||
"[concat('Microsoft.Compute/virtualMachines/', EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET), '/extensions/cse', '-EXTENSION_TARGET_VM_TYPE-', copyIndex(EXTENSION_LOOP_OFFSET))]" | ||
], | ||
"copy": { | ||
"count": "EXTENSION_LOOP_COUNT", | ||
"name": "wine2emasterextensionloop" | ||
}, | ||
"properties": { | ||
"mode": "Incremental", | ||
"templateLink": { | ||
"uri": "EXTENSION_URL_REPLACEextensions/master_extension_prepull/v1/template.json", | ||
"contentVersion": "1.0.0.0" | ||
}, | ||
"parameters": { | ||
"artifactsLocation": { | ||
"value": "EXTENSION_URL_REPLACE" | ||
}, | ||
"apiVersionDeployments": { | ||
"value": "[variables('apiVersionDeployments')]" | ||
}, | ||
"targetVMName": { | ||
"value": "[concat(EXTENSION_TARGET_VM_NAME_PREFIX, copyIndex(EXTENSION_LOOP_OFFSET))]" | ||
}, | ||
"targetVMType": { | ||
"value": "EXTENSION_TARGET_VM_TYPE" | ||
}, | ||
"extensionParameters": { | ||
"value": "EXTENSION_PARAMETERS_REPLACE" | ||
}, | ||
"vmIndex":{ | ||
"value": "[copyIndex(EXTENSION_LOOP_OFFSET)]" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{ | ||
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | ||
"contentVersion": "1.0.0.0", | ||
"parameters": { | ||
"artifactsLocation": { | ||
"type": "string", | ||
"minLength": 1, | ||
"metadata": { | ||
"description": "Artifacts Location - URL" | ||
} | ||
}, | ||
"apiVersionDeployments": { | ||
"type": "string", | ||
"minLength": 1, | ||
"metadata": { | ||
"description": "Deployments API Version" | ||
} | ||
}, | ||
"targetVMName":{ | ||
"type": "string", | ||
"minLength": 1, | ||
"metadata": { | ||
"description": "Name of the vm to run the " | ||
} | ||
}, | ||
"targetVMType":{ | ||
"type": "string", | ||
"minLength": 1, | ||
"metadata": { | ||
"description": "Type of the vm to run the extension: master or agent " | ||
} | ||
}, | ||
"extensionParameters": { | ||
"type": "securestring", | ||
"minLength": 0, | ||
"metadata": { | ||
"description": "Custom Parameter for Extension - for hello-world, this is empty" | ||
} | ||
}, | ||
"vmIndex": { | ||
"type": "int", | ||
"metadata": { | ||
"description": "index in the pool of the current agent, used so that we can get the extension name right" | ||
} | ||
} | ||
}, | ||
"variables": { | ||
"singleQuote": "'", | ||
"initScriptUrl": "[concat(parameters('artifactsLocation'), 'extensions/master_extension_prepull/v1/win-e2e-master-extension.sh')]" | ||
}, | ||
"resources": [ | ||
{ | ||
"apiVersion": "[parameters('apiVersionDeployments')]", | ||
"dependsOn": [], | ||
"location": "[resourceGroup().location]", | ||
"type": "Microsoft.Compute/virtualMachines/extensions", | ||
"name": "[concat(parameters('targetVMName'),'/cse', '-', parameters('targetVMType'), '-', parameters('vmIndex'))]", | ||
"properties": { | ||
"publisher": "Microsoft.Azure.Extensions", | ||
"type": "CustomScript", | ||
"typeHandlerVersion": "2.0", | ||
"autoUpgradeMinorVersion": true, | ||
"settings": { | ||
"fileUris": [ | ||
"[variables('initScriptUrl')]" | ||
] | ||
}, | ||
"protectedSettings": { | ||
"commandToExecute": "[concat('/bin/bash -c \"/bin/bash ./win-e2e-master-extension.sh ', variables('singleQuote'), parameters('extensionParameters'), variables('singleQuote'), ' >> /var/log/azure/win-e2e-master-extension.log 2>&1\"')]" | ||
} | ||
} | ||
} | ||
], | ||
"outputs": { } | ||
} |
39 changes: 39 additions & 0 deletions
39
extensions/master_extension_prepull/v1/win-e2e-master-extension.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
echo "start master extension" >> /tmp/master_extension.log | ||
|
||
KUBECONFIG="$(find /home/*/.kube/config)" | ||
KUBECTL="kubectl --kubeconfig=${KUBECONFIG}" | ||
|
||
wait_for_kube_system_pods() { | ||
while true; do | ||
NOTREADY_PODS=$(${KUBECTL} get pods -n kube-system -o custom-columns=STATUS:status.containerStatuses[0].ready --no-headers | grep -v "true") | ||
if [ -z "${NOTREADY_PODS}" ]; then | ||
echo "$(date -R) - All kube-system pods are ready" >> /tmp/master_extension.log | ||
${KUBECTL} get pods --all-namespaces >> /tmp/master_extension.log | ||
break | ||
fi | ||
sleep 2 | ||
done | ||
} | ||
|
||
export -f wait_for_kube_system_pods | ||
timeout 300 bash -c wait_for_kube_system_pods || exit 1 | ||
|
||
master_node=$(${KUBECTL} get nodes | grep master | awk '{print $1}') | ||
|
||
${KUBECTL} taint nodes "$master_node" node-role.kubernetes.io/master=:NoSchedule | ||
${KUBECTL} label nodes "$master_node" node-role.kubernetes.io/master=NoSchedule | ||
|
||
# Prepull images | ||
${KUBECTL} create -f https://raw.githubusercontent.com/kubernetes-sigs/windows-testing/master/gce/prepull.yaml | ||
# Wait 15 minutes for the test images to be pulled onto the nodes. | ||
sleep 15m | ||
# Check the status of the pods. | ||
${KUBECTL} get pods -o wide >> /tmp/master_extension.log | ||
# Delete the pods anyway since pre-pulling is best-effort | ||
${KUBECTL} delete -f https://raw.githubusercontent.com/kubernetes-sigs/windows-testing/master/gce/prepull.yaml | ||
# Wait a few more minutes for the pod to be cleaned up. | ||
sleep 3m | ||
|
||
echo "finish master extension" >> /tmp/master_extension.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is possible to set the VHD imageVersion explicitly? This way we know the version that is deployed is consistent across tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK aks-engine API model doesn't allow users to override the Linux image version