apiVersion: batch/v1 kind: Job metadata: name: redis-load-data annotations: "helm.sh/hook": post-install,post-upgrade "helm.sh/hook-weight": "1" "helm.sh/hook-delete-policy": before-hook-creation spec: template: spec: containers: - name: load-data image: redis:alpine command: - sh - -c - | # Wait for Redis to be ready until redis-cli -h redis ping | grep PONG; do echo "Waiting for Redis..."; sleep 2; done; # Load data into Redis redis-cli -h redis set compressed_catalog "$(cat /data/compressed_tree.json)" volumeMounts: - name: redis-init-data mountPath: /data volumes: - name: redis-init-data configMap: name: redis-init-data restartPolicy: OnFailure