【vLLM 学习】Helm 图表

使用Helm Chart在Kubernetes上部署和管理vLLM推理服务的完整指南 在云原生和AI工程化实践中,Kubernetes已成为容器化应用编排的事实标准,而Helm作为其包管理工具,通过模板化和参数化机制,实现了复杂应用部署的标准化与自动化。这一原理对于管理GPU密集型、有状态的应用尤其关键,它能将基础设施配置转化为可版本控制的代码,显著提升部署的一致性和可重复性。其技术价值在于打通了开发与运维的壁垒,支持环境隔离、配置复用和一键式生命周期管理,是MLOps和DevOps理念落地的核心组件。在AI模型服务化场景中,高性能推理引擎vLLM的部署涉及GPU资源调度、大模型文件管理和服 阅读详情

vLLM 是一款专为大语言模型推理加速而设计的框架,实现了 KV 缓存内存几乎零浪费,解决了内存管理瓶颈问题。

更多 vLLM 中文文档及教程可访问 →go.hyper.ai/Wa62f

本目录包含用于部署 vLLM 应用程序的 Helm 图表。该图表包含部署配置、自动扩缩容、资源管理及其他相关配置项。

Files​

  • Chart.yaml:定义图表元数据,包括名称、版本和维护者信息
  • ct.yaml:图表测试配置文件
  • lintconf.yaml:YAML 文件的语法检查规则
  • values.schema.json:用于验证 values.yaml 的 JSON 模式
  • values.yaml:Helm 图表的默认配置值
  • templates/_helpers.tpl:用于定义通用配置的辅助模板
  • templates/configmap.yaml:创建 ConfigMap 的模板
  • templates/custom-objects.yaml:自定义 Kubernetes 对象的模板
  • templates/deployment.yaml:创建 Deployment 的模板
  • templates/hpa.yaml:水平 Pod 自动扩缩容模板
  • templates/job.yaml:Kubernetes Job 模板
  • templates/poddisruptionbudget.yaml:Pod 中断预算模板
  • templates/pvc.yaml:持久卷声明模板
  • templates/secrets.yaml:Kubernetes Secret 模板
  • templates/service.yaml:创建 Service 的模板

Example materials

.helmignore​

*.png
.git/
ct.yaml
lintconf.yaml
values.schema.json
/workflows

Chart.yaml​

apiVersion: v2
name: chart-vllm
description: Chart vllm


# 图表类型可分为"应用型"或"库型"
#
# 应用型图表是一组可打包成版本化归档文件
# 以供部署的模板集合
#
# 库型图表为开发者提供实用工具函数,
# 它们作为应用图表的依赖项被引入,
# 将功能注入渲染流程。
# 库型图表不包含任何可部署模板,
# 因此无法直接部署。
type: application


# 图表版本号,每次修改图表内容
# 或模板时都应递增此版本号
# 包括应用版本更新时
# 版本号需遵循语义化版本规范(https://semver.org/)
version: 0.0.1


maintainers:
  - name: mfournioux

ct.yaml​

chart-dirs:
  - charts
validate-maintainers: false

lintconf.yaml​

---
rules:
  braces:
    min-spaces-inside: 0
    max-spaces-inside: 0
    min-spaces-inside-empty: -1
    max-spaces-inside-empty: -1
  brackets:
    min-spaces-inside: 0
    max-spaces-inside: 0
    min-spaces-inside-empty: -1
    max-spaces-inside-empty: -1
  colons:
    max-spaces-before: 0
    max-spaces-after: 1
  commas:
    max-spaces-before: 0
    min-spaces-after: 1
    max-spaces-after: 1
  comments:
    require-starting-space: true
    min-spaces-from-content: 2
  document-end: disable
  document-start: disable           # No --- to start a file  # 不 --- 启动文件
  empty-lines:
    max: 2
    max-start: 0
    max-end: 0
  hyphens:
    max-spaces-after: 1
  indentation:
    spaces: consistent
    indent-sequences: whatever      # - list indentation will handle both indentation and without
    indent-sequences: whatever      # - 列表缩进将会处理有无缩进
    check-multi-line-strings: false
  key-duplicates: enable
  line-length: disable              # Lines can be any length  # Lines 可以任意长度
  new-line-at-end-of-file: disable
  new-lines:
    type: unix
  trailing-spaces: enable
  truthy:
    level: warning

templates/_helpers.tpl​

{{/*
Define ports for the pods
定义 Pod 端口
*/}}
{{- define "chart.container-port" -}}
{{-  default "8000" .Values.containerPort }}
{{- end }}


{{/*
Define service name
定义服务名称
*/}}
{{- define "chart.service-name" -}}
{{-  if .Values.serviceName }}
{{-    .Values.serviceName | lower | trim }}
{{-  else }}
"{{ .Release.Name }}-service"
{{-  end }}
{{- end }}


{{/*
Define service port
定义服务端口
*/}}
{{- define "chart.service-port" -}}
{{-  if .Values.servicePort }}
{{-    .Values.servicePort }}
{{-  else }}
{{-    include "chart.container-port" . }}
{{-  end }}
{{- end }}


{{/*
Define service port name
定义服务端口名称
*/}}
{{- define "chart.service-port-name" -}}
"service-port"
{{- end }}


{{/*
Define container port name
定义容器端口名称
*/}}
{{- define "chart.container-port-name" -}}
"container-port"
{{- end }}


