diff --git a/.github/workflows/lab4.yml b/.github/workflows/lab4.yml deleted file mode 100644 index d800c6f..0000000 --- a/.github/workflows/lab4.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Lab 4 Grading - -on: [push] - -env: - FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" - -jobs: - helm-validate: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - # Встановлюємо Helm у хмарне середовище - - name: Set up Helm - uses: azure/setup-helm@v4 - with: - version: 'v3.12.0' - - # Запускаємо автоматичну перевірку - - name: Run Helm Grading Script - run: | - chmod +x ./tests/lab4_test.sh - ./tests/lab4_test.sh diff --git a/charts/ecommerce-app/Chart.yaml b/charts/ecommerce-app/Chart.yaml deleted file mode 100644 index 9d96005..0000000 --- a/charts/ecommerce-app/Chart.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v2 -name: ecommerce-app -description: A Helm chart for our Commerce-Ready FastAPI application -type: application -version: 0.1.0 -appVersion: "1.0.0" diff --git a/charts/ecommerce-app/templates/deployment.yaml b/charts/ecommerce-app/templates/deployment.yaml deleted file mode 100644 index 1e817f6..0000000 --- a/charts/ecommerce-app/templates/deployment.yaml +++ /dev/null @@ -1,41 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: ecommerce-app - labels: - app: ecommerce -spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - app: ecommerce - template: - metadata: - labels: - app: ecommerce - spec: - containers: - - name: ecommerce-app - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - containerPort: 8080 - envFrom: - - configMapRef: - name: ecommerce-config - - secretRef: - name: ecommerce-secret - livenessProbe: - httpGet: - path: /health - port: 8080 - initialDelaySeconds: 5 - periodSeconds: 10 - readinessProbe: - httpGet: - path: /health - port: 8080 - initialDelaySeconds: 5 - periodSeconds: 10 - resources: - {{- toYaml .Values.resources | nindent 10 }} diff --git a/charts/ecommerce-app/templates/infrastructure.yaml b/charts/ecommerce-app/templates/infrastructure.yaml deleted file mode 100644 index 184a26c..0000000 --- a/charts/ecommerce-app/templates/infrastructure.yaml +++ /dev/null @@ -1,29 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: ecommerce-app-service -spec: - type: ClusterIP - ports: - - port: 8080 - targetPort: 8080 - selector: - app: ecommerce ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: ecommerce-config -data: - DB_HOST: "db-service" - DB_PORT: "5432" - DB_NAME: "ecommerce" - DB_USER: "postgres" ---- -apiVersion: v1 -kind: Secret -metadata: - name: ecommerce-secret -type: Opaque -data: - DB_PASSWORD: "cGFzc3dvcmQ=" diff --git a/charts/ecommerce-app/values-prod.yaml b/charts/ecommerce-app/values-prod.yaml deleted file mode 100644 index 6bc803e..0000000 --- a/charts/ecommerce-app/values-prod.yaml +++ /dev/null @@ -1 +0,0 @@ -replicaCount: 3 diff --git a/charts/ecommerce-app/values.yaml b/charts/ecommerce-app/values.yaml deleted file mode 100644 index 6e866af..0000000 --- a/charts/ecommerce-app/values.yaml +++ /dev/null @@ -1,14 +0,0 @@ -replicaCount: 2 - -image: - repository: ghcr.io/ihnatkinyevhenii/ecommerce-app - tag: latest - pullPolicy: Always - -resources: - limits: - cpu: 200m - memory: 256Mi - requests: - cpu: 100m - memory: 128Mi diff --git a/tests/lab4_test.sh b/tests/lab4_test.sh deleted file mode 100644 index c9631c6..0000000 --- a/tests/lab4_test.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -set -e - -echo "--- Starting Lab 4 Grading (Helm Check) ---" - -# 1. Валідація чарта -echo "Step 1: Running helm lint..." -helm lint ./charts/ecommerce-app - -# 2. Перевірка шаблонізації для Prod -echo "Step 2: Checking Production replica count..." -REPLICAS=$(helm template ecommerce ./charts/ecommerce-app -f ./charts/ecommerce-app/values-prod.yaml | grep 'replicas: 3' | xargs) -if [ "$REPLICAS" != "replicas: 3" ]; then - echo "❌ Error: values-prod.yaml should set replicas to 3." - exit 1 -fi - -# 3. Надійне тестування рендерингу (Заміна dry-run для роботи без кластера) -echo "Step 3: Testing Dry-run installation via template engine..." -helm template ecommerce ./charts/ecommerce-app --debug > /dev/null - -echo "✅ SUCCESS: Lab 4 is passed!"