You need to enable JavaScript to run this app.
Code Pipeline

Code Pipeline

Copy page
Download PDF
Component templates
Preset Component templates
Copy page
Download PDF
Preset Component templates
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.​
​
apiVersion: apps/v1​
kind: Deployment​
metadata:​
name: {{ .AppDeliver.componentName }}​
labels:​
run: {{ .AppDeliver.componentName }}​
namespace: {{ .Values.namespace }}​
spec:​
{{- if .Values.replicas }}​
replicas: {{ .Values.replicas }}​
{{- end }}​
selector:​
matchLabels:​
run: {{ .AppDeliver.componentName }}​
template:​
metadata:​
labels:​
run: {{ .AppDeliver.componentName }}​
spec:​
containers:​
- name: {{ .AppDeliver.componentName }}​
image: {{ .AppDeliver.image.backend }}​
# Port Configuration​
ports:​
- containerPort: {{ .Values.port }}​
​
​
​
apiVersion: v1​
kind: Service​
metadata:​
name: {{ .AppDeliver.componentName }}​
namespace: {{ .Values.namespace }}​
spec:​
selector:​
run: {{ .AppDeliver.componentName }}​
ports:​
- protocol: TCP​
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.​
​
apiVersion: v1​
kind: Service​
metadata:​
name: {{ .AppDeliver.componentName }}-{{ .AppDeliver.envName }}​
namespace: {{ .Values.namespace }}​
labels:​
run: {{ .AppDeliver.componentName }}​
app: "{{ .AppDeliver.componentName }}"​
spec:​
selector:​
run: {{ .AppDeliver.componentName }}-{{ .AppDeliver.envName }}​
ports:​
- protocol: TCP​
port: {{ .Values.port }}​
targetPort: {{ .Values.port }}​
​
​
apiVersion: apps/v1​
kind: Deployment​
metadata:​
name: {{ .AppDeliver.componentName }}-{{ .AppDeliver.envName }}​
labels:​
run: {{ .AppDeliver.componentName }}​
app: "{{ .AppDeliver.componentName }}"​
namespace: {{ .Values.namespace }}​
spec:​
{{- if .Values.replicas }}​
replicas: {{ .Values.replicas }}​
{{- end }}​
selector:​
matchLabels:​
run: {{ .AppDeliver.componentName }}-{{ .AppDeliver.envName }}​
template:​
metadata:​
annotations:​
sidecar.mesh.io/prestop-timeout: "{{ .Values.prestopTimeout }}"​
labels:​
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"​
spec:​
containers:​
- name: {{ .AppDeliver.componentName }}​
image: {{ .AppDeliver.image.backend }}​
# Port Configuration​
command:​
- /bin/sh​
args:​
- '-c'​
- {{ .Values.startCommand }}​
ports:​
- 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.​
​
apiVersion: apps/v1​
kind: Deployment​
metadata:​
name: {{ .AppDeliver.componentName }}-{{ .AppDeliver.envName }}​
labels:​
run: {{ .AppDeliver.componentName }}​
app: "{{ .AppDeliver.componentName }}"​
namespace: {{ .Values.namespace }}​
spec:​
{{- if .Values.replicas }}​
replicas: {{ .Values.replicas }}​
{{- end }}​
selector:​
matchLabels:​
run: {{ .AppDeliver.componentName }}-{{ .AppDeliver.envName }}​
template:​
metadata:​
annotations:​
sidecar.mesh.io/prestop-timeout: "{{ .Values.prestopTimeout }}"​
labels:​
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"​
spec:​
containers:​
- name: {{ .AppDeliver.componentName }}​
image: {{ .AppDeliver.image.backend }}​
# Port Configuration​
command:​
- /bin/sh​
args:​
- '-c'​
- {{ .Values.startCommand }}​
ports:​
- containerPort: {{ .Values.port }}​
​
​
apiVersion: v1​
kind: Service​
metadata:​
name: {{ .AppDeliver.componentName }}-{{ .AppDeliver.envName }}​
namespace: {{ .Values.namespace }}​
labels:​
run: {{ .AppDeliver.componentName }}​
app: "{{ .AppDeliver.componentName }}"​
spec:​
selector:​
run: {{ .AppDeliver.componentName }}-{{ .AppDeliver.envName }}​
ports:​
- protocol: TCP​
port: {{ .Values.port }}​
targetPort: {{ .Values.port }}​
​
​
# Supports custom Kubernetes resources​
apiVersion: networking.k8s.io/v1​
kind: Ingress​
metadata:​
name: {{ .AppDeliver.componentName }}-{{ .AppDeliver.envName }}​
labels:​
run: {{ .AppDeliver.componentName }}​
app: "{{ .AppDeliver.componentName }}"​
annotations:​
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 }}"​
spec:​
rules:​
- host: "{{ .Values.host }}"​
http:​
paths:​
- path: "{{ .Values.ingressPath }}"​
pathType: "{{ .Values.ingressPathType }}"​
backend:​
service:​
name: {{ .AppDeliver.componentName }}-{{ .AppDeliver.envName }}​
port:​
number: {{ .Values.port }}​
​
​
​
Last updated: 2025.09.10 17:37:27