This topic describes how to use an orchestration template to create a Web application on a Windows node. A Deployment is created to provision pods for the application.
In an orchestration template, you must define the resource objects that are required for running an application and configure mechanisms such as label selectors to manage the resource objects that make up the application.
You can deploy only workloads that support the HostNetwork mode on Windows nodes.
- Log on to the ACK console.
- In the left-side navigation pane of the ACK console, click Clusters.
- On the Clusters page, find the cluster that you want to manage and click the name of the cluster or click Details in the Actions column. The details page of the cluster appears.
- In the left-side navigation pane of the details page, choose .
- On the Deployments page, click Create from YAML in the upper-right corner.
- Set the parameters and click Create.
- Namespace: Select the namespace to which the resource objects belong. By default, the default namespace is selected. Most resources are scoped to namespaces, except for underlying computing resources, such as nodes and persistent volumes (PVs).
- Sample Template: ACK provides YAML templates of various resource types. This simplifies the deployment of resource objects. You can also create a custom template based on YAML syntax to define the resources that you want to create.
- Add Deployment: This feature allows you to define a YAML template.
- Use Existing Template: You can import an existing template to the configuration page.
- Save As: You can save the template that you have configured.
The following template shows how to deploy a Web application on a Windows node. You can use this template to quickly create a Web application.
apiVersion: apps/v1 kind: Deployment metadata: labels: app: web-windows name: web-windows spec: selector: matchLabels: app: web-windows template: metadata: labels: app: web-windows spec: restartPolicy: Always hostNetwork: true terminationGracePeriodSeconds: 30 tolerations: - key: os value: windows affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: kubernetes.io/os operator: In values: - windows containers: - image: registry.cn-hangzhou.aliyuncs.com/acs/sample-web-windows:v1.0.1 name: windows ports: - containerPort: 80 protocol: TCP
- Click Create. A message that indicates the deployment status appears. After the Deployment is created, you can find the Deployment on the Deployments page.
- Log on to the Windows node, launch Windows PowerShell, and run the following command
to access the Web application. For more information about how to launch Windows PowerShell, see Installing Windows PowerShell.