From edbcc14220145d9d22e67e4e3c8ab968f97e74e1 Mon Sep 17 00:00:00 2001 From: Junwei Zhao Date: Mon, 28 Apr 2025 13:29:56 +1000 Subject: [PATCH] Update terraform regarding cert-manager --- apply.sh | 6 +++--- mcp-proxy.json | 30 ++++++++++++++++++++++++++++++ terraform/argocd.tf | 26 ++++++++++++++++++-------- 3 files changed, 51 insertions(+), 11 deletions(-) create mode 100644 mcp-proxy.json diff --git a/apply.sh b/apply.sh index b664610..a5b21d3 100755 --- a/apply.sh +++ b/apply.sh @@ -45,7 +45,7 @@ helm upgrade --install \ cert-manager jetstack/cert-manager \ --namespace cert-manager \ --create-namespace \ - --version v1.6.1 \ + --version v1.17.2 \ --set prometheus.enabled=false \ --set installCRDs=true \ --set webhook.timeoutSeconds=4 @@ -312,7 +312,7 @@ helm upgrade --install redis -n db -f db/redis-values.yaml bitnami/redis sudo apt install kubeadm=1.30.11-1.1 -# passless sudo +# passless sudo echo "junv ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/junv @@ -325,4 +325,4 @@ ssh junv@192.168.1.2 -p22422 "sudo journalctl -u k3s -n 100" ssh junv@192.168.1.2 -p22422 "sudo journalctl -u k3s --since '10 minutes ago'" # View logs with timestamps: -ssh junv@192.168.1.2 -p22422 "sudo journalctl -u k3s -f -o short-precise" \ No newline at end of file +ssh junv@192.168.1.2 -p22422 "sudo journalctl -u k3s -f -o short-precise" diff --git a/mcp-proxy.json b/mcp-proxy.json new file mode 100644 index 0000000..4ff325e --- /dev/null +++ b/mcp-proxy.json @@ -0,0 +1,30 @@ +{ + "mcpProxy": { + "baseURL": "0.0.0.0", + "addr": ":9090", + "name": "MCP Proxy", + "version": "1.0.0", + "options": { + "panicIfInvalid": false, + "logEnabled": true, + "authTokens": [ + "DefaultTokens" + ] + } + }, + "mcpServers": { + "fetch": { + "command": "uvx", + "args": [ + "mcp-server-fetch" + ], + "options": { + "panicIfInvalid": true, + "logEnabled": false, + "authTokens": [ + "HelloMCP!!" + ] + } + } + } +} diff --git a/terraform/argocd.tf b/terraform/argocd.tf index 6a1556e..0744ac7 100644 --- a/terraform/argocd.tf +++ b/terraform/argocd.tf @@ -9,7 +9,7 @@ resource "helm_release" "cert_manager" { name = "cert-manager" repository = "https://charts.jetstack.io" chart = "cert-manager" - version = "v1.14.3" + version = "v1.17.2" namespace = "cert-manager" create_namespace = true @@ -17,6 +17,16 @@ resource "helm_release" "cert_manager" { name = "installCRDs" value = "true" } + + set { + name = "prometheus.enabled" + value = "false" + } + + set { + name = "webhook.timeoutSeconds" + value = "4" + } } # Install nginx-ingress @@ -72,27 +82,27 @@ resource "null_resource" "wait_for_cert_manager_crds" { command = <<-EOT # Wait for cert-manager to be ready echo "Waiting for cert-manager CRDs to be available..." - + # Wait for the webhook to be ready first echo "Waiting for cert-manager webhook pod to be ready..." kubectl -n cert-manager wait --for=condition=ready pod -l app=webhook --timeout=120s - + # Try up to 10 times with increasing sleep between attempts for i in $(seq 1 10); do echo "Attempt $i to verify cert-manager CRDs..." - + # Check if the ClusterIssuer CRD exists if kubectl get crd clusterissuers.cert-manager.io > /dev/null 2>&1; then echo "ClusterIssuer CRD found!" exit 0 fi - + # Increase wait time with each attempt sleep_time=$((i * 5)) echo "CRDs not found yet, waiting $sleep_time seconds..." sleep $sleep_time done - + # If we get here, we've failed to find the CRDs echo "Failed to find cert-manager CRDs after multiple attempts" exit 1 @@ -161,10 +171,10 @@ resource "helm_release" "argocd" { helm_release.cert_manager, helm_release.ingress_nginx ] - + # Add timeout to ensure ArgoCD has enough time to install timeout = 900 - + # Add retry logic in case of failure recreate_pods = true }