This is a Bare minimum implementation to setup and scale an app based on custom Metric being Written in MyBean.java
For further reference, please consider the following sections:
- Official Gradle documentation
- Spring Boot Gradle Plugin Reference Guide
- Create an OCI image
- Prometheus
- Spring Boot Actuator
The following guides illustrate how to use some features concretely:
gcloud beta container --project "{GCP_PROJECT_ID}" clusters create "cluster-1" --no-enable-basic-auth --cluster-version "1.25.12-gke.500" --release-channel "None" --machine-type "e2-small" --image-type "COS_CONTAINERD" --disk-type "pd-balanced" --disk-size "100" --metadata disable-legacy-endpoints=true --scopes "https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/logging.write","https://www.googleapis.com/auth/monitoring","https://www.googleapis.com/auth/servicecontrol","https://www.googleapis.com/auth/service.management.readonly","https://www.googleapis.com/auth/trace.append" --num-nodes "2" --logging=SYSTEM,WORKLOAD --monitoring=SYSTEM --enable-ip-alias --network "projects/{GCP_PROJECT_ID}/global/networks/default" --subnetwork "projects/{GCP_PROJECT_ID}/regions/europe-west1/subnetworks/default" --no-enable-intra-node-visibility --default-max-pods-per-node "110" --security-posture=disabled --workload-vulnerability-scanning=disabled --no-enable-master-authorized-networks --addons HorizontalPodAutoscaling,HttpLoadBalancing,GcePersistentDiskCsiDriver --enable-autoupgrade --enable-autorepair --max-surge-upgrade 1 --max-unavailable-upgrade 0 --binauthz-evaluation-mode=DISABLED --no-enable-managed-prometheus --enable-shielded-nodes --region "europe-west1-c"
To authenticate to GCR use
gcloud auth configure-docker
Deploy Stackdriver Adapter
kubectl apply -f https://raw.githubusercontent.com/GoogleCloudPlatform/k8s-stackdriver/master/custom-metrics-stackdriver-adapter/deploy/production/adapter_new_resource_model.yaml
Build image with correct GCP_PROJECT_ID
gradle jib --image=gcr.io/GCP_PROJECT_ID/micrometer
Connect to GKE and then Deploy the chart
helm upgrade --install metric-test micrometer-test/ --set PROJECT_ID={GCP_PROJECT_ID}
These additional references should also help you:
sha256:6937c0a9b2035d7ab4fee817703241161af149578c4ad685a9745070a92901f5
Identify why Kind External is needed.