diff --git a/.woodpecker.yml b/.woodpecker.yml index 8f9c6718..e76cb46d 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -169,6 +169,8 @@ steps: token: $K8S_TOKEN KUBEEOF - chmod 600 ~/.kube/config + # Apply manifests to ensure probes and resource limits are set + - kubectl apply -f /woodpecker/src/git.spdy.io/Creationshop/cannaiq/k8s/scraper.yaml - kubectl set image deployment/scraper scraper=registry.spdy.io/cannaiq/backend:sha-${CI_COMMIT_SHA:0:8} -n cannaiq - kubectl rollout status deployment/scraper -n cannaiq --timeout=300s - REPLICAS=$(kubectl get deployment scraper-worker -n cannaiq -o jsonpath='{.spec.replicas}'); if [ "$REPLICAS" = "0" ]; then kubectl scale deployment/scraper-worker --replicas=5 -n cannaiq; fi diff --git a/k8s/scraper.yaml b/k8s/scraper.yaml index 156d6db0..0e003108 100644 --- a/k8s/scraper.yaml +++ b/k8s/scraper.yaml @@ -1,20 +1,10 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: scraper-images-pvc - namespace: cannaiq -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 10Gi ---- apiVersion: apps/v1 kind: Deployment metadata: name: scraper namespace: cannaiq + labels: + app: scraper spec: replicas: 1 selector: @@ -25,27 +15,22 @@ spec: labels: app: scraper spec: - serviceAccountName: scraper-sa imagePullSecrets: - - name: regcred + - name: gitea-registry containers: - name: scraper - image: git.spdy.io/creationshop/cannaiq:latest + image: registry.spdy.io/cannaiq/backend:latest + imagePullPolicy: Always ports: - - containerPort: 3010 + - containerPort: 3000 envFrom: - configMapRef: - name: scraper-config - - secretRef: - name: scraper-secrets - volumeMounts: - - name: images-storage - mountPath: /app/public/images + name: cannaiq-config # Liveness probe: restarts pod if it becomes unresponsive livenessProbe: httpGet: path: /health - port: 3010 + port: 3000 initialDelaySeconds: 30 periodSeconds: 30 timeoutSeconds: 10 @@ -54,7 +39,7 @@ spec: readinessProbe: httpGet: path: /health - port: 3010 + port: 3000 initialDelaySeconds: 10 periodSeconds: 10 timeoutSeconds: 5 @@ -64,9 +49,5 @@ spec: memory: "512Mi" cpu: "250m" limits: - memory: "1Gi" + memory: "2Gi" cpu: "1000m" - volumes: - - name: images-storage - persistentVolumeClaim: - claimName: scraper-images-pvc