{{/*
Define deployment strategy
定义部署策略
*/}}
{{- define "chart.strategy" -}}
strategy:
{{-   if not .Values.deploymentStrategy }}
  rollingUpdate:
    maxSurge: 100%
    maxUnavailable: 0
{{-   else }}
{{      toYaml .Values.deploymentStrategy | indent 2 }}
{{-   end }}
{{- end }}


{{/*
Define additional ports
定义额外端口
*/}}
{{- define "chart.extraPorts" }}
{{-   with .Values.extraPorts }}
{{      toYaml . }}
{{-   end }}
{{- end }}


{{/*
Define chart external ConfigMaps and Secrets
定义外部配置映射和密钥
*/}}
{{- define "chart.externalConfigs" -}}
{{-   with .Values.externalConfigs -}}
{{      toYaml . }}
{{-   end }}
{{- end }}




{{/*
Define liveness et readiness probes
定义存活和就绪探针
*/}}
{{- define "chart.probes" -}}
{{-   if .Values.readinessProbe  }}
readinessProbe:
{{-     with .Values.readinessProbe }}
{{-       toYaml . | nindent 2 }}
{{-     end }}
{{-   end }}
{{-   if .Values.livenessProbe  }}
livenessProbe:
{{-     with .Values.livenessProbe }}
{{-       toYaml . | nindent 2 }}
{{-     end }}
{{-   end }}
{{- end }}


{{/*
Define resources
定义资源配额
*/}}
{{- define "chart.resources" -}}
requests:
  memory: {{ required "Value 'resources.requests.memory' must be defined !" .Values.resources.requests.memory | quote }}
  cpu: {{ required "Value 'resources.requests.cpu' must be defined !" .Values.resources.requests.cpu | quote }}
  {{- if and (gt (int (index .Values.resources.requests "nvidia.com/gpu")) 0) (gt (int (index .Values.resources.limits "nvidia.com/gpu")) 0) }}
  nvidia.com/gpu: {{ required "Value 'resources.requests.nvidia.com/gpu' must be defined !" (index .Values.resources.requests "nvidia.com/gpu") | quote }}
  {{- end }}
limits:
  memory: {{ required "Value 'resources.limits.memory' must be defined !" .Values.resources.limits.memory | quote }}
  cpu: {{ required "Value 'resources.limits.cpu' must be defined !" .Values.resources.limits.cpu | quote }}
  {{- if and (gt (int (index .Values.resources.requests "nvidia.com/gpu")) 0) (gt (int (index .Values.resources.limits "nvidia.com/gpu")) 0) }}
  nvidia.com/gpu: {{ required "Value 'resources.limits.nvidia.com/gpu' must be defined !" (index .Values.resources.limits "nvidia.com/gpu") | quote }}
  {{- end }}
{{- end }}




{{/*
Define User used for the main container
定义主容器运行用户
*/}}
{{- define "chart.user" }}
{{-   if .Values.image.runAsUser  }}
runAsUser:
{{-     with .Values.runAsUser }}
{{-       toYaml . | nindent 2 }}
{{-     end }}
{{-   end }}
{{- end }}


{{- define "chart.extraInitImage" -}}
"amazon/aws-cli:2.6.4"
{{- end }}


{{- define "chart.extraInitEnv" -}}
- name: S3_ENDPOINT_URL
  valueFrom:
    secretKeyRef:
      name: {{ .Release.Name }}-secrets
      key: s3endpoint
- name: S3_BUCKET_NAME
  valueFrom:
    secretKeyRef:
      name: {{ .Release.Name }}-secrets
      key: s3bucketname
- name: AWS_ACCESS_KEY_ID
  valueFrom:
    secretKeyRef:
      name: {{ .Release.Name }}-secrets
      key: s3accesskeyid
- name: AWS_SECRET_ACCESS_KEY
  valueFrom:
    secretKeyRef:
      name: {{ .Release.Name }}-secrets
      key: s3accesskey
- name: S3_PATH
  value: "{{ .Values.extraInit.s3modelpath }}"
- name: AWS_EC2_METADATA_DISABLED
  value: "{{ .Values.extraInit.awsEc2MetadataDisabled }}"
{{- end }}


{{/*
  Define chart labels
定义图表标签
*/}}
{{- define "chart.labels" -}}
{{-   with .Values.labels -}}
{{      toYaml . }}
{{-   end }}
{{- end }}

templates/configmap.yaml​

{{- if .Values.configs -}}
apiVersion: v1
kind: ConfigMap
metadata:
  name: "{{ .Release.Name }}-configs"
  namespace: {{ .Release.Namespace }}
data:
  {{- with .Values.configs }}
  {{- toYaml . | nindent 2 }}
  {{- end }}
{{- end -}}

templates/custom-objects.yaml​

{{- if .Values.customObjects }}
{{- range .Values.customObjects }}
{{- tpl (. | toYaml) $ }}
---
{{- end }}
{{- end }}

templates/deployment.yaml​

apiVersion: apps/v1
kind: Deployment
metadata:
  name: "{{ .Release.Name }}-deployment-vllm"
  namespace: {{ .Release.Namespace }}
  labels:
  {{- include "chart.labels" . | nindent 4 }}
