Skip to content

feat(core): standardized sealos cloud core component deployment#6722

Merged
cuisongliu merged 2 commits intolabring:mainfrom
bxy4543:charts/bump-values
Apr 2, 2026
Merged

feat(core): standardized sealos cloud core component deployment#6722
cuisongliu merged 2 commits intolabring:mainfrom
bxy4543:charts/bump-values

Conversation

@bxy4543
Copy link
Copy Markdown
Member

@bxy4543 bxy4543 commented Feb 27, 2026

Helm Chart Deployment Structure Standardization & Values Splitting Proposal

1. Standardized Directory Structure

deploy/
├── charts/
│   └── {service-name}/
│       ├── Chart.yaml
│       ├── values.yaml                        # Default / base values (should NOT be modified)
│       │                                        # Contains infra defaults + reference values for auto-injected fields
│       ├── {service-name}-values.yaml         # User customization template
│       └── templates/
│           ├── deployment.yaml
│           ├── service.yaml
│           └── ...
├── Kubefile
├── {service}-entrypoint.sh
└── README.md

2. Helm Values Splitting Rules

2.1 Splitting Principles

values.yaml (Default / Protected Values – should not be edited by users)

Contains fields that are:

  • Image related: image, imagePullPolicy
  • Core overrides: imagePullSecrets, nameOverride, fullnameOverride
  • ServiceAccount: create, automountServiceAccountToken, annotations, name
  • Pod metadata & security: podAnnotations, podLabels, podSecurityContext, securityContext
  • Service & ingress base config
  • Probes: livenessProbe, readinessProbe
  • Scheduling: nodeSelector, tolerations, affinity
  • Storage: volumes, volumeMounts
  • Infra toggles: metrics.enabled (default: false)
  • Auto-injected reference values (for documentation only):
    • Fields that will be overridden by entrypoint.sh (e.g. domain, secrets, JWT, etc.)
    • Must be clearly commented as “auto-configured / will be overridden”

{service-name}-values.yaml (User Customization Template)

Contains fields users most commonly want to customize:

  • Replica count: replicaCount
  • Resource requests & limits: resources
  • Environment variables:
    • env
    • *Env blocks (e.g. accountEnv, desktopConfig, appConfig, etc.)
  • Business / application configuration:
    • Feature flags
    • URLs / endpoints
    • Authentication settings
    • Database / Redis / MQ connection strings
    • Other service-specific parameters

Important Rules:

  • Add clear comment block at the top explaining which fields are auto-injected and will be overridden
  • Remove all auto-configured fields from this file to prevent confusion / conflicts
  • Auto-configured values are injected via --set / --set-string in entrypoint.sh
  • Prefer --set-string for string values
  • This file is used as a template → copied to /root/.sealos/cloud/values/core/{service-name}-values.yaml on first deployment

2.2 Value Loading Priority (lowest → highest)

  1. values.yaml
    → Base defaults + documentation of auto-injected values

  2. /root/.sealos/cloud/values/core/{service-name}-values.yaml
    → User-provided customizations

  3. HELM_OPTIONS / command-line --set flags
    → Highest priority (overrides everything above)

3. Deployment Script (*-entrypoint.sh) Changes

3.1 User Values File Preparation (new logic)

SERVICE_NAME="{service-name}"
USER_VALUES_PATH="/root/.sealos/cloud/values/core/${SERVICE_NAME}-values.yaml"

# Copy template to user location if it doesn't exist yet
if [ ! -f "${USER_VALUES_PATH}" ]; then
  mkdir -p "$(dirname "${USER_VALUES_PATH}")"
  cp "./charts/${SERVICE_NAME}/${SERVICE_NAME}-values.yaml" "${USER_VALUES_PATH}"
fi

3.2 Auto-configuration Logic (add when needed)

AUTO_CONFIG_HELM_OPTS=""

# Example: fetch values from sealos-system ConfigMap
CLOUD_DOMAIN=$(get_cm_value sealos-system sealos-config cloudDomain)
[ -n "$CLOUD_DOMAIN" ] && AUTO_CONFIG_HELM_OPTS="$AUTO_CONFIG_HELM_OPTS --set-string desktopConfig.cloudDomain=$CLOUD_DOMAIN"

