58 lines
1.6 KiB
Bash
58 lines
1.6 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
echo "Starting Cilium installation..."
|
|
|
|
# Add Cilium Helm repository
|
|
echo "Adding Cilium Helm repository..."
|
|
helm repo add cilium https://helm.cilium.io/
|
|
helm repo update
|
|
|
|
# Install Cilium
|
|
echo "Installing Cilium..."
|
|
helm upgrade --install \
|
|
cilium \
|
|
cilium/cilium \
|
|
--version 1.18.3 \
|
|
--namespace kube-system \
|
|
--create-namespace \
|
|
--values "$(dirname "$0")/values.yaml" \
|
|
--wait
|
|
|
|
# Wait for Cilium to be ready
|
|
echo "Waiting for Cilium DaemonSet to be ready..."
|
|
kubectl rollout status daemonset/cilium -n kube-system --timeout=300s
|
|
|
|
# Wait for Hubble components if enabled
|
|
echo "Waiting for Hubble components..."
|
|
kubectl rollout status deployment/hubble-relay -n kube-system --timeout=300s
|
|
kubectl rollout status deployment/hubble-ui -n kube-system --timeout=300s
|
|
|
|
# Apply post-install configurations if any exist
|
|
if [ -d "$(dirname "$0")/post-install" ]; then
|
|
echo "Applying post-install configurations..."
|
|
kubectl apply --recursive -f "$(dirname "$0")/post-install/"
|
|
fi
|
|
|
|
echo "Checking Cilium status..."
|
|
if command -v cilium &> /dev/null; then
|
|
cilium status
|
|
else
|
|
echo "Cilium CLI not found. To install:"
|
|
echo "brew install cilium-cli"
|
|
fi
|
|
|
|
echo
|
|
echo "Installation complete!"
|
|
echo
|
|
echo "To access Hubble UI:"
|
|
echo "1. Run port-forward:"
|
|
echo " kubectl port-forward -n kube-system svc/hubble-ui 12000:80"
|
|
echo "2. Visit: http://localhost:12000"
|
|
echo
|
|
echo "To verify installation:"
|
|
echo "1. Check pod status: kubectl get pods -n kube-system -l k8s-app=cilium"
|
|
echo "2. Check Hubble UI: kubectl get deployment -n kube-system hubble-ui"
|
|
echo "3. Install Cilium CLI: brew install cilium-cli"
|