Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions controllers/account/deploy/account-controller-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -ex
set -e

HELM_OPTS=${HELM_OPTS:-""}
RELEASE_NAME=${RELEASE_NAME:-"account-controller"}
Expand Down Expand Up @@ -156,14 +156,15 @@ USER_VALUES_PATH="/root/.sealos/cloud/values/core/${SERVICE_NAME}-values.yaml"
# Copy user values template if not exists
if [ ! -f "${USER_VALUES_PATH}" ]; then
mkdir -p "$(dirname "${USER_VALUES_PATH}")"
cp "./charts/${SERVICE_NAME}/values.yaml" "${USER_VALUES_PATH}"
cp "./charts/${SERVICE_NAME}/${SERVICE_NAME}-values.yaml" "${USER_VALUES_PATH}"
fi

# merge all helm_opts
# 1. AUTO_CONFIG_HELM_OPTS (Configuration automatically obtained from ConfigMap)
# 2. HELM_SET_ARGS (parameters set internally in the script)
# 3. HELM_OPTS (the parameter passed by the user via --env, with the highest priority, can override the previous configuration)
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_SET_ARGS[@]}" \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Custom values for account controller helm chart.
# This file contains user-customizable configurations.

replicaCount: 1

resources:
limits:
cpu: 1000m
memory: 1024Mi
requests:
cpu: 100m
memory: 64Mi

accountEnv:
approachingDeletionPeriod: "345600"
imminentDeletionPeriod: "259200"
finalDeletionPeriod: "604800"
debtDetectionCycleSeconds: "1800"
osAdminSecret: "object-storage-user-0"
osInternalEndpoint: "object-storage.objectstorage-system.svc.cluster.local"
osNamespace: "objectstorage-system"
baseBalance: "5000000"
quotaLimitsCpu: "16"
quotaLimitsMemory: "64Gi"
quotaLimitsStorage: "200Gi"
quotaLimitsGpu: "8"
quotaLimitsPods: "20"
quotaLimitsNodePorts: "10"
quotaObjectStorageSize: "20Gi"
quotaObjectStorageBucket: "20"
limitRangeEphemeralStorage: "0"
rewardProcessing: "false"
67 changes: 30 additions & 37 deletions controllers/account/deploy/charts/account-controller/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Default values for account controller helm chart.

replicaCount: 1

image: ghcr.io/labring/sealos-account-controller:latest
imagePullPolicy: Always

Expand Down Expand Up @@ -31,47 +29,42 @@ service:
webhook:
port: 443

resources:
limits:
cpu: 1000m
memory: 1024Mi
requests:
cpu: 100m
memory: 64Mi

env:
accountNamespace: sealos-system
userNamespace: user-system
whitelist: "licenses.License.license.sealos.io/v1,notifications.Notification.notification.sealos.io/v1,payments.Payment.account.sealos.io/v1,billingrecordqueries.BillingRecordQuery.account.sealos.io/v1,billinginfoqueries.BillingInfoQuery.account.sealos.io/v1,pricequeries.PriceQuery.account.sealos.io/v1"

# ============================================================================
# Auto-configured values (from sealos-system/sealos-config ConfigMap)
# ============================================================================
# The following accountEnv values are automatically fetched from the
# sealos-system/sealos-config ConfigMap by the entrypoint script and will
# override any values set here. These are provided as reference defaults.
#
# To override these auto-configured values, use HELM_OPTIONS or modify the
# sealos-config ConfigMap directly.
# ============================================================================

