Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: move installation of crds to bootstrap script #1825

Merged
merged 1 commit into from
Mar 12, 2025
Merged
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
27 changes: 26 additions & 1 deletion scripts/bootstrap-apps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function wait_for_nodes() {
done
}

# The application namespaces are created before applying the resources
# Namespaces to be applied before the SOPS secrets are installed
function apply_namespaces() {
log debug "Applying namespaces"

Expand Down Expand Up @@ -84,6 +84,30 @@ function apply_sops_secrets() {
done
}

# CRDs to be applied before the helmfile charts are installed
function apply_crds() {
log debug "Applying CRDs"

local -r crds=(
# renovate: datasource=github-releases depName=kubernetes-sigs/gateway-api
https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.1/experimental-install.yaml
# renovate: datasource=github-releases depName=prometheus-operator/prometheus-operator
https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.81.0/stripped-down-crds.yaml
)

for crd in "${crds[@]}"; do
if kubectl diff --filename "${crd}" &>/dev/null; then
log info "CRDs are up-to-date" "crd=${crd}"
continue
fi
if kubectl apply --server-side --filename "${crd}" &>/dev/null; then
log info "CRDs applied" "crd=${crd}"
else
log error "Failed to apply CRDs" "crd=${crd}"
fi
done
}

# Apply Helm releases using helmfile
function apply_helm_releases() {
log debug "Applying Helm releases with helmfile"
Expand All @@ -108,6 +132,7 @@ function main() {
wait_for_nodes
apply_namespaces
apply_sops_secrets
apply_crds
apply_helm_releases

log info "Congrats! The cluster is bootstrapped and Flux is syncing the Git repository"
Expand Down
5 changes: 0 additions & 5 deletions templates/config/talos/patches/controller/cluster.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,3 @@ cluster:
scheduler:
extraArgs:
bind-address: 0.0.0.0
extraManifests:
- # renovate: datasource=github-releases depName=kubernetes-sigs/gateway-api
https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.1/standard-install.yaml
- # renovate: datasource=github-releases depName=prometheus-operator/prometheus-operator
https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.80.1/stripped-down-crds.yaml
Loading