spec:
  replicas: {{ .Values.replicaCount }}
  {{- include "chart.strategy" . | nindent 2 }}
  selector:
    matchLabels:
      environment: "test"
      release: "test"
  progressDeadlineSeconds: 1200
  template:
    metadata:
      labels:
        environment: "test"
        release: "test"
    spec:
      containers:
        - name: "vllm"
          image: "{{ required "Required value 'image.repository' must be defined !" .Values.image.repository }}:{{ required "Required value 'image.tag' must be defined !" .Values.image.tag }}"
          {{- if .Values.image.command }}
          command :
            {{- with .Values.image.command }}
            {{- toYaml . | nindent 10 }}
            {{- end }}
          {{- end }}
          securityContext:
            {{- if .Values.image.securityContext }}
              {{- with .Values.image.securityContext }}
              {{- toYaml . | nindent 12 }}
              {{- end }}
            {{- else }}
            runAsNonRoot: false
              {{- include "chart.user" . | indent 12 }}
            {{- end }}
          imagePullPolicy: IfNotPresent
          {{- if .Values.image.env }}
          env :
            {{- with .Values.image.env }}
            {{- toYaml . | nindent 10 }}
            {{- end }}
          {{- else }}
          env: []
          {{- end }}
          {{- if or .Values.externalConfigs .Values.configs .Values.secrets }}
          envFrom:
            {{- if .Values.configs }}
            - configMapRef:
                name: "{{ .Release.Name }}-configs"
            {{- end }}
            {{- if .Values.secrets}}
            - secretRef:
                name: "{{ .Release.Name }}-secrets"
            {{- end }}
            {{- include "chart.externalConfigs" . | nindent 12 }}
          {{- end }}
          ports:
            - name: {{ include "chart.container-port-name" . }}
              containerPort: {{ include "chart.container-port" . }}
            {{- include "chart.extraPorts" . | nindent 12 }}
          {{- include "chart.probes" . | indent 10 }}
          resources: {{- include "chart.resources" . | nindent 12 }}
          volumeMounts:
          - name: {{ .Release.Name }}-storage
            mountPath: /data


        {{- with .Values.extraContainers }}
        {{ toYaml . | nindent 8 }}
        {{- end }}


      {{-   if .Values.extraInit  }}
      initContainers:
      - name: wait-download-model
        image: {{ include "chart.extraInitImage" . }}
        command:
          - /bin/bash
        args:
          - -eucx
          - while aws --endpoint-url $S3_ENDPOINT_URL s3 sync --dryrun s3://$S3_BUCKET_NAME/$S3_PATH /data | grep -q download; do sleep 10; done
        env: {{- include "chart.extraInitEnv" . | nindent 10 }}
        resources:
          requests:
            cpu: 200m
            memory: 1Gi
          limits:
            cpu: 500m
            memory: 2Gi
        volumeMounts:
        - name: {{ .Release.Name }}-storage
          mountPath: /data
      {{- end }}
      volumes:
        - name: {{ .Release.Name }}-storage
          persistentVolumeClaim:
            claimName: {{ .Release.Name }}-storage-claim


      {{- with .Values.nodeSelector }}
      nodeSelector:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      {{- with .Values.tolerations }}
      tolerations:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      {{- if and (gt (int (index .Values.resources.requests "nvidia.com/gpu")) 0) (gt (int (index .Values.resources.limits "nvidia.com/gpu")) 0) }}
      runtimeClassName: nvidia
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                - key: nvidia.com/gpu.product
                  operator: In
                  {{- with .Values.gpuModels }}
                  values:
                    {{- toYaml . | nindent 20 }}
                  {{- end }}
      {{- end }}

templates/hpa.yaml​

