From 08349ef6539b60654b51c3bbe6da055ed8094e88 Mon Sep 17 00:00:00 2001 From: "Eric J. Smith" Date: Thu, 5 Dec 2024 18:03:30 -0600 Subject: [PATCH] Fix docker image using a .NET 9 preview --- Dockerfile | 4 ++-- k8s/elastic-monitor.yaml | 9 ++------- k8s/ex-prod-elasticsearch.yaml | 18 +++++++++--------- k8s/ex-prod-tasks.ps1 | 8 ++++++-- 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index e07260c69..6e1576f77 100644 --- a/Dockerfile +++ b/Dockerfile @@ -148,7 +148,7 @@ USER elasticsearch RUN wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh && \ chmod +x dotnet-install.sh && \ - ./dotnet-install.sh --channel 9.0 --quality preview --runtime aspnetcore && \ + ./dotnet-install.sh --channel 9.0 --runtime aspnetcore && \ rm dotnet-install.sh EXPOSE 8080 9200 @@ -206,7 +206,7 @@ USER elasticsearch RUN wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh && \ chmod +x dotnet-install.sh && \ - ./dotnet-install.sh --channel 9.0 --quality preview --runtime aspnetcore && \ + ./dotnet-install.sh --channel 9.0 --runtime aspnetcore && \ rm dotnet-install.sh EXPOSE 8080 9200 diff --git a/k8s/elastic-monitor.yaml b/k8s/elastic-monitor.yaml index ed041e9aa..168e486c7 100644 --- a/k8s/elastic-monitor.yaml +++ b/k8s/elastic-monitor.yaml @@ -5,15 +5,10 @@ metadata: namespace: elastic-system spec: version: 8.16.1 - podDisruptionBudget: - spec: - minAvailable: 2 - selector: - matchLabels: - elasticsearch.k8s.elastic.co/cluster-name: elastic-monitor + podDisruptionBudget: {} nodeSets: - name: main - count: 3 + count: 1 config: # if not setting max_map_count in an init container, then use this setting #node.store.allow_mmap: false diff --git a/k8s/ex-prod-elasticsearch.yaml b/k8s/ex-prod-elasticsearch.yaml index c56ef6454..319971765 100644 --- a/k8s/ex-prod-elasticsearch.yaml +++ b/k8s/ex-prod-elasticsearch.yaml @@ -6,15 +6,15 @@ metadata: spec: version: 8.16.1 image: exceptionless/elasticsearch:8.16.1 # https://github.com/exceptionless/Exceptionless/tree/main/build/docker/elasticsearch - # monitoring: - # metrics: - # elasticsearchRefs: - # - name: elastic-monitor - # namespace: elastic-system - # logs: - # elasticsearchRefs: - # - name: elastic-monitor - # namespace: elastic-system + monitoring: + metrics: + elasticsearchRefs: + - name: elastic-monitor + namespace: elastic-system + logs: + elasticsearchRefs: + - name: elastic-monitor + namespace: elastic-system secureSettings: - secretName: ex-prod-snapshots http: diff --git a/k8s/ex-prod-tasks.ps1 b/k8s/ex-prod-tasks.ps1 index 85110fb68..afcbe2ad1 100644 --- a/k8s/ex-prod-tasks.ps1 +++ b/k8s/ex-prod-tasks.ps1 @@ -2,7 +2,9 @@ $ELASTIC_PASSWORD=$(kubectl get secret --namespace ex-prod "ex-prod-es-elastic-user" -o go-template='{{.data.elastic | base64decode }}') # connect to kibana -open "http://kibana-ex-prod.localtest.me:5660" && kubectl port-forward --namespace ex-prod service/ex-prod-kb-http 5660:5601 +$ELASTIC_JOB = kubectl port-forward --namespace ex-prod service/ex-prod-kb-http 5660:5601 & +Remove-Job $ELASTIC_JOB +Start-Process "http://elastic:$ELASTIC_PASSWORD@kibana-ex-prod.localtest.me:5660" # port forward elasticsearch $ELASTIC_JOB = kubectl port-forward --namespace ex-prod service/ex-prod-es-http 9260:9200 & @@ -14,6 +16,8 @@ $ELASTIC_MONITOR_PASSWORD=$(kubectl get secret --namespace elastic-system "elast $ELASTIC_JOB = kubectl port-forward --namespace elastic-system service/elastic-monitor-es-http 9280:9200 & Remove-Job $ELASTIC_JOB +Start-Process "https://elastic:$ELASTIC_MONITOR_PASSWORD@localhost:9280" + curl -k https://elastic:$ELASTIC_MONITOR_PASSWORD@localhost:9280/_cluster/health?pretty curl -k https://elastic:$ELASTIC_MONITOR_PASSWORD@localhost:9280/_cat/allocation?v curl -k https://elastic:$ELASTIC_MONITOR_PASSWORD@localhost:9280/_cluster/allocation/explain?pretty @@ -28,7 +32,7 @@ kubectl exec --stdin --tty ex-prod-redis-node-0 -- /bin/bash -c "redis-cli -a $R # open kubernetes dashboard $DASHBOARD_PASSWORD=$(kubectl get secret --namespace kubernetes-dashboard admin-user-token-w8jg7 -o go-template='{{.data.token | base64decode }}') kubectl proxy -open "http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/" +Start-Process "http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/" # open kubecost kubectl port-forward --namespace kubecost deployment/kubecost-cost-analyzer 9090