Additional Windows Node pool
Feature available 2.11+
Introduction
By default, the K8SAAS cluster is created with a node pool that can only run Linux containers, but if you need to run a Windows workload, you may request to add a Windows node pool to your cluster.
The windows version is Windows Server 2019.
Starting with AKS 1.25 the default windows version will be Windows Server 2022.
Requirements
You needs to submit a tickets via postit:
"Something is missing": https://postit.service-now.com/esc?id=sc_cat_item&sys_id=51bbb15adb070910f565cbc405961903
- Ask to get a windows node pool
- Specify your cluster name
limitations
- By default, the kubernetes scheduller assigns Pods to one of the available Nodes so in our case it can schedule pod on windows or linux node. To ensure that only Windows workload is scheduled on the Windows node, you need to add node affinity and toleration.
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: In
values:
- windows
tolerations:
- key: "os"
operator: "Equal"
value: "windows"
effect: "NoSchedule"
- All our services are designed to run on linux so for the moement some services are not available on the windows node, such as :
- Logging : dev in progress
- Monitoring : dev in progress
- linkerd : Cannot run linux image on windows node. You need to add an annotation as below in your deployments (cf: Deploy a test application):
spec:
template:
metadata:
annotations:
linkerd.io/inject: disabled
More information in official documentation:link
Deploy a test application
Once the node is added to your cluster, you're able to deploy windows workload.
Fisrt, clone the k8saas hello-world repository:
git clone https://gitlab.thalesdigital.io/platform-team-canada/k8saas-innersource/hello-world-k8saas.git
cd hello-world-k8saas/Basic-helloworld-windows
Get your credentials:
az aks get-credentials --name "$K8SAAS_RESOURCE_NAME" --resource-group "$K8SAAS_RESOURCE_NAME" \
The cluster name and the resource group name are the same within k8saas.
Deploy the application
Deploy the application using the following commands:
# this start a hello world pod
kubectl apply -f aks-helloworld-windows.yaml --namespace customer-namespaces
# look at your pods
kubectl get pods -n customer-namespaces
# NAME READY STATUS RESTARTS AGE
# aks-helloworld-windows-56c7b8d79d-sm4c6 1/1 Running 0 10m
Expose the application
The second file deploys a kubernetes Ingress object that binds the application to a DNS domain: hw-win-ingress.test.kaas.thalesdigital.io.
Use the command:
kubectl apply -f hello-world-ingress-windows.yaml --namespace customer-namespaces
Now, open a browser and consult your first application: https://hw-win-ingress.test.kaas.thalesdigital.io or in a shell:
curl -k https://hw-win-ingress.test.kaas.thalesdigital.io
Notes: It can take up to 5minutes before that url be reachable.
Remove your test
kubectl delete -f hello-world-windows.yaml --namespace customer-namespaces
kubectl delete -f hello-world-ingress-windows.yaml --namespace customer-namespaces