I followed the steps in tasks 4 , 6 but it doesn't check my progress
in task 4
I used this in my query
resource.type="k8s_container"
severity=ERROR
labels."k8s-pod/app": "recommendationservice"
and create metric and policy but It didn't make sense
in task 6 :
I updated the image in helloweb-deployment.yaml and used the following commands
docker build -t us-central1-docker.pkg.dev/<YOUR_PROJECT_ID>/demo-repo/hello-app:v2 .
gcloud auth configure-docker us-central1-docker.pkg.dev
kubectl delete deployment helloweb --namespace=gmp-6er5
kubectl apply -f hello-app/manifests/helloweb-deployment.yaml --namespace=gmp-6er5
kubectl expose deployment helloweb --namespace=gmp-6er5 --name=helloweb-service-6h0c --type=LoadBalancer --port=8080 --target-port=8080
kubectl get svc helloweb-service-6h0c --namespace=gmp-6er5
Query Syntax: Ensure your query syntax is correct. It should look like this:
resource.type="k8s_container" severity=ERROR labels."k8s-pod/app"="recommendationservice"
Metric Creation: After running the query, make sure you create the metric correctly. Verify that the metric is being recorded by checking the logs.
Policy Configuration: Ensure that the alerting policy is set up correctly and is linked to the metric you created. Double-check the conditions and notification channels.
Docker Build: Ensure the Docker image is built and tagged correctly:
docker build -t us-central1-docker.pkg.dev/<YOUR_PROJECT_ID>/demo-repo/hello-app:v2 .
Docker Authentication: Make sure you have authenticated Docker with Google Cloud:
gcloud auth configure-docker us-central1-docker.pkg.dev
Deployment Update: Verify that the deployment is updated correctly:
kubectl delete deployment helloweb --namespace=gmp-6er5 kubectl apply -f hello-app/manifests/helloweb-deployment.yaml --namespace=gmp-6er5
Service Exposure: Ensure the service is exposed correctly:
kubectl expose deployment helloweb --namespace=gmp-6er5 --name=helloweb-service-6h0c --type=LoadBalancer --port=8080 --target-port=8080
Service Verification: Check the service status:
kubectl get svc helloweb-service-6h0c --namespace=gmp-6er5
Hello,
regarding the metric, please try instructions below. For the deployment, are you perhaps missing the push of the image to artifact history if you are deploying from there?
---- metric example
1. Go to log base metric
2. Click Create Metric.
3. Use the following details to configure your metric:
Metric type: Counter
Log Metric Name : pod-image-errors
4. Enable Show query and in the Query builder box, add the following query:
resource.type="k8s_pod"
severity=WARNING
---- deployment
gcloud auth configure-docker $REGION-docker.pkg.dev --quiet
docker build -t $REGION-docker.pkg.dev/$PROJECT_ID/$REPO_NAME/hello-app:v2 .
docker push $REGION-docker.pkg.dev/$PROJECT_ID/$REPO_NAME/hello-app:v2
kubectl set image deployment/helloweb -n $NAMESPACE hello-app=$REGION-docker.pkg.dev/$PROJECT_ID/$REPO_NAME/hello-app:v2
kubectl expose deployment helloweb -n $NAMESPACE --name=$SERVICE_NAME --type=LoadBalancer --port 8080 --target-port 8080
I tried those steps but it didn't make sense and I had only one chance
User | Count |
---|---|
32 | |
17 | |
5 | |
2 | |
1 |