Project 5: Helm Packaging
تجميع manifests الخاصة بمشروعك في Helm chart واحد، مع values-dev.yaml و values-prod.yaml.
المطلوب
Section titled “المطلوب”- Chart باسم
fullstack-app. - templates للـ frontend و backend و postgres.
- values منفصلة للبيئات.
- تنفيذ
helm lint,helm template,helm upgrade --install,helm rollback.
هيكل مقترح
Section titled “هيكل مقترح”fullstack-app/ Chart.yaml values.yaml values-dev.yaml values-prod.yaml templates/ frontend-deployment.yaml backend-deployment.yaml postgres.yaml services.yaml ingress.yamlvalues-prod.yaml مثال
Section titled “values-prod.yaml مثال”frontend: replicas: 3backend: replicas: 3postgres: storage: 10Giingress: enabled: true host: app.example.comresources: backend: requests: cpu: "250m" memory: "256Mi" limits: cpu: "1" memory: "512Mi"Lab: Packaging للمشروع
الهدف: رندر chart وتثبيته ثم تنفيذ rollback.
helm lint ./fullstack-apphelm template fullstack-dev ./fullstack-app -f fullstack-app/values-dev.yamlhelm upgrade --install fullstack-dev ./fullstack-app -n fullstack-dev --create-namespace -f fullstack-app/values-dev.yamlhelm history fullstack-dev -n fullstack-devhelm rollback fullstack-dev 1 -n fullstack-devExpected output
Section titled “Expected output”1 chart(s) linted, 0 chart(s) failedSTATUS: deployedCleanup
Section titled “Cleanup”helm uninstall fullstack-dev -n fullstack-devkubectl delete namespace fullstack-devAcceptance criteria
Section titled “Acceptance criteria”- لا يوجد hardcoding للبيئة داخل templates.
helm templateينتج YAML صالح.- تستطيع شرح كل value ولماذا هي قابلة للتغيير.