Application delivery provides the component templates feature, which helps quickly generate components in OAM applications. This document introduces the system-defined component templates.
tip
Currently, only the OAM application supports this feature.
Blank template
A blank template pre-installed by the system. Applicable to scenarios where there is a clear requirement and you wish to write the component content yourself.
Preset deployment service templates
System-provided Deployment and Service resource templates. Suitable for tasks that need to be reused multiple times.
name: {{ .AppDeliver.componentName }}
run: {{ .AppDeliver.componentName }}
namespace: {{ .Values.namespace }}
{{- if .Values.replicas }}
replicas: {{ .Values.replicas }}
run: {{ .AppDeliver.componentName }}
run: {{ .AppDeliver.componentName }}
- name: {{ .AppDeliver.componentName }}
image: {{ .AppDeliver.image.backend }}
- containerPort: {{ .Values.port }}
name: {{ .AppDeliver.componentName }}
namespace: {{ .Values.namespace }}
run: {{ .AppDeliver.componentName }}
port: {{ .Values.port }}
targetPort: {{ .Values.port }}
Preset MSE canary service template
The system provides a preconfigured Deployment + Service template that associates the Microservice Engine (MSE) lane configuration and is suitable for gray release of applications with east-west traffic within a cluster environment. You need to create a Governance Center instance in MSE in advance and configure lanes.
name: {{ .AppDeliver.componentName }}-{{ .AppDeliver.envName }}
namespace: {{ .Values.namespace }}
run: {{ .AppDeliver.componentName }}
app: "{{ .AppDeliver.componentName }}"
run: {{ .AppDeliver.componentName }}-{{ .AppDeliver.envName }}
port: {{ .Values.port }}
targetPort: {{ .Values.port }}
name: {{ .AppDeliver.componentName }}-{{ .AppDeliver.envName }}
run: {{ .AppDeliver.componentName }}
app: "{{ .AppDeliver.componentName }}"
namespace: {{ .Values.namespace }}
{{- if .Values.replicas }}
replicas: {{ .Values.replicas }}
run: {{ .AppDeliver.componentName }}-{{ .AppDeliver.envName }}
sidecar.mesh.io/prestop-timeout: "{{ .Values.prestopTimeout }}"
run: {{ .AppDeliver.componentName }}-{{ .AppDeliver.envName }}
app: "{{ .AppDeliver.componentName }}"
sidecar.mesh.io/mse-namespace: "{{ .Values.mseNamespace }}"
sidecar.mesh.io/lane: "{{ .Values.lane }}"
sidecar.mesh.io/data-plane-mode: "{{ .Values.dataPlanMode }}"
sidecar.istio.io/inject: "false"
- name: {{ .AppDeliver.componentName }}
image: {{ .AppDeliver.image.backend }}
- {{ .Values.startCommand }}
- containerPort: {{ .Values.port }}
Pre-configure MSE canary services and Ingress gateway routing templates
System-provided templates for Deployment, Service, and ingress routing (based on request headers), suitable for gray release of applications at the first hop in north-south traffic. The template is associated with Microservice Engine (MSE) lane configuration, integrates the features of ingress service and routing, enables routing control through request headers, and is associated via the Kubernetes Ingress generic controller gateway. It can be used together with applications of the preset MSE canary service template. You need to create an MSE Governance Center instance and an ingress controller (such as APIG, nginx-ingress, and many others) in advance.
name: {{ .AppDeliver.componentName }}-{{ .AppDeliver.envName }}
run: {{ .AppDeliver.componentName }}
app: "{{ .AppDeliver.componentName }}"
namespace: {{ .Values.namespace }}
{{- if .Values.replicas }}
replicas: {{ .Values.replicas }}
run: {{ .AppDeliver.componentName }}-{{ .AppDeliver.envName }}
sidecar.mesh.io/prestop-timeout: "{{ .Values.prestopTimeout }}"
run: {{ .AppDeliver.componentName }}-{{ .AppDeliver.envName }}
app: "{{ .AppDeliver.componentName }}"
sidecar.mesh.io/mse-namespace: "{{ .Values.mseNamespace }}"
sidecar.mesh.io/lane: "{{ .Values.lane }}"
sidecar.mesh.io/data-plane-mode: "{{ .Values.dataPlanMode }}"
sidecar.istio.io/inject: "false"
- name: {{ .AppDeliver.componentName }}
image: {{ .AppDeliver.image.backend }}
- {{ .Values.startCommand }}
- containerPort: {{ .Values.port }}
name: {{ .AppDeliver.componentName }}-{{ .AppDeliver.envName }}
namespace: {{ .Values.namespace }}
run: {{ .AppDeliver.componentName }}
app: "{{ .AppDeliver.componentName }}"
run: {{ .AppDeliver.componentName }}-{{ .AppDeliver.envName }}
port: {{ .Values.port }}
targetPort: {{ .Values.port }}
# Supports custom Kubernetes resources
apiVersion: networking.k8s.io/v1
name: {{ .AppDeliver.componentName }}-{{ .AppDeliver.envName }}
run: {{ .AppDeliver.componentName }}
app: "{{ .AppDeliver.componentName }}"
nginx.ingress.kubernetes.io/canary: "{{ .Values.isCanary }}"
nginx.ingress.kubernetes.io/canary-by-header: "{{ .Values.headerKey }}"
nginx.ingress.kubernetes.io/canary-by-header-value: "{{ .Values.headerValue }}"
- host: "{{ .Values.host }}"
- path: "{{ .Values.ingressPath }}"
pathType: "{{ .Values.ingressPathType }}"
name: {{ .AppDeliver.componentName }}-{{ .AppDeliver.envName }}
number: {{ .Values.port }}