JWT_INTERNAL=$(get_cm_value sealos-system sealos-config jwtInternal)
[ -n "$JWT_INTERNAL" ] && AUTO_CONFIG_HELM_OPTS="$AUTO_CONFIG_HELM_OPTS --set-string desktopConfig.jwtInternal=$JWT_INTERNAL"

# ... add more auto-config items as needed ...

Auto-config Best Practices:

  • Always prefer --set-string for string values
  • Add null/empty checks to avoid injecting empty values
  • Clearly document (in values.yaml and README) which fields are auto-injected
  • Auto-config values override same keys in user values file

3.3 Updated helm upgrade Command

helm upgrade -i "{RELEASE_NAME}" \
  -n "{RELEASE_NAMESPACE}" \
  --create-namespace \
  "{CHART_PATH}" \
  -f "./charts/${SERVICE_NAME}/values.yaml" \
  -f "${USER_VALUES_PATH}" \
  ${AUTO_CONFIG_HELM_OPTS} \
  ${HELM_ARGS}

4. Summary – Core Components Optimized by This PR

This PR standardizes the Helm chart structure, values splitting strategy, auto-configuration injection, and deployment script behavior across multiple core Sealos components.
Affected core components:

core/
├── frontend/
│   ├── desktop-frontend
│   ├── costcenter-frontend
│   └── license-frontend
├── controller/
│   ├── user-controller
│   ├── account-controller
│   ├── license-controller
│   └── resources-controller
├── service/
│   └── account-service
└── job / misc
    ├── init-job
    └── init-heartbeat

@bxy4543 bxy4543 requested review from a team as code owners February 27, 2026 01:52
@pull-request-size
Copy link
Copy Markdown

Whoa! Easy there, Partner!

This PR is too big. Please break it up into smaller PRs.

@cuisongliu cuisongliu marked this pull request as draft February 27, 2026 09:00
@bxy4543 bxy4543 force-pushed the charts/bump-values branch from f0eb54c to 78ce130 Compare April 2, 2026 02:52
@bxy4543 bxy4543 marked this pull request as ready for review April 2, 2026 02:52
@bxy4543 bxy4543 requested a review from a team as a code owner April 2, 2026 02:52
bxy4543 added 2 commits April 2, 2026 11:15
core/
├── frontend/
│   ├── desktop-frontend
│   ├── costcenter-frontend
│   └── license-frontend
├── controller/
│   ├── user-controller
│   ├── account-controller
│   ├── license-controller
│   └── resources-controller
├── service/
│   └── account-service
└── job / misc
    ├── init-job
    └── init-heartbeat
@bxy4543 bxy4543 force-pushed the charts/bump-values branch from 78ce130 to 887055d Compare April 2, 2026 03:38
@cuisongliu cuisongliu added this to the v5.2 milestone Apr 2, 2026
@cuisongliu cuisongliu merged commit 5f3719f into labring:main Apr 2, 2026
27 of 35 checks passed
@bxy4543 bxy4543 deleted the charts/bump-values branch April 2, 2026 03:41
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2026

🤖 says: cherry pick action finished successfully 🎉!
See: https://github.com/labring/sealos/actions/runs/23882644586

github-actions Bot pushed a commit that referenced this pull request Apr 2, 2026
* support core helm refactor:
core/
├── frontend/
│   ├── desktop-frontend
│   ├── costcenter-frontend
│   └── license-frontend
├── controller/
│   ├── user-controller
│   ├── account-controller
│   ├── license-controller
│   └── resources-controller
├── service/
│   └── account-service
└── job / misc
    ├── init-job
    └── init-heartbeat

* rebase
cuisongliu pushed a commit that referenced this pull request Apr 2, 2026
feat(core): standardized sealos cloud core component deployment (#6722)

* support core helm refactor:
core/
├── frontend/
│   ├── desktop-frontend
│   ├── costcenter-frontend
│   └── license-frontend
├── controller/
│   ├── user-controller
│   ├── account-controller
│   ├── license-controller
│   └── resources-controller
├── service/
│   └── account-service
└── job / misc
    ├── init-job
    └── init-heartbeat

* rebase

Co-authored-by: Jiahui <4543bxy@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants