From deeadfcf55299eaffa2048b6afe8cbccaaecd290 Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Tue, 1 Aug 2023 19:39:30 +0200 Subject: It appears K3s comes with its own HelmController --- playbook.bash | 41 ----------------------------------------- 1 file changed, 41 deletions(-) (limited to 'playbook.bash') diff --git a/playbook.bash b/playbook.bash index f9ed88d..2d150d1 100644 --- a/playbook.bash +++ b/playbook.bash @@ -35,7 +35,6 @@ playbook_add() { notice "$BASHTARD_PLAYBOOK" "Creating data directories" mkdir -pv -- "$(playbook_path "data")/manifests.d" - mkdir -pv -- "$(playbook_path "data")/helm.d" notice "$BASHTARD_PLAYBOOK" "Waiting for node to become available" { grep -q -m 1 "${BASHTARD_PLATFORM[fqdn]}[[:space:]]\+Ready"; kill $!; } < <(k3s kubectl get node -w) @@ -45,7 +44,6 @@ playbook_add() { playbook_sync() { local data - local helm_cmd local kubeconfig local manifest_prefix local values @@ -56,45 +54,6 @@ playbook_sync() { notice "$BASHTARD_PLAYBOOK/manifests" "Applying manifests.d" kubectl --kubeconfig "$kubeconfig" apply --recursive --filename "$data/manifests.d/$manifest_prefix" - - notice "$BASHTARD_PLAYBOOK/helm" "Ensure all Helm repos exist" - while read -r repo - do - helm repo add "$repo" "$(config "$BASHTARD_PLAYBOOK.helm.repos.$repo.url")" - done < <(config_subkeys "$BASHTARD_PLAYBOOK.helm.repos") - - notice "$BASHTARD_PLAYBOOK/helm" "Updating Helm repository contents" - helm repo update - - notice "$BASHTARD_PLAYBOOK/helm" "Upgrading Helm charts" - while read -r app - do - helm_cmd=( - "helm" "upgrade" - "--install" - "--kubeconfig" "$kubeconfig" - "--timeout" "$(config "$BASHTARD_PLAYBOOK.helm.timeout" "30s")" - "--namespace" "$(config "$BASHTARD_PLAYBOOK.helm.apps.$app.namespace" "default")" - ) - - # Add values - values="$(config "$BASHTARD_PLAYBOOK.helm.apps.$app.values" "")" - - if [[ -n "$values" ]] - then - helm_cmd+=("--values" "$data/helm.d/$values") - fi - - # Set which chart to upgrade - helm_cmd+=("$app") - helm_cmd+=("$(config "$BASHTARD_PLAYBOOK.helm.apps.$app.chart")") - - notice "$BASHTARD_PLAYBOOK/helm/$app" "> ${helm_cmd[*]}" - ${helm_cmd[@]} > /dev/null - - unset helm_cmd - unset values - done < <(config_subkeys "$BASHTARD_PLAYBOOK.helm.apps") } playbook_del() { -- cgit v1.1