accountEnv:
approachingDeletionPeriod: "345600"
imminentDeletionPeriod: "259200"
finalDeletionPeriod: "604800"
debtDetectionCycleSeconds: "1800"
osAdminSecret: ""
osInternalEndpoint: ""
osNamespace: "objectstorage-system"
mongoURI: "mongodb://mongo:27017/resources"
localCockroachURI: ""
globalCockroachURI: ""
trafficMongoURI: ""
localRegion: ""
cloudDomain: "cloud.sealos.io"
cloudPort: ""
accountApiJwtSecret: "secret"
baseBalance: "5000000"
quotaLimitsCpu: "16"
quotaLimitsMemory: "64Gi"
quotaLimitsStorage: "200Gi"
quotaLimitsGpu: "8"
quotaLimitsPods: "20"
quotaLimitsNodePorts: "10"
quotaObjectStorageSize: "20Gi"
quotaObjectStorageBucket: "20"
limitRangeEphemeralStorage: "0"
rewardProcessing: "false"
whitelistKubernetesHosts: ""
# Basic cloud configuration (auto-configured from sealos-config)
cloudDomain: "cloud.sealos.io" # Auto-fetched from sealos-config.cloudDomain
cloudPort: "" # Auto-fetched from sealos-config.cloudPort
localRegion: "" # Auto-fetched from sealos-config.regionUID

# Database connections (auto-configured from sealos-config)
mongoURI: "mongodb://mongo:27017/resources" # Auto-fetched from sealos-config.databaseMongodbURI
globalCockroachURI: "" # Auto-fetched from sealos-config.databaseGlobalCockroachdbURI
localCockroachURI: "" # Auto-fetched from sealos-config.databaseLocalCockroachdbURI
trafficMongoURI: "" # Auto-fetched from sealos-config.databaseMongodbURI

# Authentication secrets (auto-configured from sealos-config)
accountApiJwtSecret: "secret" # Auto-fetched from sealos-config.jwtInternal

# Kubernetes API whitelist (auto-generated from cloudDomain)
whitelistKubernetesHosts: "" # Auto-generated: https://${cloudDomain}:6443

# End of auto-configured values
# ============================================================================

# ConfigMap 合并策略: preserve 保留旧值, overwrite 覆盖旧值
accountEnvMergeStrategy: "overwrite"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Custom values for heartbeat cronjob helm chart.
# This file contains user-customizable configurations.

resources:
limits:
cpu: 200m
memory: 128Mi
requests:
cpu: 100m
memory: 64Mi
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ podSecurityContext:
securityContext:
allowPrivilegeEscalation: false

resources:
limits:
cpu: 200m
memory: 128Mi
requests:
cpu: 100m
memory: 64Mi

nodeSelector: {}

tolerations: []
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -ex
set -e

HELM_OPTS=${HELM_OPTS:-""}
RELEASE_NAME=${RELEASE_NAME:-"heartbeat"}
Expand Down Expand Up @@ -35,4 +35,17 @@ if ! helm status "${RELEASE_NAME}" -n "${RELEASE_NAMESPACE}" >/dev/null 2>&1; th
adopt_cluster_resource clusterrolebinding heartbeat-cluster-role-binding
fi

helm upgrade -i "${RELEASE_NAME}" -n "${RELEASE_NAMESPACE}" --create-namespace "${CHART_PATH}" ${HELM_OPTS}
# Prepare values files
SERVICE_NAME="heartbeat"
USER_VALUES_PATH="/root/.sealos/cloud/values/core/${SERVICE_NAME}-values.yaml"

# Copy user values template if not exists
if [ ! -f "${USER_VALUES_PATH}" ]; then
mkdir -p "$(dirname "${USER_VALUES_PATH}")"
cp "./charts/${SERVICE_NAME}/${SERVICE_NAME}-values.yaml" "${USER_VALUES_PATH}"
fi

helm upgrade -i "${RELEASE_NAME}" -n "${RELEASE_NAMESPACE}" --create-namespace "${CHART_PATH}" \
-f "./charts/${SERVICE_NAME}/values.yaml" \
-f "${USER_VALUES_PATH}" \
${HELM_OPTS}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Custom values for job init helm chart.
# This file contains user-customizable configurations.

resources:
limits:
cpu: 200m
memory: 256Mi
requests:
cpu: 50m
memory: 64Mi
21 changes: 7 additions & 14 deletions controllers/job/init/deploy/charts/job-init/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ image: ghcr.io/labring/sealos-job-init-controller:latest
imagePullPolicy: Always

imagePullSecrets: []
nameOverride: ""
fullnameOverride: "init-job"

serviceAccount:
Expand All @@ -27,6 +26,13 @@ ttlSecondsAfterFinished: 86400
backoffLimit: 10
restartPolicy: OnFailure

