feat: remove installation scripts for CoreDNS, ExternalDNS, Headlamp, MetalLB, and NVIDIA Device Plugin; update manifests for deployment configurations
This commit is contained in:
@@ -1,50 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [ -z "${WILD_INSTANCE}" ]; then
|
||||
echo "ERROR: WILD_INSTANCE is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${WILD_API_DATA_DIR}" ]; then
|
||||
echo "ERROR: WILD_API_DATA_DIR is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${KUBECONFIG}" ]; then
|
||||
echo "ERROR: KUBECONFIG is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
INSTANCE_DIR="${WILD_API_DATA_DIR}/instances/${WILD_INSTANCE}"
|
||||
COREDNS_DIR="${INSTANCE_DIR}/apps/coredns"
|
||||
|
||||
echo "=== Setting up CoreDNS ==="
|
||||
echo ""
|
||||
|
||||
echo "Using pre-compiled CoreDNS templates..."
|
||||
if [ ! -f "${COREDNS_DIR}/kustomization.yaml" ]; then
|
||||
echo "ERROR: Compiled templates not found at ${COREDNS_DIR}"
|
||||
echo "Templates should be compiled before deployment."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Applying CoreDNS custom override configuration..."
|
||||
kubectl apply -k "${COREDNS_DIR}/"
|
||||
|
||||
echo "Restarting CoreDNS pods to apply changes..."
|
||||
kubectl rollout restart deployment/coredns -n kube-system
|
||||
echo "Waiting for CoreDNS rollout to complete..."
|
||||
kubectl rollout status deployment/coredns -n kube-system
|
||||
|
||||
echo ""
|
||||
echo "CoreDNS configured successfully"
|
||||
echo ""
|
||||
echo "To verify the installation:"
|
||||
echo " kubectl get pods -n kube-system -l k8s-app=kube-dns"
|
||||
echo " kubectl get svc -n kube-system coredns"
|
||||
echo " kubectl describe svc -n kube-system coredns"
|
||||
echo ""
|
||||
echo "To view CoreDNS logs:"
|
||||
echo " kubectl logs -n kube-system -l k8s-app=kube-dns -f"
|
||||
@@ -10,3 +10,8 @@ defaultConfig:
|
||||
internalDomain: "{{ .cloud.internalDomain }}"
|
||||
loadBalancerIp: "{{ .apps.metallb.loadBalancerIp }}"
|
||||
externalResolver: "8.8.8.8"
|
||||
deploy:
|
||||
restartDeployments:
|
||||
- coredns
|
||||
waitForRollout:
|
||||
name: coredns
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [ -z "${WILD_INSTANCE}" ]; then
|
||||
echo "ERROR: WILD_INSTANCE is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${WILD_API_DATA_DIR}" ]; then
|
||||
echo "ERROR: WILD_API_DATA_DIR is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${KUBECONFIG}" ]; then
|
||||
echo "ERROR: KUBECONFIG is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
INSTANCE_DIR="${WILD_API_DATA_DIR}/instances/${WILD_INSTANCE}"
|
||||
EXTERNALDNS_DIR="${INSTANCE_DIR}/apps/externaldns"
|
||||
|
||||
echo "=== Setting up ExternalDNS ==="
|
||||
echo ""
|
||||
|
||||
echo "Verifying cert-manager is ready (required for ExternalDNS)..."
|
||||
kubectl wait --for=condition=Available deployment/cert-manager -n cert-manager --timeout=60s 2>/dev/null && \
|
||||
kubectl wait --for=condition=Available deployment/cert-manager-webhook -n cert-manager --timeout=60s 2>/dev/null || {
|
||||
echo "cert-manager not ready, but continuing with ExternalDNS installation"
|
||||
echo "Note: ExternalDNS may not work properly without cert-manager"
|
||||
}
|
||||
|
||||
echo "Using pre-compiled ExternalDNS templates..."
|
||||
if [ ! -f "${EXTERNALDNS_DIR}/kustomization.yaml" ]; then
|
||||
echo "ERROR: Compiled templates not found at ${EXTERNALDNS_DIR}"
|
||||
echo "Templates should be compiled before deployment."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Deploying ExternalDNS..."
|
||||
kubectl apply -k ${EXTERNALDNS_DIR}/
|
||||
|
||||
echo "Creating Cloudflare API token secret..."
|
||||
SECRETS_FILE="${WILD_API_DATA_DIR}/instances/${WILD_INSTANCE}/secrets.yaml"
|
||||
CLOUDFLARE_API_TOKEN=$(yq '.apps.externaldns.cert-manager\.cloudflareToken' "$SECRETS_FILE" 2>/dev/null | tr -d '"')
|
||||
|
||||
if [ -z "$CLOUDFLARE_API_TOKEN" ] || [ "$CLOUDFLARE_API_TOKEN" = "null" ]; then
|
||||
echo "ERROR: Cloudflare API token not found."
|
||||
echo "Please ensure cert-manager has been added with a cloudflareToken secret."
|
||||
exit 1
|
||||
fi
|
||||
kubectl create secret generic cloudflare-api-token \
|
||||
--namespace externaldns \
|
||||
--from-literal=api-token="${CLOUDFLARE_API_TOKEN}" \
|
||||
--dry-run=client -o yaml | kubectl apply -f -
|
||||
|
||||
echo "Waiting for Cloudflare ExternalDNS to be ready..."
|
||||
kubectl rollout status deployment/external-dns -n externaldns --timeout=60s
|
||||
|
||||
echo ""
|
||||
echo "ExternalDNS installed successfully"
|
||||
echo ""
|
||||
echo "To verify the installation:"
|
||||
echo " kubectl get pods -n externaldns"
|
||||
echo " kubectl logs -n externaldns -l app=external-dns -f"
|
||||
echo ""
|
||||
@@ -13,3 +13,11 @@ defaultSecrets:
|
||||
- key: cloudflareToken
|
||||
requiredSecrets:
|
||||
- cert-manager.cloudflareToken
|
||||
deploy:
|
||||
createSecrets:
|
||||
- name: cloudflare-api-token
|
||||
entries:
|
||||
api-token: cert-manager.cloudflareToken
|
||||
waitForRollout:
|
||||
name: external-dns
|
||||
timeout: "60s"
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [ -z "${WILD_INSTANCE}" ]; then
|
||||
echo "ERROR: WILD_INSTANCE is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${WILD_API_DATA_DIR}" ]; then
|
||||
echo "ERROR: WILD_API_DATA_DIR is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${KUBECONFIG}" ]; then
|
||||
echo "ERROR: KUBECONFIG is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
INSTANCE_DIR="${WILD_API_DATA_DIR}/instances/${WILD_INSTANCE}"
|
||||
HEADLAMP_DIR="${INSTANCE_DIR}/apps/headlamp"
|
||||
|
||||
echo "=== Setting up Headlamp ==="
|
||||
echo ""
|
||||
|
||||
echo "Using pre-compiled Headlamp templates..."
|
||||
if [ ! -f "${HEADLAMP_DIR}/kustomization.yaml" ]; then
|
||||
echo "ERROR: Compiled templates not found at ${HEADLAMP_DIR}"
|
||||
echo "Templates should be compiled before deployment."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Waiting for cert-manager certificates to be ready..."
|
||||
kubectl wait --for=condition=Ready certificate wildcard-internal-wild-cloud -n cert-manager --timeout=300s || echo "Warning: Internal wildcard certificate not ready yet"
|
||||
|
||||
NAMESPACE="headlamp"
|
||||
|
||||
echo "Copying cert-manager secrets to headlamp namespace..."
|
||||
kubectl create namespace ${NAMESPACE} --dry-run=client -o yaml | kubectl apply -f -
|
||||
|
||||
if kubectl get secret wildcard-internal-wild-cloud-tls -n cert-manager >/dev/null 2>&1; then
|
||||
kubectl get secret wildcard-internal-wild-cloud-tls -n cert-manager -o yaml | \
|
||||
sed "s/namespace: cert-manager/namespace: ${NAMESPACE}/" | \
|
||||
kubectl apply -f -
|
||||
else
|
||||
echo "Warning: wildcard-internal-wild-cloud-tls secret not yet available"
|
||||
fi
|
||||
|
||||
echo "Deploying Headlamp..."
|
||||
kubectl apply -k "${HEADLAMP_DIR}/"
|
||||
|
||||
echo "Waiting for Headlamp to be ready..."
|
||||
kubectl rollout status deployment/headlamp -n ${NAMESPACE} --timeout=120s
|
||||
|
||||
echo ""
|
||||
echo "Headlamp installed successfully"
|
||||
echo ""
|
||||
if [ -n "${INTERNAL_DOMAIN}" ]; then
|
||||
echo "Access Headlamp at: https://headlamp.${INTERNAL_DOMAIN}"
|
||||
else
|
||||
echo "Access Headlamp via the configured internal domain"
|
||||
fi
|
||||
echo ""
|
||||
@@ -9,3 +9,7 @@ requires:
|
||||
defaultConfig:
|
||||
namespace: headlamp
|
||||
internalDomain: "{{ .cloud.internalDomain }}"
|
||||
deploy:
|
||||
waitForRollout:
|
||||
name: headlamp
|
||||
timeout: "120s"
|
||||
|
||||
@@ -43,9 +43,11 @@ spec:
|
||||
port: {{ .uiPort }}
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: {{ .uiPort }}
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 5
|
||||
timeoutSeconds: 5
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [ -z "${WILD_INSTANCE}" ]; then
|
||||
echo "ERROR: WILD_INSTANCE is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${WILD_API_DATA_DIR}" ]; then
|
||||
echo "ERROR: WILD_API_DATA_DIR is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${KUBECONFIG}" ]; then
|
||||
echo "ERROR: KUBECONFIG is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
INSTANCE_DIR="${WILD_API_DATA_DIR}/instances/${WILD_INSTANCE}"
|
||||
METALLB_DIR="${INSTANCE_DIR}/apps/metallb"
|
||||
|
||||
echo "=== Setting up MetalLB ==="
|
||||
echo ""
|
||||
|
||||
echo "Using compiled MetalLB templates..."
|
||||
if [ ! -f "${METALLB_DIR}/kustomization.yaml" ]; then
|
||||
echo "ERROR: Compiled templates not found at ${METALLB_DIR}"
|
||||
echo "Templates should be compiled before deployment."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Deploying MetalLB installation..."
|
||||
kubectl apply -k ${METALLB_DIR}/installation
|
||||
|
||||
echo "Waiting for MetalLB controller to be ready..."
|
||||
kubectl wait --for=condition=Available deployment/controller -n metallb-system --timeout=60s
|
||||
echo "Extra buffer for webhook initialization..."
|
||||
sleep 10
|
||||
|
||||
echo "Applying MetalLB configuration..."
|
||||
kubectl apply -k ${METALLB_DIR}/configuration
|
||||
|
||||
echo ""
|
||||
echo "MetalLB installed and configured successfully"
|
||||
echo ""
|
||||
echo "To verify the installation:"
|
||||
echo " kubectl get pods -n metallb-system"
|
||||
echo " kubectl get ipaddresspools.metallb.io -n metallb-system"
|
||||
echo ""
|
||||
echo "MetalLB will now provide LoadBalancer IPs for your services"
|
||||
@@ -8,3 +8,10 @@ defaultConfig:
|
||||
namespace: metallb-system
|
||||
ipAddressPool: "192.168.1.240-192.168.1.250"
|
||||
loadBalancerIp: "192.168.1.240"
|
||||
deploy:
|
||||
phases:
|
||||
- path: installation
|
||||
waitFor:
|
||||
name: controller
|
||||
timeout: "60s"
|
||||
- path: configuration
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
# Ensure WILD_INSTANCE is set
|
||||
if [ -z "${WILD_INSTANCE}" ]; then
|
||||
echo "❌ ERROR: WILD_INSTANCE is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ensure WILD_API_DATA_DIR is set
|
||||
if [ -z "${WILD_API_DATA_DIR}" ]; then
|
||||
echo "❌ ERROR: WILD_API_DATA_DIR is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ensure KUBECONFIG is set
|
||||
if [ -z "${KUBECONFIG}" ]; then
|
||||
echo "❌ ERROR: KUBECONFIG is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
INSTANCE_DIR="${WILD_API_DATA_DIR}/instances/${WILD_INSTANCE}"
|
||||
NVIDIA_PLUGIN_DIR="${INSTANCE_DIR}/apps/nvidia-device-plugin"
|
||||
|
||||
echo "🎮 === Setting up NVIDIA Device Plugin ==="
|
||||
echo ""
|
||||
|
||||
# Check if we have NVIDIA GPUs in the cluster
|
||||
echo "🔍 Checking for worker nodes in the cluster..."
|
||||
|
||||
# Check if any worker nodes exist (device plugin only runs on worker nodes)
|
||||
WORKER_NODES=$(kubectl get nodes --selector='!node-role.kubernetes.io/control-plane' -o name | wc -l)
|
||||
if [ "$WORKER_NODES" -eq 0 ]; then
|
||||
echo "❌ ERROR: No worker nodes found in cluster. NVIDIA Device Plugin requires worker nodes."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Found $WORKER_NODES worker node(s)"
|
||||
echo ""
|
||||
|
||||
# Templates should already be compiled
|
||||
echo "📦 Using pre-compiled NVIDIA Device Plugin templates..."
|
||||
if [ ! -f "${NVIDIA_PLUGIN_DIR}/kustomization.yaml" ]; then
|
||||
echo "❌ ERROR: Compiled templates not found at ${NVIDIA_PLUGIN_DIR}/kustomization.yaml"
|
||||
echo "Templates should be compiled before deployment."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "🚀 Deploying NVIDIA Device Plugin..."
|
||||
kubectl apply -k ${NVIDIA_PLUGIN_DIR}/
|
||||
|
||||
echo "⏳ Waiting for NVIDIA Device Plugin DaemonSet to be ready..."
|
||||
kubectl rollout status daemonset/nvidia-device-plugin-daemonset -n kube-system --timeout=120s
|
||||
|
||||
echo ""
|
||||
echo "✅ NVIDIA Device Plugin installed successfully"
|
||||
echo ""
|
||||
echo "💡 To verify the installation:"
|
||||
echo " kubectl get pods -n kube-system | grep nvidia"
|
||||
echo " kubectl get nodes -o json | jq '.items[].status.capacity | select(has(\"nvidia.com/gpu\"))'"
|
||||
echo ""
|
||||
echo "🎮 GPU nodes should now be labeled with GPU product information:"
|
||||
echo " kubectl get nodes --show-labels | grep nvidia"
|
||||
echo ""
|
||||
@@ -8,3 +8,9 @@ requires:
|
||||
- name: node-feature-discovery
|
||||
defaultConfig:
|
||||
namespace: kube-system
|
||||
deploy:
|
||||
requireWorkerNodes: true
|
||||
waitForRollout:
|
||||
kind: daemonset
|
||||
name: nvidia-device-plugin-daemonset
|
||||
timeout: "120s"
|
||||
|
||||
Reference in New Issue
Block a user