Updates service installs to not copy kustomize templates.

This commit is contained in:
2025-06-29 13:30:28 -07:00
parent ddac8775b1
commit 5579e1e3c0
19 changed files with 214 additions and 102 deletions

View File

@@ -9,9 +9,12 @@ fi
CLUSTER_SETUP_DIR="${WC_HOME}/setup/cluster"
CERT_MANAGER_DIR="${CLUSTER_SETUP_DIR}/cert-manager"
# Process templates with wild-compile-template-dir
echo "Processing cert-manager templates..."
wild-compile-template-dir --clean ${CERT_MANAGER_DIR}/kustomize.template ${CERT_MANAGER_DIR}/kustomize
# Templates should already be compiled by wild-cluster-services-generate
echo "Using pre-compiled cert-manager templates..."
if [ ! -d "${CERT_MANAGER_DIR}/kustomize" ]; then
echo "Error: Compiled templates not found. Run 'wild-cluster-services-generate' first."
exit 1
fi
echo "Setting up cert-manager..."

View File

@@ -11,18 +11,17 @@ COREDNS_DIR="${CLUSTER_SETUP_DIR}/coredns"
echo "Setting up CoreDNS for k3s..."
# Process templates with wild-compile-template-dir
echo "Processing CoreDNS templates..."
wild-compile-template-dir --clean ${COREDNS_DIR}/kustomize.template ${COREDNS_DIR}/kustomize
# Templates should already be compiled by wild-cluster-services-generate
echo "Using pre-compiled CoreDNS templates..."
if [ ! -d "${COREDNS_DIR}/kustomize" ]; then
echo "Error: Compiled templates not found. Run 'wild-cluster-services-generate' first."
exit 1
fi
# Apply the k3s-compatible custom DNS override (k3s will preserve this)
echo "Applying CoreDNS custom override configuration..."
kubectl apply -f "${COREDNS_DIR}/kustomize/coredns-custom-config.yaml"
# Apply the LoadBalancer service for external access to CoreDNS
echo "Applying CoreDNS service configuration..."
kubectl apply -f "${COREDNS_DIR}/kustomize/coredns-lb-service.yaml"
# Restart CoreDNS pods to apply the changes
echo "Restarting CoreDNS pods to apply changes..."
kubectl rollout restart deployment/coredns -n kube-system

View File