# Environment variables (auto-configured by entrypoint.sh)
# These values are set dynamically via --set-string flags:
# - PASSWORD_SALT: from env.passwordSalt (or env var PASSWORD_SALT)
# - ADMIN_PASSWORD: from env.adminPassword (from ConfigMap or generated)
# - ADMIN_USER_NAME: from env.adminUserName (or env var ADMIN_USER_NAME)
# - WORKSPACE_PREFIX: from env.workspacePrefix (or env var WORKSPACE_PREFIX)
# - envFromConfigMap: from env.envFromConfigMap (or env var ENV_FROM_CONFIGMAP)
env:
passwordSalt: ""
adminPassword: "sealos2023"
Expand All @@ -37,19 +43,6 @@ env:
localCockroachUri: ""
localRegion: ""

resources:
limits:
cpu: 200m
memory: 256Mi
requests:
cpu: 50m
memory: 64Mi

metrics:
enabled: false
certPath: /tmp/k8s-metrics-server/metrics-certs
secretName: metrics-server-cert

nodeSelector: {}

tolerations: []
Expand Down
18 changes: 16 additions & 2 deletions controllers/job/init/deploy/job-init-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
# job-init Helm 部署入口,负责安装/升级初始化 Job 资源。
set -ex
set -e

HELM_OPTS=${HELM_OPTS:-""}
RELEASE_NAME=${RELEASE_NAME:-"job-init"}
Expand Down Expand Up @@ -103,4 +103,18 @@ if kubectl -n "${RELEASE_NAMESPACE}" get job "${JOB_NAME}" >/dev/null 2>&1; then
kubectl -n "${RELEASE_NAMESPACE}" delete job "${JOB_NAME}" --ignore-not-found --wait=true
fi

helm upgrade -i "${RELEASE_NAME}" -n "${RELEASE_NAMESPACE}" --create-namespace "${CHART_PATH}" "${HELM_SET_ARGS[@]}" ${HELM_OPTS}
# Prepare values files
SERVICE_NAME="job-init"
USER_VALUES_PATH="/root/.sealos/cloud/values/core/${SERVICE_NAME}-values.yaml"

# Copy user values template if not exists
if [ ! -f "${USER_VALUES_PATH}" ]; then
mkdir -p "$(dirname "${USER_VALUES_PATH}")"
cp "./charts/${SERVICE_NAME}/${SERVICE_NAME}-values.yaml" "${USER_VALUES_PATH}"
fi

helm upgrade -i "${RELEASE_NAME}" -n "${RELEASE_NAMESPACE}" --create-namespace "${CHART_PATH}" \
-f "./charts/${SERVICE_NAME}/values.yaml" \
-f "${USER_VALUES_PATH}" \
"${HELM_SET_ARGS[@]}" \
${HELM_OPTS}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Custom values for license controller helm chart.
# This file contains user-customizable configurations.

# This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/
replicaCount: 1

resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 10m
memory: 64Mi
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
# Default values for license.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

# This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/
replicaCount: 1
# Default values for license controller helm chart.

# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/
image: ghcr.io/labring/sealos-license-controller:latest

# This is for the secretes for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
imagePullSecrets: []
# This is to override the chart name.
nameOverride: ""
fullnameOverride: ""

#This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/
serviceAccount:
Expand All @@ -27,7 +19,7 @@ serviceAccount:
name: ""

# This is for setting Kubernetes Annotations to a Pod.
# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
podAnnotations: {}
# This is for setting Kubernetes Labels to a Pod.
# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
Expand All @@ -51,24 +43,6 @@ service:
# This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports
port: 80

resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 10m
memory: 64Mi
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

# This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
livenessProbe:
httpGet:
Expand All @@ -82,6 +56,7 @@ readinessProbe:
port: 8081
initialDelaySeconds: 5
periodSeconds: 10

# Additional volumes on the output Deployment definition.
volumes: []
# - name: foo
Expand All @@ -106,4 +81,4 @@ metrics:
enabled: false
# Path to the metrics certificate
certPath: /tmp/k8s-metrics-server/metrics-certs
secretName: metrics-server-cert
secretName: metrics-server-cert
Loading
Loading