Skip to content

Commit ed8d885

Browse files
authored
fix: move installation of crds to bootstrap script (#1825)
Signed-off-by: Devin Buhl <devin@buhl.casa>
1 parent af158e2 commit ed8d885

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

scripts/bootstrap-apps.sh

+26-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function wait_for_nodes() {
2323
done
2424
}
2525

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

@@ -84,6 +84,30 @@ function apply_sops_secrets() {
8484
done
8585
}
8686

87+
# CRDs to be applied before the helmfile charts are installed
88+
function apply_crds() {
89+
log debug "Applying CRDs"
90+
91+
local -r crds=(
92+
# renovate: datasource=github-releases depName=kubernetes-sigs/gateway-api
93+
https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.1/experimental-install.yaml
94+
# renovate: datasource=github-releases depName=prometheus-operator/prometheus-operator
95+
https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.81.0/stripped-down-crds.yaml
96+
)
97+
98+
for crd in "${crds[@]}"; do
99+
if kubectl diff --filename "${crd}" &>/dev/null; then
100+
log info "CRDs are up-to-date" "crd=${crd}"
101+
continue
102+
fi
103+
if kubectl apply --server-side --filename "${crd}" &>/dev/null; then
104+
log info "CRDs applied" "crd=${crd}"
105+
else
106+
log error "Failed to apply CRDs" "crd=${crd}"
107+
fi
108+
done
109+
}
110+
87111
# Apply Helm releases using helmfile
88112
function apply_helm_releases() {
89113
log debug "Applying Helm releases with helmfile"
@@ -108,6 +132,7 @@ function main() {
108132
wait_for_nodes
109133
apply_namespaces
110134
apply_sops_secrets
135+
apply_crds
111136
apply_helm_releases
112137

113138
log info "Congrats! The cluster is bootstrapped and Flux is syncing the Git repository"

templates/config/talos/patches/controller/cluster.yaml.j2

-5
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,3 @@ cluster:
1919
scheduler:
2020
extraArgs:
2121
bind-address: 0.0.0.0
22-
extraManifests:
23-
- # renovate: datasource=github-releases depName=kubernetes-sigs/gateway-api
24-
https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.1/standard-install.yaml
25-
- # renovate: datasource=github-releases depName=prometheus-operator/prometheus-operator
26-
https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.80.1/stripped-down-crds.yaml

0 commit comments

Comments
 (0)