@@ -14,7 +14,7 @@ data:
reload
template IN A {
match (.*)\.{{ .cloud.internalDomain | strings.ReplaceAll "." "\\." }}\.
answer "{{`{{"{{ .Name }}"}}`}} 60 IN A {{ .cluster.loadBalancerIp }}"
answer "{{`{{ .Name }}`}} 60 IN A {{ .cluster.loadBalancerIp }}"
}
template IN AAAA {
match (.*)\.{{ .cloud.internalDomain | strings.ReplaceAll "." "\\." }}\.

View File

@@ -1,23 +0,0 @@
---
apiVersion: v1
kind: Service
metadata:
name: coredns-lb
namespace: kube-system
spec:
type: LoadBalancer
ports:
- name: dns
port: 53
protocol: UDP
targetPort: 53
- name: dns-tcp
port: 53
protocol: TCP
targetPort: 53
- name: metrics
port: 9153
protocol: TCP
targetPort: 9153
selector:
k8s-app: kube-dns

View File

@@ -11,9 +11,12 @@ DOCKER_REGISTRY_DIR="${CLUSTER_SETUP_DIR}/docker-registry"
echo "Setting up Docker Registry..."
# Process templates with wild-compile-template-dir
echo "Processing Docker Registry templates..."
wild-compile-template-dir --clean ${DOCKER_REGISTRY_DIR}/kustomize.template ${DOCKER_REGISTRY_DIR}/kustomize
# Templates should already be compiled by wild-cluster-services-generate
echo "Using pre-compiled Docker Registry templates..."
if [ ! -d "${DOCKER_REGISTRY_DIR}/kustomize" ]; then
echo "Error: Compiled templates not found. Run 'wild-cluster-services-generate' first."
exit 1
fi
# Apply the docker registry manifests using kustomize
kubectl apply -k "${DOCKER_REGISTRY_DIR}/kustomize"

View File

@@ -9,9 +9,12 @@ fi
CLUSTER_SETUP_DIR="${WC_HOME}/setup/cluster"
EXTERNALDNS_DIR="${CLUSTER_SETUP_DIR}/externaldns"
# Process templates with wild-compile-template-dir
echo "Processing ExternalDNS templates..."
wild-compile-template-dir --clean ${EXTERNALDNS_DIR}/kustomize.template ${EXTERNALDNS_DIR}/kustomize
# Templates should already be compiled by wild-cluster-services-generate
echo "Using pre-compiled ExternalDNS templates..."
if [ ! -d "${EXTERNALDNS_DIR}/kustomize" ]; then
echo "Error: Compiled templates not found. Run 'wild-cluster-services-generate' first."
exit 1
fi
echo "Setting up ExternalDNS..."

View File

@@ -11,9 +11,12 @@ KUBERNETES_DASHBOARD_DIR="${CLUSTER_SETUP_DIR}/kubernetes-dashboard"
echo "Setting up Kubernetes Dashboard..."
# Process templates with wild-compile-template-dir
echo "Processing Dashboard templates..."
wild-compile-template-dir --clean ${KUBERNETES_DASHBOARD_DIR}/kustomize.template ${KUBERNETES_DASHBOARD_DIR}/kustomize
# Templates should already be compiled by wild-cluster-services-generate
echo "Using pre-compiled Dashboard templates..."
if [ ! -d "${KUBERNETES_DASHBOARD_DIR}/kustomize" ]; then
echo "Error: Compiled templates not found. Run 'wild-cluster-services-generate' first."
exit 1
fi
NAMESPACE="kubernetes-dashboard"

View File

@@ -11,9 +11,12 @@ LONGHORN_DIR="${CLUSTER_SETUP_DIR}/longhorn"
echo "Setting up Longhorn..."
# Process templates with wild-compile-template-dir
echo "Processing Longhorn templates..."
wild-compile-template-dir --clean ${LONGHORN_DIR}/kustomize.template ${LONGHORN_DIR}/kustomize
# Templates should already be compiled by wild-cluster-services-generate
echo "Using pre-compiled Longhorn templates..."
if [ ! -d "${LONGHORN_DIR}/kustomize" ]; then
echo "Error: Compiled templates not found. Run 'wild-cluster-services-generate' first."
exit 1
fi
# Apply Longhorn with kustomize to apply our customizations
kubectl apply -k ${LONGHORN_DIR}/kustomize/

View File

@@ -11,9 +11,12 @@ METALLB_DIR="${CLUSTER_SETUP_DIR}/metallb"
echo "Setting up MetalLB..."
# Process templates with gomplate
echo "Processing MetalLB templates..."
wild-compile-template-dir --clean ${METALLB_DIR}/kustomize.template ${METALLB_DIR}/kustomize
# Templates should already be compiled by wild-cluster-services-generate
echo "Using pre-compiled MetalLB templates..."
if [ ! -d "${METALLB_DIR}/kustomize" ]; then
echo "Error: Compiled templates not found. Run 'wild-cluster-services-generate' first."
exit 1
fi
echo "Deploying MetalLB..."
kubectl apply -k ${METALLB_DIR}/kustomize/installation

View File

@@ -12,9 +12,12 @@ NFS_DIR="${CLUSTER_SETUP_DIR}/nfs"
echo "Registering NFS server with Kubernetes cluster..."
# Process templates with wild-compile-template-dir
echo "Processing NFS templates..."
wild-compile-template-dir --clean ${NFS_DIR}/kustomize.template ${NFS_DIR}/kustomize
# Templates should already be compiled by wild-cluster-services-generate
echo "Using pre-compiled NFS templates..."
if [ ! -d "${NFS_DIR}/kustomize" ]; then
echo "Error: Compiled templates not found. Run 'wild-cluster-services-generate' first."
exit 1
fi
# Get NFS configuration from config.yaml
NFS_HOST=$(wild-config cloud.nfs.host) || exit 1

View File

@@ -24,9 +24,12 @@ kubectl wait --for condition=established crd/gatewayclasses.gateway.networking.k
kubectl wait --for condition=established crd/ingressroutes.traefik.io --timeout=60s
kubectl wait --for condition=established crd/middlewares.traefik.io --timeout=60s
# Process templates with wild-compile-template-dir
echo "Processing Traefik templates..."
wild-compile-template-dir --clean ${TRAEFIK_DIR}/kustomize.template ${TRAEFIK_DIR}/kustomize
# Templates should already be compiled by wild-cluster-services-generate
echo "Using pre-compiled Traefik templates..."
if [ ! -d "${TRAEFIK_DIR}/kustomize" ]; then
echo "Error: Compiled templates not found. Run 'wild-cluster-services-generate' first."
exit 1
fi
# Apply Traefik using kustomize
echo "Deploying Traefik..."

View File

@@ -14,7 +14,7 @@ metadata:
app.kubernetes.io/name: traefik
spec:
type: LoadBalancer
loadBalancerIP: { { .cluster.loadBalancerIP } }
loadBalancerIP: {{ .cluster.loadBalancerIp }}
selector:
app.kubernetes.io/instance: traefik-kube-system
app.kubernetes.io/name: traefik

View File

@@ -11,9 +11,12 @@ UTILS_DIR="${CLUSTER_SETUP_DIR}/utils"
echo "Setting up cluster utilities..."
# Process templates with wild-compile-template-dir
echo "Processing utils templates..."
wild-compile-template-dir --clean ${UTILS_DIR}/kustomize.template ${UTILS_DIR}/kustomize
# Templates should already be compiled by wild-cluster-services-generate
echo "Using pre-compiled utils templates..."
if [ ! -d "${UTILS_DIR}/kustomize" ]; then
echo "Error: Compiled templates not found. Run 'wild-cluster-services-generate' first."
exit 1
fi
echo "Applying utility manifests..."
kubectl apply -f ${UTILS_DIR}/kustomize/