Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions charts/substrate/templates/rustfs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ kind: Job
metadata:
name: {{ include "substrate.fullname" (list "rustfs-bucket-init" .) }}
namespace: {{ .Release.Namespace }}
annotations:
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
spec:
backoffLimit: 10
template:
Expand Down
12 changes: 12 additions & 0 deletions charts/substrate/tests/control_plane_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,15 @@ tests:
value:
- protocol: TCP
port: api
- it: removes the bucket initialization job after it succeeds
template: rustfs.yaml
documentSelector:
path: kind
value: Job
asserts:
- equal:
path: metadata.annotations["helm.sh/hook"]
value: post-install,post-upgrade
- equal:
path: metadata.annotations["helm.sh/hook-delete-policy"]
value: before-hook-creation,hook-succeeded
1 change: 0 additions & 1 deletion hack/install-microvm-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ fi
# in-cluster rustfs (S3 API) on kind, or the GCS bucket on GKE.
if [[ "${ATE_INSTALL_KIND}" == "true" ]]; then
log "Staging assets to in-cluster rustfs bucket ${BUCKET_NAME} (kata-assets/)..."
run_kubectl wait --for=condition=complete job/rustfs-bucket-init -n ate-system --timeout=120s
OUT="${OUT}" BUCKET="${BUCKET_NAME}" KUBECTL_CONTEXT="${KUBECTL_CONTEXT}" hack/microvm-assets/stage-to-rustfs.sh
else
log "Uploading assets to gs://${BUCKET_NAME}/kata-assets/ ..."
Expand Down
6 changes: 5 additions & 1 deletion hack/microvm-assets/stage-to-rustfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ done
# rustfs must be serving and the bucket must exist before anything is uploaded.
echo ">> Waiting for rustfs in namespace ${NAMESPACE}..."
run_kubectl rollout status deploy/rustfs --timeout=300s
run_kubectl wait --for=condition=Complete job/rustfs-bucket-init --timeout=300s
# Helm removes the initialization Job after its hook succeeds, while plain
# kubectl installs retain it. Wait for the Job only when it is still present.
if run_kubectl get job/rustfs-bucket-init >/dev/null 2>&1; then
run_kubectl wait --for=condition=Complete job/rustfs-bucket-init --timeout=300s
fi

NODE="$("${ROOT}/hack/kind.sh" get nodes --name "${KIND_CLUSTER_NAME}" | head -n1)"
if [[ -z "${NODE}" ]]; then
Expand Down
3 changes: 3 additions & 0 deletions manifests/ate-install/rustfs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ kind: Job
metadata:
name: rustfs-bucket-init
namespace: ate-system
annotations:
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
spec:
backoffLimit: 10
template:
Expand Down
Loading