run 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/command/with-contenv /bin/bash
  2. # shellcheck shell=bash
  3. # shellcheck disable=SC1091,SC1090
  4. SCRIPT_ROOT=/etc/s6-overlay/scripts
  5. source "$SCRIPT_ROOT/base.sh"
  6. source "$GPUSTACK_GATEWAY_CONFIG"
  7. source "$SCRIPT_ROOT/default-variables.sh"
  8. export JWT_POLICY="none"
  9. export CA_ROOT_CA="/etc/certs/root-cert.pem"
  10. export XDS_ROOT_CA="/etc/certs/root-cert.pem"
  11. export PROV_CERT="/etc/certs"
  12. export PILOT_XDS_SEND_TIMEOUT="60s"
  13. export PROXY_XDS_VIA_AGENT="true"
  14. export ENABLE_INGRESS_GATEWAY_SDS="false"
  15. export POD_NAME="higress-gateway"
  16. export POD_NAMESPACE="higress-system"
  17. export ISTIO_META_CLUSTER_ID="Kubernetes"
  18. export ISTIO_META_HTTP10="1"
  19. export INSTANCE_NAME="higress-gateway"
  20. export PROXY_XDS_DEBUG_VIA_AGENT="false"
  21. set -e
  22. exec 2>&1
  23. createDir /etc/istio/proxy
  24. createDir "${ISTIO_DATA_DIR}"
  25. if [ -e /var/lib/istio/data ] || [ -L /var/lib/istio/data ]; then
  26. rm -rf /var/lib/istio/data
  27. fi
  28. ln -s "${ISTIO_DATA_DIR}" /var/lib/istio/data
  29. ACCESS_LOG_PATH="${HIGRESS_LOG_DIR}/access.log"
  30. createDir "${HIGRESS_LOG_DIR}"
  31. touch "${ACCESS_LOG_PATH}"
  32. sed -i -E "s;^accessLogFile: .+$;accessLogFile: ${ACCESS_LOG_PATH};" /etc/istio/config/mesh
  33. sed -i "1s;.*;${ACCESS_LOG_PATH};" /etc/logrotate.d/higress-logrotate
  34. # copied from higress-proxy-start.sh
  35. if [ -n "$LITE_METRICS" ]; then
  36. cp /var/lib/istio/envoy/envoy_bootstrap_lite_tmpl.json /var/lib/istio/envoy/envoy_bootstrap_tmpl.json
  37. fi
  38. # end copied
  39. readinessCheck "GPUStack API server" "$GPUSTACK_API_PORT"
  40. cd /
  41. exec /usr/local/bin/pilot-agent proxy router \
  42. --concurrency="${GATEWAY_CONCURRENCY}" \
  43. --domain=higress-system.svc.cluster.local \
  44. --proxyLogLevel=warning \
  45. --proxyComponentLogLevel=misc:error \
  46. --log_output_level=all:info \
  47. --serviceCluster=higress-gateway