You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: skills/docker-to-sealos/SKILL.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,11 +117,11 @@ If validation fails, fix template/rules/examples first.
117
117
- Never use `spec.template` in App resource.
118
118
-`cloud.sealos.io/app-deploy-manager` label value must equal resource `metadata.name`.
119
119
-`metadata.labels.app` label value must equal resource `metadata.name` for managed app workloads.
120
-
-`containers[*].name` must equal workload `metadata.name` for managed app workloads.
120
+
-The primary business container name must equal workload `metadata.name` for managed app workloads; sidecar/helper containers may use distinct descriptive names.
121
121
- Application `Service` resources must define `metadata.labels.app` and `metadata.labels.cloud.sealos.io/app-deploy-manager`, and both labels must match `spec.selector.app`.
122
-
-Component-scoped `ConfigMap` resources must define `metadata.labels.app` and `metadata.labels.cloud.sealos.io/app-deploy-manager`, and both labels must match `metadata.name`.
122
+
-Runtime component-scoped `ConfigMap` resources must define `metadata.labels.app` and `metadata.labels.cloud.sealos.io/app-deploy-manager`, and both labels must match `metadata.name`; bootstrap-only ConfigMaps used only by init containers to copy initial config into persistent storage must not define either label.
123
123
- Application `Service` resources must use the same component name across `metadata.name`, `metadata.labels.app`, `metadata.labels.cloud.sealos.io/app-deploy-manager`, and `spec.selector.app`.
124
-
-Application`Ingress` resources must use the same component name across `metadata.name`, `metadata.labels.cloud.sealos.io/app-deploy-manager`, and backend `service.name`.
124
+
-Root-path`Ingress` resources (`pathType: Prefix`, `path: /`) must use the same component name across `metadata.name`, `metadata.labels.cloud.sealos.io/app-deploy-manager`, and backend `service.name`; non-root or non-Prefix Ingress rules may route to a different backend service.
125
125
- Service `spec.ports[*].name` must be explicitly set (required for multi-port services).
126
126
- HTTP Ingress must include required nginx annotations (`kubernetes.io/ingress.class`, `nginx.ingress.kubernetes.io/proxy-body-size`, `nginx.ingress.kubernetes.io/server-snippet`, `nginx.ingress.kubernetes.io/ssl-redirect`, `nginx.ingress.kubernetes.io/backend-protocol`, `nginx.ingress.kubernetes.io/client-body-buffer-size`, `nginx.ingress.kubernetes.io/proxy-buffer-size`, `nginx.ingress.kubernetes.io/proxy-send-timeout`, `nginx.ingress.kubernetes.io/proxy-read-timeout`, `nginx.ingress.kubernetes.io/configuration-snippet`) with expected defaults.
127
127
- CronJob resources must define labels `cloud.sealos.io/cronjob`, `cronjob-launchpad-name`, and `cronjob-type`; `cloud.sealos.io/cronjob` must equal `metadata.name`, `cronjob-launchpad-name` must be `""`, and `cronjob-type` must be `image`.
@@ -188,7 +188,7 @@ Unless source docs explicitly require otherwise, use the lightweight app ladder
188
188
- container limits: `cpu=200m`, `memory=256Mi`
189
189
- container requests: `cpu=20m`, `memory=25Mi`
190
190
-`revisionHistoryLimit: 1`
191
-
-`automountServiceAccountToken: false`
191
+
-`automountServiceAccountToken: false` by default; set it to `true` only when the application has explicit Kubernetes API/service account token requirements, evidenced by Kubernetes integration settings, `serviceAccountName`, or a `sealos.io/service-account-token-reason` workload annotation.
192
192
193
193
For higher resource needs, move only to another allowed `limits` ladder entry and recompute `requests` from that `limits` value.
Copy file name to clipboardExpand all lines: skills/docker-to-sealos/references/must-rules-map.yaml
+40-4Lines changed: 40 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -68,23 +68,23 @@ must_rules:
68
68
enforcement:
69
69
type: rule
70
70
target: R034
71
-
- must: "`containers[*].name` must equal workload `metadata.name` for managed app workloads."
71
+
- must: "The primary business container name must equal workload `metadata.name` for managed app workloads; sidecar/helper containers may use distinct descriptive names."
72
72
enforcement:
73
73
type: rule
74
74
target: R028
75
75
- must: "Application `Service` resources must define `metadata.labels.app` and `metadata.labels.cloud.sealos.io/app-deploy-manager`, and both labels must match `spec.selector.app`."
76
76
enforcement:
77
77
type: rule
78
78
target: R029
79
-
- must: "Component-scoped `ConfigMap` resources must define `metadata.labels.app` and `metadata.labels.cloud.sealos.io/app-deploy-manager`, and both labels must match `metadata.name`."
79
+
- must: "Runtime component-scoped `ConfigMap` resources must define `metadata.labels.app` and `metadata.labels.cloud.sealos.io/app-deploy-manager`, and both labels must match `metadata.name`; bootstrap-only ConfigMaps used only by init containers to copy initial config into persistent storage must not define either label."
80
80
enforcement:
81
81
type: rule
82
82
target: R030
83
83
- must: "Application `Service` resources must use the same component name across `metadata.name`, `metadata.labels.app`, `metadata.labels.cloud.sealos.io/app-deploy-manager`, and `spec.selector.app`."
84
84
enforcement:
85
85
type: rule
86
86
target: R029
87
-
- must: "Application `Ingress` resources must use the same component name across `metadata.name`, `metadata.labels.cloud.sealos.io/app-deploy-manager`, and backend `service.name`."
87
+
- must: "Root-path `Ingress` resources (`pathType: Prefix`, `path: /`) must use the same component name across `metadata.name`, `metadata.labels.cloud.sealos.io/app-deploy-manager`, and backend `service.name`; non-root or non-Prefix Ingress rules may route to a different backend service."
88
88
enforcement:
89
89
type: rule
90
90
target: R031
@@ -240,6 +240,42 @@ must_rules:
240
240
enforcement:
241
241
type: rule
242
242
target: R038
243
+
- must: "Do not treat a short smoke test as proof of a stable minimum memory value."
244
+
enforcement:
245
+
type: manual
246
+
note: "Review browser/remote desktop templates and smoke evidence before lowering memory."
247
+
- must: "Validate memory with a fresh deployment, not only a patched warm pod."
- must: "Exercise cold start until readiness, a lightweight page, a real/medium page, an interactive/search page, and a 60s post-smoke stability check."
252
+
enforcement:
253
+
type: manual
254
+
note: "Requires runtime smoke coverage evidence."
255
+
- must: "If observed cgroup memory reaches more than 80% of the limit during smoke, move to the next allowed Sealos memory ladder value."
256
+
enforcement:
257
+
type: manual
258
+
note: "Requires runtime memory observation."
259
+
- must: "Keep requests derived from limits according to the Sealos resource ladder."
260
+
enforcement:
261
+
type: rule
262
+
target: R038
263
+
- must: "Bad: Chrome passes a short smoke at `512Mi` but reaches `503Mi`; shipping `512Mi` as the stable minimum is unsafe."
264
+
enforcement:
265
+
type: manual
266
+
note: "Negative example for reviewer guidance."
267
+
- must: "Good: raise to `1024Mi`, set request to `102Mi`, rerun smoke and stability checks."
268
+
enforcement:
269
+
type: manual
270
+
note: "Positive example for reviewer guidance."
271
+
- must: "limits: `cpu=200m`, `memory=1024Mi`"
272
+
enforcement:
273
+
type: manual
274
+
note: "Browser/remote desktop minimum; applied when source workload matches that class."
275
+
- must: "requests: `cpu=20m`, `memory=102Mi`"
276
+
enforcement:
277
+
type: manual
278
+
note: "Browser/remote desktop minimum request; applied when source workload matches that class."
243
279
- must: "MongoDB: `${{ defaults.app_name }}-mongo-mongodb-account-root` (or `${{ defaults.app_name }}-mongodb-mongodb-account-root` when the MongoDB cluster name uses `-mongodb`)"
244
280
enforcement:
245
281
type: rule
@@ -268,7 +304,7 @@ must_rules:
268
304
enforcement:
269
305
type: rule
270
306
target: R009
271
-
- must: "`automountServiceAccountToken: false`"
307
+
- must: "`automountServiceAccountToken: false` by default; set it to `true` only when the application has explicit Kubernetes API/service account token requirements, evidenced by Kubernetes integration settings, `serviceAccountName`, or a `sealos.io/service-account-token-reason` workload annotation."
Copy file name to clipboardExpand all lines: skills/docker-to-sealos/references/rules-registry.yaml
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -98,22 +98,22 @@ rules:
98
98
description: Managed app workloads must define metadata.labels.app and match metadata.name.
99
99
severity: error
100
100
- id: R028
101
-
description: Managed app workload container names must exactly match metadata.name.
101
+
description: Managed app workloads must include a primary business container whose name exactly matches metadata.name.
102
102
severity: error
103
103
- id: R029
104
104
description: Application Services must use one component name across metadata.name, labels.app, cloud.sealos.io/app-deploy-manager, and spec.selector.app.
105
105
severity: error
106
106
- id: R030
107
-
description: Component ConfigMaps must use one component name across metadata.name, labels.app, and cloud.sealos.io/app-deploy-manager.
107
+
description: Runtime component ConfigMaps must use one component name across metadata.name, labels.app, and cloud.sealos.io/app-deploy-manager; bootstrap-only init-copy ConfigMaps must not define either managed label.
108
108
severity: error
109
109
- id: R031
110
-
description: Application Ingress resources must use one component name across metadata.name, cloud.sealos.io/app-deploy-manager, and backend service names.
110
+
description: Root-path Prefix Ingress resources must use one component name across metadata.name, cloud.sealos.io/app-deploy-manager, and backend service names; non-root or non-Prefix routes may differ.
111
111
severity: error
112
112
- id: R009
113
113
description: Managed app workloads must explicitly set revisionHistoryLimit to 1.
114
114
severity: error
115
115
- id: R010
116
-
description: Managed app workloads must explicitly set automountServiceAccountToken to false.
116
+
description: Managed app workloads must explicitly set automountServiceAccountToken to false unless Kubernetes API/service account token usage is evidenced by integration settings, serviceAccountName, or a service-account-token reason annotation.
117
117
severity: error
118
118
- id: R035
119
119
description: Managed app workloads must reference the app-scoped image pull secret name via template.spec.imagePullSecrets.
Copy file name to clipboardExpand all lines: skills/docker-to-sealos/references/sealos-specs.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -493,12 +493,14 @@ spec:
493
493
- `${{ defaults.app_name }}-ml`
494
494
- `${{ defaults.app_name }}-redis`
495
495
5. Application Service must include `metadata.labels.app` and `metadata.labels.cloud.sealos.io/app-deploy-manager`, and `metadata.name`, both labels, and `spec.selector.app` must be exactly the same
496
-
6. Component-level ConfigMap must include `metadata.labels.app` and `metadata.labels.cloud.sealos.io/app-deploy-manager`, and both must be consistent with `metadata.name`
497
-
7. Application Ingress's `metadata.name` must be consistent with `metadata.labels.cloud.sealos.io/app-deploy-manager` and the backend `service.name`
496
+
6. Runtime component-level ConfigMap must include `metadata.labels.app` and `metadata.labels.cloud.sealos.io/app-deploy-manager`, and both must be consistent with `metadata.name`; ConfigMaps used only by init containers to copy initial config into persistent storage must not include either label
497
+
7. Root-path Ingress rules (`pathType: Prefix`, `path: /`) must keep `metadata.name` consistent with `metadata.labels.cloud.sealos.io/app-deploy-manager` and backend `service.name`; non-root or non-Prefix Ingress rules may use a distinct Ingress name and backend service
498
498
499
499
### Container Naming Rules
500
500
501
-
The `containers.name` must be consistent with the `metadata.name` value.
501
+
The primary business container name must be consistent with the workload
502
+
`metadata.name`value. Sidecar/helper containers may use distinct descriptive
503
+
names when they are not the main business container.
502
504
503
505
```yaml
504
506
# Correct example
@@ -509,6 +511,7 @@ spec:
509
511
spec:
510
512
containers:
511
513
- name: ${{ defaults.app_name }} # Must be consistent with metadata.name
@@ -827,7 +830,7 @@ This is because Kubernetes parses environment variables in the order they appear
827
830
828
831
All application Deployments or StatefulSets must include the following configurations:
829
832
830
-
1. **automountServiceAccountToken**: Must be set to `false` to avoid unnecessary permission exposure
833
+
1. **automountServiceAccountToken**: Must be set to `false` to avoid unnecessary permission exposure. Set it to `true` only when the application explicitly needs the Kubernetes API/service account token, evidenced by Kubernetes integration settings, `serviceAccountName`, or `sealos.io/service-account-token-reason` in workload annotations.
831
834
2. **revisionHistoryLimit**: Must be set to `1` to reduce resources consumed by historical revisions
832
835
3. **imagePullSecrets**: Must reference the app-scoped image pull Secret `${{ defaults.app_name }}`
833
836
4. **metadata.annotations**: Must include the following annotations:
@@ -857,7 +860,7 @@ spec:
857
860
revisionHistoryLimit: 1 # Must be set to 1
858
861
template:
859
862
spec:
860
-
automountServiceAccountToken: false # Must be set to false
863
+
automountServiceAccountToken: false # Default; only set true with evidenced Kubernetes API token need
0 commit comments