Skip to content

[🐛 Bug]: Helm post-upgrade hook fails when recreating selenium-grid-edge-scaledobject #2196

Closed
@oranlom

Description

@oranlom

What happened?

I'm deploying selenium-grid helm chart on AKS cluster with an existing keda (helm chart version 2.12.1) installed using Azure pipelines. The helm upgrade job fails with the following error:

Error: UPGRADE FAILED: post-upgrade hooks failed: warning: Hook post-upgrade selenium-grid/templates/edge-node-hpa.yaml failed: object is being deleted: scaledobjects.keda.sh "selenium-grid-edge-scaledobject" already exists

Although after rerunning the failed job, the helm upgrade is successful. The selenium-grid-chrome-scaledobject gets deployed without any issues at the first time, with the selenium-grid-edge-scaledobject there's always this rerun needed. Is there any way how to control the post-upgrade hook deployments, to set some kind of delay on this particular hook? Maybe setting the hook-weight and changing the order of the chrome (by default is installed first) and edge scaled object deployment could solve the issue. With the current selenium-grid helm chart I'm able to set only identical annotations for both scaled objects.

Command used to start Selenium Grid with Docker (or Kubernetes)

helm upgrade --install --values deployments/selenium-grid/envs/DEV/deployment.yaml --wait --timeout 5m0s --create-namespace -n platform-test selenium-grid repo_selenium-grid/selenium-grid --version 0.25.3

deployments/selenium-grid/envs/DEV/deployment.yaml

basicAuth:
  enabled: false
ingress:
  enabled: false
autoscaling:
  enableWithExistingKEDA: true
  scalingType: deployment
  scaledOptions:
    minReplicaCount: 0
    maxReplicaCount: 8
    advanced:
      horizontalPodAutoscalerConfig:
        behavior:
          scaleDown:
            stabilizationWindowSeconds: 300
            policies:
              - type: Percent
                value: 100
                periodSeconds: 15

hub:
  serviceType: ClusterIP
  nodeSelector: { agentpool: "seleniumpool" }
  tolerations:
    - effect: NoSchedule
      key: role
      operator: Equal
      value: seleniumNode
  extraVolumeMounts:
    - name: qa-file-pv
      mountPath: /mnt/testautomation-files
    - name: selenium-kv-secrets-store-inline
      mountPath: "/mnt/secrets-store"
      readOnly: true
  extraVolumes:
    - name: qa-file-pv
      persistentVolumeClaim:
        claimName: qa-file-pvc
    - name: selenium-kv-secrets-store-inline
      csi:
        driver: secrets-store.csi.k8s.io
        readOnly: true
        volumeAttributes:
          secretProviderClass: selenium-kv-secrets-provider
  extraEnvFrom:
    - secretRef:
        name: selenium-kv-secret

# Configuration for chrome nodes
chromeNode:
  nodeSelector: { agentpool: "seleniumpool" }
  tolerations:
    - effect: NoSchedule
      key: role
      operator: Equal
      value: seleniumNode
  extraVolumeMounts:
    - name: qa-file-pv
      mountPath: /mnt/testautomation-files
    - name: selenium-kv-secrets-store-inline
      mountPath: "/mnt/secrets-store"
      readOnly: true
  extraVolumes:
    - name: qa-file-pv
      persistentVolumeClaim:
        claimName: qa-file-pvc
    - name: selenium-kv-secrets-store-inline
      csi:
        driver: secrets-store.csi.k8s.io
        readOnly: true
        volumeAttributes:
          secretProviderClass: selenium-kv-secrets-provider
  extraEnvFrom:
    - secretRef:
        name: selenium-kv-secret
  scaledObjectOptions:
    scaleTargetRef:
      name: selenium-chrome-node

# Configuration for firefox nodes
firefoxNode:
  # Enable firefox nodes
  enabled: false

# Configuration for edge nodes
edgeNode:
  nodeSelector: { agentpool: "seleniumpool" }
  tolerations:
    - effect: NoSchedule
      key: role
      operator: Equal
      value: seleniumNode
  extraVolumeMounts:
    - name: qa-file-pv
      mountPath: /mnt/testautomation-files
    - name: selenium-kv-secrets-store-inline
      mountPath: "/mnt/secrets-store"
      readOnly: true
  extraVolumes:
    - name: qa-file-pv
      persistentVolumeClaim:
        claimName: qa-file-pvc
    - name: selenium-kv-secrets-store-inline
      csi:
        driver: secrets-store.csi.k8s.io
        readOnly: true
        volumeAttributes:
          secretProviderClass: selenium-kv-secrets-provider
  extraEnvFrom:
    - secretRef:
        name: selenium-kv-secret
  scaledObjectOptions:
    scaleTargetRef:
      name: selenium-edge-node

Relevant log output

Error: UPGRADE FAILED: post-upgrade hooks failed: warning: Hook post-upgrade selenium-grid/templates/edge-node-hpa.yaml failed: object is being deleted: scaledobjects.keda.sh "selenium-grid-edge-scaledobject" already exists

Operating System

AKS 1.27.9

Docker Selenium version (image tag)

4.15.0-20231129

Selenium Grid chart version (chart version)

0.25.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions