diff --git a/scripts/cilium-values.yaml b/scripts/cilium-values.yaml index f7b5d3e..0695931 100644 --- a/scripts/cilium-values.yaml +++ b/scripts/cilium-values.yaml @@ -12,6 +12,8 @@ externalIPs: hostServices: enabled: true enableIPv4Masquerade: true +hubble: + enabled: false envoy: enabled: false operator: diff --git a/scripts/gpu-k8s.sh b/scripts/gpu-k8s.sh index 23e2717..e8f3a5e 100644 --- a/scripts/gpu-k8s.sh +++ b/scripts/gpu-k8s.sh @@ -105,9 +105,15 @@ install_base() { echo "[1/8] 安装基础依赖" install_all_offline_packages || { sudo apt-get update -y - sudo apt-get install -y curl gnupg2 ca-certificates lsb-release \ - apt-transport-https software-properties-common openssh-client \ - openssh-server uidmap containerd ${NVIDIA_DRIVER_VERSION} nvidia-container-toolkit + sudo apt-get install -y curl \ + gnupg2 \ + lsb-release \ + openssh-client \ + openssh-server \ + ca-certificates \ + apt-transport-https \ + software-properties-common \ + uidmap ${NVIDIA_DRIVER_VERSION} nvidia-container-toolkit } } @@ -195,22 +201,6 @@ deploy_k8s() { deploy_plugin() { - echo "[7/8] 部署 NVIDIA Device Plugin" - local plugin_file="${OFFLINE_DIR}/nvidia-device-plugin.yml" - if [ -f "$plugin_file" ]; then - kubectl apply -f "$plugin_file" - else - plugin_url="https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin/${NVIDIA_PLUGIN_VERSION}/deployments/static/nvidia-device-plugin.yml" - if [ "$USE_PROXY" = true ]; then - HTTPS_PROXY=$PROXY_ADDR HTTP_PROXY=$PROXY_ADDR \ - kubectl apply -f "$plugin_url" - else - kubectl apply -f "$plugin_url" - fi - fi - sleep 15 - kubectl -n kube-system get pods | grep nvidia || echo "⚠️ 插件未启动" - kubectl describe node | grep -A10 Capacity | grep -i nvidia } run_test() { diff --git a/scripts/sealos-install.sh b/scripts/sealos-install.sh index 96e933c..02a46fc 100755 --- a/scripts/sealos-install.sh +++ b/scripts/sealos-install.sh @@ -1,26 +1,26 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail -# Load pre-packaged images if present -if [ -f "images/sealos-images.tar" ]; then - if command -v sealos >/dev/null 2>&1; then - sealos load -i images/sealos-images.tar || true - elif command -v docker >/dev/null 2>&1; then - docker load -i images/sealos-images.tar || true - fi -fi - +# 1) 起集群:去掉 labring/cilium,只保留 K8s + Helm,并跳过 kube-proxy sealos run labring/kubernetes:v1.29.9 \ - labring/cilium:v1.13.4 \ labring/helm:v3.9.4 \ - --masters 172.31.23.68 \ + --masters 192.168.124.77 \ --user root \ --pk /root/.ssh/id_rsa \ --env '{}' \ --cmd 'kubeadm init --skip-phases=addon/kube-proxy' -sealos add --nodes 172.31.23.69 - +# 2) 安装 Cilium:使用 Helm 指定 chart 1.18.1(稳定) helm repo add cilium https://helm.cilium.io helm repo update -helm upgrade cilium cilium/cilium -n kube-system -f cilium-values.yaml +helm upgrade --install cilium cilium/cilium \ + -n kube-system \ + --version 1.18.1 \ + -f cilium-values.yaml + +# 可选:等待就绪(方便 CI/一键脚本) +kubectl -n kube-system rollout status ds/cilium --timeout=10m || true +kubectl -n kube-system rollout status deploy/cilium-operator --timeout=5m || true + +# 查看状态 +cilium status || true