{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: "{{ .Release.Name }}-hpa"
  namespace: {{ .Release.Namespace }}
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: vllm
  minReplicas: {{ .Values.autoscaling.minReplicas }}
  maxReplicas: {{ .Values.autoscaling.maxReplicas }}
  metrics:
    {{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
    {{- end }}
    {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
    - type: Resource
      resource:
        name: memory
        target:
          type: Utilization
          averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
    {{- end }}
{{- end }}

templates/job.yaml​

{{-   if .Values.extraInit  }}
apiVersion: batch/v1
kind: Job
metadata:
  name: "{{ .Release.Name }}-init-vllm"
  namespace: {{ .Release.Namespace }}
spec:
  ttlSecondsAfterFinished: 100
  template:
   metadata:
     name: init-vllm
   spec:
    containers:
    - name: job-download-model
      image: {{ include "chart.extraInitImage" . }}
      command:
        - /bin/bash
      args:
        - -eucx
        - aws --endpoint-url $S3_ENDPOINT_URL s3 sync s3://$S3_BUCKET_NAME/$S3_PATH /data
      env: {{- include "chart.extraInitEnv" . | nindent 8 }}
      volumeMounts:
        - name: {{ .Release.Name }}-storage
          mountPath: /data
      resources:
        requests:
          cpu: 200m
          memory: 1Gi
        limits:
          cpu: 500m
          memory: 2Gi
    restartPolicy: OnFailure
    volumes:
    - name: {{ .Release.Name }}-storage
      persistentVolumeClaim:
        claimName: "{{ .Release.Name }}-storage-claim"
{{- end }}

templates/poddisruptionbudget.yaml​

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: "{{ .Release.Name }}-pdb"
  namespace: {{ .Release.Namespace }}
spec:
  maxUnavailable: {{ default 1 .Values.maxUnavailablePodDisruptionBudget }}

templates/pvc.yaml​

{{-   if .Values.extraInit  }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: "{{ .Release.Name }}-storage-claim"
  namespace: {{ .Release.Namespace }}
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: {{ .Values.extraInit.pvcStorage }}
{{- end }}

templates/secrets.yaml​

apiVersion: v1
kind: Secret
metadata:
  name: "{{ .Release.Name }}-secrets"
  namespace: {{ .Release.Namespace }}
type: Opaque
data:
  {{- range $key, $val := .Values.secrets }}
  {{ $key }}: {{ $val | b64enc | quote }}
  {{- end }}

templates/service.yaml​

apiVersion: v1
kind: Service
metadata:
  name: "{{ .Release.Name }}-service"
  namespace: {{ .Release.Namespace }}
spec:
  type: ClusterIP
  ports:
    - name: {{ include "chart.service-port-name" . }}
      port: {{ include "chart.service-port" . }}
      targetPort: {{ include "chart.container-port-name" . }}
      protocol: TCP
  selector:
  {{- include "chart.labels" . | nindent 4 }}

values.schema.json​

{
    "$schema": "http://json-schema.org/schema#",
    "type": "object",
    "properties": {
        "image": {
            "type": "object",
            "properties": {
                "repository": {
                    "type": "string"
                },
                "tag": {
                    "type": "string"
                },
                "command": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            },
            "required": [
                "command",
                "repository",
                "tag"
            ]
        },
        "containerPort": {
            "type": "integer"
        },
        "serviceName": {
            "type": "null"
        },
        "servicePort": {
            "type": "integer"
        },
        "extraPorts": {
            "type": "array"
        },
        "replicaCount": {
            "type": "integer"
        },
        "deploymentStrategy": {
            "type": "object"
        },
        "resources": {
            "type": "object",
            "properties": {
                "requests": {
                    "type": "object",
                    "properties": {
                        "cpu": {
                            "type": "integer"
                        },
                        "memory": {
                            "type": "string"
                        },
                        "nvidia.com/gpu": {
                            "type": "integer"
                        }
                    },
                    "required": [
                        "cpu",
                        "memory",
                        "nvidia.com/gpu"
                    ]
                },
                "limits": {
                    "type": "object",
                    "properties": {
                        "cpu": {
                            "type": "integer"
                        },
                        "memory": {
                            "type": "string"
                        },
                        "nvidia.com/gpu": {
                            "type": "integer"
                        }
                    },
                    "required": [
                        "cpu",
                        "memory",
                        "nvidia.com/gpu"
                    ]
                }
            },
            "required": [
                "limits",
                "requests"
            ]
        },
        "gpuModels": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "autoscaling": {
            "type": "object",
            "properties": {
                "enabled": {
                    "type": "boolean"
                },
                "minReplicas": {
                    "type": "integer"
                },
                "maxReplicas": {
                    "type": "integer"
                },
                "targetCPUUtilizationPercentage": {
                    "type": "integer"
                }
            },
            "required": [
                "enabled",
                "maxReplicas",
                "minReplicas",
                "targetCPUUtilizationPercentage"
            ]
        },
        "configs": {
            "type": "object"
        },
        "secrets": {
            "type": "object"
        },
        "externalConfigs": {
            "type": "array"
        },
        "customObjects": {
            "type": "array"
        },
        "maxUnavailablePodDisruptionBudget": {
            "type": "string"
        },
        "extraInit": {
            "type": "object",
            "properties": {
                "s3modelpath": {
                    "type": "string"
                },
                "pvcStorage": {
                    "type": "string"
                },
                "awsEc2MetadataDisabled": {
                    "type": "boolean"
                }
            },
            "required": [
                "pvcStorage",
                "s3modelpath",
                "awsEc2MetadataDisabled"
            ]
        },
        "extraContainers": {
            "type": "array"
        },
        "readinessProbe": {
            "type": "object",
            "properties": {
                "initialDelaySeconds": {
                    "type": "integer"
                },
                "periodSeconds": {
                    "type": "integer"
                },
                "failureThreshold": {
                    "type": "integer"
                },
                "httpGet": {
                    "type": "object",
                    "properties": {
                        "path": {
                            "type": "string"
                        },
                        "port": {
                            "type": "integer"
                        }
                    },
                    "required": [
                        "path",
                        "port"
                    ]
                }
            },
            "required": [
                "failureThreshold",
                "httpGet",
                "initialDelaySeconds",
                "periodSeconds"
            ]
        },
        "livenessProbe": {
            "type": "object",
            "properties": {
                "initialDelaySeconds": {
                    "type": "integer"
                },
                "failureThreshold": {
                    "type": "integer"
                },
                "periodSeconds": {
                    "type": "integer"
                },
                "httpGet": {
                    "type": "object",
                    "properties": {
                        "path": {
                            "type": "string"
                        },
                        "port": {
                            "type": "integer"
                        }
                    },
                    "required": [
                        "path",
                        "port"
                    ]
                }
            },
            "required": [
                "failureThreshold",
                "httpGet",
                "initialDelaySeconds",
                "periodSeconds"
            ]
        },
        "labels": {
            "type": "object",
            "properties": {
                "environment": {
                    "type": "string"
                },
                "release": {
                    "type": "string"
                }
            },
            "required": [
                "environment",
                "release"
            ]
        }
    },
    "required": [
        "autoscaling",
        "configs",
        "containerPort",
        "customObjects",
        "deploymentStrategy",
        "externalConfigs",
        "extraContainers",
        "extraInit",
        "extraPorts",
        "gpuModels",
        "image",
        "labels",
        "livenessProbe",
        "maxUnavailablePodDisruptionBudget",
        "readinessProbe",
        "replicaCount",
        "resources",
        "secrets",
        "servicePort"
    ]
}

values.yaml​

# -- Default values for chart vllm
# -- vLLM Chart 的默认值
# -- Declare variables to be passed into your templates.
# -- 声明要传递到模板中的变量


# -- Image configuration
# -- 镜像配置
image:
  # -- Image repository
  # -- 镜像仓库
  repository: "vllm/vllm-openai"
  # -- Image tag
  # -- 镜像标签
  tag: "latest"
  # -- Container launch command
  # -- 容器启动命令
  command: ["vllm", "serve", "/data/", "--served-model-name", "opt-125m", "--dtype", "bfloat16", "--host", "0.0.0.0", "--port", "8000"]


# -- Container port
# -- 容器端口
containerPort: 8000
# -- Service name
# -- 服务名称
serviceName:
# -- Service port
# -- 服务端口
servicePort: 80
# -- Additional ports configuration
# -- 额外端口配置
extraPorts: []


# -- Number of replicas
# -- 副本数量
replicaCount: 1


# -- Deployment strategy configuration
# -- 部署策略配置
deploymentStrategy: {}


# -- Resource configuration
# -- 资源配置
resources:
  requests:
    # -- Number of CPUs
    # -- CPU 数量
    cpu: 4
    # -- CPU memory configuration
     # -- CPU 内存配置
    memory: 16Gi
    # -- Number of gpus used
    # -- 使用的 GPU 数量
    nvidia.com/gpu: 1
  limits:
    # -- Number of CPUs
    # -- CPU 数量


    cpu: 4
    # -- CPU memory configuration
    # -- CPU memory configuration
    memory: 16Gi
    # -- Number of gpus used
    # -- 使用的 GPU 数量
    nvidia.com/gpu: 1


# -- Type of gpu used
# -- 使用的 GPU 类型
gpuModels:
  - "TYPE_GPU_USED"


# -- Autoscaling configuration
# -- 自动扩展配置
autoscaling:
  # -- Enable autoscaling
  # -- 是否启用自动扩展
  enabled: false
  # -- Minimum replicas
  # -- 最小副本数
  minReplicas: 1
  # -- Maximum replicas
  # -- 最大副本数
  maxReplicas: 100
  # -- Target CPU utilization for autoscaling
  # -- 自动扩展的目标 CPU 使用率
  targetCPUUtilizationPercentage: 80
  # targetMemoryUtilizationPercentage: 80
  # targetMemoryUtilizationPercentage: 80


# -- Configmap
# -- 配置映射
configs: {}


# -- Secrets configuration
# -- 机密配置
secrets: {}


# -- External configuration
# -- 外部配置
externalConfigs: []


# -- Custom Objects configuration
# -- 自定义对象配置
customObjects: []


# -- Disruption Budget Configuration
# -- 破坏预算配置
maxUnavailablePodDisruptionBudget: ""


# -- Additional configuration for the init container
# -- Init 容器的额外配置
extraInit:
   # -- Path of the model on the s3 which hosts model weights and config files
   # -- S3 上存储模型权重和配置文件的路径
  s3modelpath: "relative_s3_model_path/opt-125m"
   # -- Storage size of the s3
   # -- S3 的存储大小
  pvcStorage: "1Gi"
  awsEc2MetadataDisabled: true


# -- Additional containers configuration
# -- 额外的容器配置
extraContainers: []


# -- Readiness probe configuration
# -- 就绪探针(Readiness Probe)配置
readinessProbe:
  # -- Number of seconds after the container has started before readiness probe is initiated
  # -- 容器启动后执行就绪探针前的等待时间(秒)
  initialDelaySeconds: 5
  # -- How often (in seconds) to perform the readiness probe
  # -- 就绪探针执行的频率(秒)
  periodSeconds: 5
  # -- Number of times after which if a probe fails in a row, Kubernetes considers that the overall check has failed: the container is not ready
  # -- 如果连续失败的次数达到该值,则 Kubernetes 认为容器未就绪
  failureThreshold: 3
   # -- Configuration of the Kubelet http request on the server
   # -- Kubelet 在服务器上的 HTTP 请求配置
  httpGet:
    # -- Path to access on the HTTP server
    # -- HTTP 服务器上访问的路径
    path: /health
    # -- Name or number of the port to access on the container, on which the server is listening
    # -- 服务器监听的访问容器的端口或名字
    port: 8000


# -- Liveness probe configuration
# -- 存活探针(Liveness Probe)配置
livenessProbe:
 # -- Number of seconds after the container has started before liveness probe is initiated
 # -- 容器启动后执行存活探针前的等待时间(秒)
  initialDelaySeconds: 15
  # -- Number of times after which if a probe fails in a row, Kubernetes considers that the overall check has failed: the container is not alive
  # -- 如果连续失败的次数达到该值,则 Kubernetes 认为容器已崩溃
  failureThreshold: 3
  # -- How often (in seconds) to perform the liveness probe
  # -- 存活探针执行的频率(秒)
  periodSeconds: 10
  # -- Configuration of the Kubelet http request on the server
  # -- Kubelet 在服务器上的 HTTP 请求配置
  httpGet:
    # -- Path to access on the HTTP server
    # -- HTTP 服务器上访问的路径
    path: /health
    # -- Name or number of the port to access on the container, on which the server is listening
    # -- 服务器监听的访问容器的端口或名字
    port: 8000


labels:
  environment: "test"
  release: "test"
vLLM缓存命中率优化实战:从60%到96%的成本革命 在大语言模型推理服务中,缓存命中率是衡量重复计算浪费的核心指标。KV Cache 机制通过复用历史 token 的键值张量,能显著降低 GPU 算力消耗。然而许多团队缺乏对缓存行为的可观测性,导致算力被白白浪费。围绕缓存命中率的基本概念,可以解释其与推理成本的非线性关系;结合 vllm-ascend 推理服务中的指标采集,配合 Prometheus 与 Grafana 搭建可视化监控,能系统化优化缓存策略。通过调整前缀缓存、显存容量和请求前缀设计,可将命中率从 60% 提升至 96%,使单请求成本降至约 1 阅读详情

相关推荐

9、Helm 图表开发:从基础到模板应用

本文详细介绍了 Helm 图表开发的基础知识与高级技巧,涵盖 .helmignore 文件配置、图表检查(linting)、模板语法、管道与函数的使用,以及子模板的设计。同时,文章还总结了模板开发的最佳实践和常见问题的解决方法,帮助开发者高效构建可维护的 Helm 图表,适用于不同复杂度的 Kubernetes 应用部署需求。

e1f2g的博客 82

Helm Charts 保姆级入门教程

通过简单易懂的 Helm Chart 教程了解如何创建 Helm 图表。本指南涵盖结构、组件和最佳实践。因此,如果您想学习 helm chart 基础知识并亲身体验 helm chart,您会喜欢本指南。先决条件若要开始使用 helm 图表,需要具备以下条件。什么是 Helm Chart?为了便于解释,我选择一个非常基本的示例,即在 Kubernetes 上使用 Nginx 进行网站前端部署假设您的项目中有四个不同的环境。和。每个环境都有不同的 Nginx 部署参数。例如。

一览无遗 9880

图表:Helm图表的集合

图表 舵图的集合 helm repo add chgl https://chgl.github.io/charts helm repo update 发展 (可选)安装挂钩 pip install pre-commit pre-commit install (可选)设置具有Nginx入口支持的KinD集群 kind create cluster --config=hack/kind-config.yaml kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/kind/deploy.yaml 更改图表 将文件夹安装在容器中,以轻松运行和检查 docker run --rm -it -v $PWD :/usr/src/app qua

Helm Charts 保姆级入门教程_helm chart 语法详解,2024年最新面试字节跳动两轮后被完虐

如您所见,部署 YAML 文件是模板目录的一部分(以粗体突出显示),并且有特定于 helm 的文件和文件夹。让我们看一下 helm chart 中的每个文件和目录,并了解它们的重要性。helm chart 的想法是将 YAML 文件模板化,以便我们可以通过动态地为它们分配值来在多个环境中重用它们。该文件包含我们在模板中使用的模板指令中需要替换的所有值。若要验证模板中的值是否被替换,可以使用以下命令呈现具有值的模板化 YAML 文件。在我们的例子中,我们将进行简单的 Kubernetes Nginx 部署。

2401_84300070的博客 1363

helm-charts:尝试创建可以容纳尽可能多的Helm图表用例的Helm图表。 也就是说,一个通用的Helm图表可以部署许多不同的Kubernetes部署

舵图 Helm是在Kubernetes上部署应用程序的工具。 舵图基本上是此类应用程序的模板。 该Helm图表旨在充当Kubernetes资源的抽象,它是一个(主要是)通用模板,用于在尽可能多的用例中部署尽可能多的应用程序。 TL; DR $ helm install <APPLICATION> . 先决条件 安装或升级带有机密信息的图表 $ helm secrets upgrade --install -f values.yaml -f secrets/<SECRET>.yaml <APPLICATION> . 卸载图表 $ helm delete <APPLICATION> 配置 范围 描述 默认 去做 添加kind: Deployment 添加kind: StatefulSet 添加kind: DaemonSet 添加kind: Pod

CTF-Web习题:2019强网杯 UPLOAD

本题涉及知识点:代码审计、文件上传漏洞、反序列化漏洞

LJW123487的博客 1903

Helm 学习手册(二)

在前面的示例中,name键被赋予了LearnHelm值。在 YAML 中,键和值由冒号(:)分隔。冒号左边的字符代表键,而冒号右边的字符代表值。在 YAML 格式中,间距很重要。请注意,冒号和LearnHelm字符串之间缺少空格。这将导致解析错误。冒号和值之间必须存在空格。虽然前面的示例代表了一个简单的键值对,但 YAML 允许用户配置具有嵌套元素或块的更复杂的配对。

龙哥盟 1303

从mseed到SAC格式转换全攻略:mseed2sac工具安装与批量处理技巧

本文详细介绍了如何将mseed格式的地震数据高效转换为SAC格式,涵盖mseed2sac工具的安装、单文件转换技巧、批量处理自动化实现以及元数据高级处理策略。通过具体命令和脚本示例,帮助地震学研究者快速掌握数据预处理的关键技术,提升波形数据分析效率。

ruby5的博客 927

Nemotron-RL-instruction_following-structured_outputs样本深读:文档、JSON Schema与问题的三位一体结构解析

Nemotron-RL-instruction_following-structured_outputs 是 NVIDIA 官方发布的**结构化输出(Structured Outputs)强化学习训练数据集**,共 9,949 条 JSON 格式的指令遵循样本。它专门测试大语言模型(LLM)在 **JSON Schema 约束下按指令输出合法 JSON** 的能力。每条样本都由"文档 + 格式化指

gitblog_00045的博客 451

KEIL5编译报错L6200E:__stdout重定义问题分析与解决

本文深入分析KEIL5编译报错L6200E中__stdout重定义问题的根源,指出因未完整定义__stderr导致与标准库stdio_streams.o冲突。提供完整重定义标准流、启用MicroLIB库等解决方案,帮助开发者彻底解决Symbol multiply defined错误,提升嵌入式开发效率。

uran的专栏 954

Nvidia Driveos SDK/PDK介绍

NVIDIA DRIVEOS SDK/PDK介绍

u011803281的博客 2176

vLLM Helm 图表设计:实现大语言模型在Kubernetes上的生产级部署

在云原生和人工智能技术融合的背景下,容器化与编排技术已成为部署复杂AI应用的标准范式。Kubernetes作为容器编排的事实标准,通过声明式配置和自动化管理,为应用提供了弹性伸缩和高可用的基础。Helm作为Kubernetes的包管理工具,通过将应用及其依赖打包成可复用的Chart,极大地简化了部署流程,提升了工程效率。其技术价值在于实现了部署的标准化、版本化和参数化,是构建持续交付流水线的关键环节。这一技术栈在机器学习运维(MLOps)领域尤为重要,特别是在部署像vLLM这样的大语言模型推理服务时,能有效

weixin_34357928的博客 409

CARLA仿真:自定义地图与AI车辆行为编程

CARLA仿真:自定义地图与AI车辆行为编程 ,人工智能,计算机视觉,大模型,AI,本文围绕CARLA仿真平台,介绍了其基础功能与安装方法,详解地图系统,包括预设地图的加载切换及自定义地图的创建、导入与优化。还阐述了AI车辆的创建、属性设置、销毁,以及行为控制,如交通规则遵守、路径规划、复杂行为编程和行为树应用。同时涉及传感器与车辆感知、交通场景构建、自定义地图与AI行为结合应用、高级应用,以及常见问题解决方案和学习资源,为CARLA仿真应用提供全面指导。

不踩坑,不知道坑有多深;不总结,踩过的坑白踩。 11万+

【vLLM 学习】Eagle

本目录包含用于部署 vLLM 应用程序的 Helm 图表。该图表包含部署配置、自动扩缩容、资源管理及其他相关配置项。vLLM 是一款专为大语言模型推理加速而设计的框架,实现了 KV 缓存内存几乎零浪费,解决了内存管理瓶颈问题。更多 vLLM 中文文档及教程可访问 →。

HyperAI超神经 205

锂电池的充电和放电曲线解读

锂电池充放电曲线是反映其性能的关键指标。充电曲线分为恒流和恒压两阶段:恒流阶段电压快速上升,恒压阶段电流逐渐降低;放电曲线则呈现平台期和快速衰减期特征。这些曲线受温度、充放电倍率及材料体系(如三元锂或磷酸铁锂)显著影响。通过分析曲线特征,可优化电池管理系统,实现精准的SOC估算、快充策略制定及故障诊断,从而在电池性能与安全性间取得平衡。不同应用场景(如新能源汽车或消费电子)对曲线形态有特定要求。

start_up_go的博客 5067

基于STM32L4XX、HAL库的AD7768BSTZ 模数转换器ADC驱动程序设计

/ 默认SPI配置。// 读取通道数据命令。// 通过SYNC_IN引脚触发转换(如果使用)// 处理数据...// 或者通过SPI命令。// 初始化AD7768。// SPI1引脚配置。

zhusl6688的博客 462

【vLLM 学习】Cohere Rerank Client

vLLM 是一款专为大语言模型推理加速而设计的框架,实现了 KV 缓存内存几乎零浪费,解决了内存管理瓶颈问题。该图表包含部署配置、自动扩缩容、资源管理及其他相关配置项。本目录包含用于部署 vLLM 应用程序的。更多 vLLM 中文文档及教程可访问 →。

HyperAI超神经 180

【ComfyUI】QwenImageEdit OOTD角色与姿态匹配换装

本文介绍了一个基于Qwen Edit OOTD 2.0的ComfyUI工作流,能够实现角色与姿态匹配的智能穿搭生成。该工作流通过整合模型推理、姿态识别、图像拼接和渲染等节点,完成从角色图、姿态图到成品穿搭图的完整生成流程。核心采用Qwen Image系列模型进行图像理解和编辑,配合ControlNet进行姿态引导。用户只需提供角色图和姿态参考图,系统即可自动完成姿态解析、语义编码、采样生成等步骤,输出与输入姿态一致的穿搭图像。该方案适用于虚拟角色展示、电商试穿等场景,能保持角色特征一致的同时灵活变换姿态,显

Mr数据杨 1586

【vLLM 学习】Disaggregated Prefill

本目录包含用于部署 vLLM 应用程序的 Helm 图表。该图表包含部署配置、自动扩缩容、资源管理及其他相关配置项。vLLM 是一款专为大语言模型推理加速而设计的框架,实现了 KV 缓存内存几乎零浪费,解决了内存管理瓶颈问题。更多 vLLM 中文文档及教程可访问 →。

HyperAI超神经 234

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

【vLLM 学习】Distributed

本目录包含用于部署 vLLM 应用程序的 Helm 图表。该图表包含部署配置、自动扩缩容、资源管理及其他相关配置项。vLLM 是一款专为大语言模型推理加速而设计的框架,实现了 KV 缓存内存几乎零浪费,解决了内存管理瓶颈问题。更多 vLLM 中文文档及教程可访问 →。

HyperAI超神经 33

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

SecGPT-14B开源可部署:提供Docker Compose与Helm Chart双方案

本文介绍了如何在星图GPU平台上自动化部署SecGPT-14B镜像,快速搭建一个专精于网络安全领域的AI助手。该平台简化了部署流程,用户可便捷地利用该模型进行漏洞分析、攻击日志溯源等典型安全任务,提升安全运维效率。

weixin_34620658的博客 953

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

如何精准控制画面布局?FLUX 3 Image Klein GGUF Bounding Box 提示词技巧清单

想在 AI 绘图里"指哪画哪"?本文为你拆解 **FLUX 3 Image Klein GGUF** 模型的 **Bounding Box(边界框)提示词技巧**:通过 0~1000 网格坐标框,你可以精准控制画面中每个元素的位置与比例,还能在图像编辑时移动、换色、替换甚至删除指定区域。以下清单来自项目 [README.md](https://link.gitcode.com/i/4ce09ebb

gitblog_09728的博客 418

Llama 3.3 70B生产部署实战:AWQ量化+vLLM+BentoML一键上线

大语言模型推理服务本质上是计算密集型任务,其核心挑战在于显存效率、低延迟响应与高并发稳定性。AWQ量化通过激活感知的权重压缩,在保持97%以上精度的同时将70B模型显存占用压至36GB;vLLM凭借PagedAttention机制彻底解决KV缓存碎片化问题,实测QPS提升3.2倍;BentoML则提供标准化服务封装能力,实现环境一致性、资源声明式调度与生命周期可控。该技术栈已广泛应用于私有大模型API服务、AI客服中台及企业知识问答系统等场景,特别适合需快速落地Llama 3.3 70B等超大规模模型的工程

weixin_34280237的博客 485

应用平台更新:可定制目录、基于Git的密钥管理与K8s项目自动化管理

Akamai应用平台在2024年KubeCon大会上宣布进入公开测试阶段,重点降低运维负担并提升开发者体验。平台新增可定制的自助服务目录,支持添加公开Helm图表扩展功能;提供隔离的团队工作空间,集成CI/CD能力;自动管理30多个Kubernetes项目的安全更新;改进基于GitOps的密钥管理。同时发布多场景实用指南,包括AI推理、微服务通信等。未来计划优化UI界面,增强GitOps能力,并转为基于算子的架构。该免费服务通过CloudManager在全球LKE区域提供。

AKAMAI_CHINA的博客 1176

大语言模型生产部署实战:从vLLM推理到K8s编排的完整指南

大语言模型(LLM)的微调与部署是当前AI工程化的核心挑战。其原理在于将训练好的模型参数通过推理框架转化为可响应用户请求的在线服务。这项技术的核心价值在于打通从算法研究到业务应用的闭环,实现模型能力的稳定交付。在应用场景上,它广泛服务于智能对话、内容生成、代码辅助等需要低延迟、高并发响应的生产环境。本文聚焦于**vLLM**推理框架与**Kubernetes**编排系统的深度整合,详细解析如何利用vLLM的PagedAttention优化内存管理以提升吞吐,并借助K8s实现服务的自动扩缩容与高可用部署,为L

weixin_34389926的博客 320

OpenClaw双部署实战:云端K8s+本地NAS的智能体生产落地指南

智能体(Agent)运行时框架是大模型工程化落地的核心基础设施,其本质是将LLM能力封装为可调度、可观测、可运维的服务组件。OpenClaw作为面向真实任务闭环的开源智能体框架,通过多模型网关抽象、技能热加载与统一可观测性接口,解决了私有化大模型对接、边缘离线执行与故障快速定位三大刚性需求。其核心设计——云端控制平面与本地数据平面分离的双部署架构,既保障高可用与灰度发布能力,又满足工业场景下的低延迟响应与网络断连容灾要求。本文聚焦OpenClaw在Kubernetes集群与群晖NAS等异构环境中的配置差异、

weixin_33226548的博客 265
上一篇: 【Triton 教程】triton-ops
下一篇: 仅需 3 秒音频实现「配音自由」,Mistral 开源语音大模型 Voxtral-4B-TTS-2603;多项全能!Capybara 一站式搞定图、视频生成与指令编辑
HyperAI超神经
博客等级 码龄7年 8873粉丝 1753原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值