{{- define "my-chart.labels" -}}
app.kubernetes.io/name: {{ include "my-chart.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/component: "backend"
app.kubernetes.io/part-of: "my-platform"
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "my-chart.chart" . }}
{{- end }}
image:
repository: nginx
tag: '1.25'
pullPolicy: IfNotPresent
replicaCount: 1
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 100m
memory: 128Mi
autoscaling:
enabled: false
ingress:
enabled: false
podAnnotations: {}
nodeSelector: {}
tolerations: []
affinity: {}
extraEnvVars: []
helm upgrade --install my-app ./my-chart \
-f values-common.yaml \
-f values-production.yaml \
--set image.tag=v2.1.0
dependencies:
- name: frontend
version: '2.x.x'
repository: 'file://charts/frontend'
- name: backend-api
version: '3.x.x'
repository: 'file://charts/backend-api'
- name: redis
version: '17.x.x'
repository: 'https://charts.bitnami.com/bitnami'
condition: redis.enabled
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: my-app
namespace: argocd
spec:
source:
repoURL: https://github.com/myorg/helm-charts
targetRevision: main
path: charts/my-app
helm:
releaseName: my-app
valueFiles:
- values.yaml
- values-production.yaml
destination:
server: https://kubernetes.default.svc
namespace: production
syncPolicy:
automated:
prune: true
selfHeal: true
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: my-app
namespace: production
spec:
interval: 10m
chart:
spec:
chart: my-app
version: '>=1.0.0'
sourceRef:
kind: HelmRepository
name: my-charts
values:
replicaCount: 3
image:
tag: v2.1.0
upgrade:
remediation:
retries: 3
podSecurityContext:
runAsNonRoot: true
runAsUser: 1000
seccompProfile:
type: RuntimeDefault
containerSecurityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ['ALL']
- ネーミングとラベル: Kubernetes公式ラベル標準に準拠、63文字制限
- Values設計: ネスト構造、合理的なデフォルト値、拡張ポイントの提供
- マルチ環境: Valuesファイルのレイヤリングで環境別設定管理
- サブチャート/アンブレラ: コンポーネントの独立性とデプロイの利便性のバランス
- GitOps統合: ArgoCD ApplicationまたはFlux HelmReleaseによる宣言的デプロイ
- セキュリティ: 不変タグ、外部シークレット管理、SecurityContextのデフォルト適用
- メンテナンス: SemVer、CHANGELOG、deprecation戦略