Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
Expand Down
2 changes: 1 addition & 1 deletion base-kustomize/envoyproxy-gateway/base/kustomization.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add --- to beginning of file.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
sortOptions:
order: fifo
resources:
Expand All @@ -8,4 +9,3 @@ resources:
- envoy-gateway.yaml
- envoy-endpoint-policies.yaml
- envoy-service-monitor.yaml
- all.yaml
6 changes: 6 additions & 0 deletions base-kustomize/envoyproxy-gateway/overlay/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

bases:
- ../base
75 changes: 73 additions & 2 deletions bin/install-envoy-gateway.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,51 @@
# Disable SC2124 (unused array), SC2145 (array expansion issue), SC2294 (eval)
# shellcheck disable=SC2124,SC2145,SC2294

# Function to check and install yq if not present
check_and_install_yq() {
if ! command -v yq &> /dev/null; then
echo "yq is not installed. Installing yq..."

# Detect OS and architecture
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)

# Map architecture names
case "$ARCH" in
x86_64)
ARCH="amd64"
;;
aarch64)
ARCH="arm64"
;;
esac

# Download and install yq
YQ_VERSION=$(curl -s https://api.github.com/repos/mikefarah/yq/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')
YQ_URL="https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_${OS}_${ARCH}"

if curl -sL "$YQ_URL" -o /tmp/yq; then
sudo install -o root -g root -m 0755 /tmp/yq /usr/local/bin/yq
rm /tmp/yq
echo "yq installed successfully"
else
echo "Error: Failed to download yq from $YQ_URL" >&2
exit 1
fi
fi
}

# Check for yq before proceeding
check_and_install_yq

# Service
SERVICE_NAME_DEFAULT="envoyproxy-gateway"
SERVICE_NAMESPACE="envoyproxy-gateway-system"

# Helm
# NOTE: Using OCI registry format for the chart location.
HELM_REPO_NAME_DEFAULT="gateway-helm"
# The correct chart is 'gateway' from the envoyproxy registry
HELM_REPO_NAME_DEFAULT="gateway"
HELM_REPO_URL_DEFAULT="oci://docker.io/envoyproxy"

# Base directories provided by the environment
Expand Down Expand Up @@ -76,6 +114,23 @@ echo "[DEBUG] HELM_CHART_PATH=$HELM_CHART_PATH"
# Prepare an array to collect -f arguments
overrides_args=()

# Create a temporary values file to ensure controller is deployed
TEMP_VALUES=$(mktemp)
cat > "$TEMP_VALUES" <<'EOF'
# Ensure the controller is deployed
deployment:
replicas: 1
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 1000m
memory: 1024Mi
EOF

overrides_args+=("-f" "$TEMP_VALUES")

# Include all YAML files from the BASE configuration directory
# NOTE: Files in this directory are included first.
if [[ -d "$SERVICE_BASE_OVERRIDES" ]]; then
Expand Down Expand Up @@ -135,6 +190,22 @@ echo
# Execute the command directly from the array
"${helm_command[@]}"

# Cleanup temp values file
rm -f "$TEMP_VALUES"

# Debug: Check what was actually installed
echo ""
echo "[DEBUG] Checking what was installed by helm..."
echo "Deployments in envoyproxy-gateway-system:"
kubectl get deployments -n envoyproxy-gateway-system -o wide 2>/dev/null || echo "No deployments found"
echo ""
echo "All resources in envoyproxy-gateway-system:"
kubectl get all -n envoyproxy-gateway-system 2>/dev/null || echo "No resources found"
echo ""
echo "Helm manifest (first 50 lines):"
helm get manifest envoyproxy-gateway -n envoyproxy-gateway-system 2>/dev/null | head -50 || echo "Could not get manifest"
echo ""

## Install egctl Binary (Post-Installation)

# Install egctl
Expand All @@ -143,7 +214,7 @@ if [ ! -f "/usr/local/bin/egctl" ]; then
sudo mkdir -p /opt/egctl-install
pushd /opt/egctl-install || exit 1
# Use the extracted version for wget
sudo wget "https://github.com/envoyproxy/gateway/releases/download/${SERVICE_VERSION}/egctl_${SERVICE_VERSION}_linux_amd64.tar.gz" -O egctl.tar.gz
sudo wget -nv "https://github.com/envoyproxy/gateway/releases/download/${SERVICE_VERSION}/egctl_${SERVICE_VERSION}_linux_amd64.tar.gz" -O egctl.tar.gz
sudo tar -xvf egctl.tar.gz
sudo install -o root -g root -m 0755 bin/linux/amd64/egctl /usr/local/bin/egctl
/usr/local/bin/egctl completion bash > /tmp/egctl.bash
Expand Down
Loading
Loading