This topic describes how to create a Windows application by using an orchestration template. Such a template is used to customize the resources required by a Windows application to operate.
In this topic, an application named
aspnet is created by using an orchestration template. This application contains a deployment and a service. On the backend, the deployment creates pods according to settings. Then, the service is associated with the pods.
- Log on to the Container Service console.
- In the left-side navigation pane under Container Service-Kubernetes, choose .
- In the upper-right corner, click Create by Template.
- To set the orchestration template, set the following:
- Clusters: Select the target cluster. The resources required by the application are deployed in a cluster.
- Namespace: Select the target namespace. The default namespace is preset. Except for nodes, persistent volumes, and other underlying resource types, most resources required by the application are deployed in a namespace.
- Sample Template: Select the target sample template. Alibaba Cloud Container Service for Kubernetes provides many built-in YAML orchestration templates for different types of resources. You can customize an orchestration template to set a type of resource according to the YAML orchestration requirements.
- Add Deployment: Edit a YAML template quickly by using this function.
- Using Existing Template: Import an existing template to the template setting area.
Then, click DEPLOY.The following is an orchestration template for the Windows application named
aspnet. With such an orchestration template, you can quickly create a deployment and a service for the application.Note If you want to create multiple resources in a template, you can use
---to separate different resources.
apiVersion: v1 kind: Service metadata: name: aspnet-svc spec: ports: - port: 80 protocol: TCP targetPort: 80 selector: app: aspnet type: LoadBalancer --- apiVersion: apps/v1beta2 kind: Deployment metadata: name: aspnet spec: selector: matchLabels: app: aspnet template: metadata: labels: app: aspnet spec: containers: - image: 'microsoft/dotnet-samples:aspnetapp' name: aspnet
- A message is displayed on the bottom of the Template area to show the result. If a success message is displayed (shown in the preceding figure), click Kubernetes Dashboard at the end of the message to view the progress.
- In the left-side navigation pane, choose External endpoints column, click the IP address of the created service named
aspnet-svcto visit the home page of the
aspnetapplication in your browser. . Then, in theNote In the Kubernetes dashboard, you can view that a service named
aspnet-svcand its external endpoint are created.
The following figure shows the home page of the
What to do next