Hi Team,
Good Day!!
I am new to octopus deploy ,I am trying to connect and deploy application from octopus deploy server to GCP Kubernetes cluster and as apart of this I had created the deployment target and when I was trying to run the upgrade calamary tab under connectivity for health check I am running into error mentioned below.
But the strange thing is that I can able to run the same error command in the command line successfully.
Error Info from task log
++++++++++++++
16:43:18 Verbose | Successfully authenticated with gcloud
16:43:19 Info | Creating kubectl context to GKE Cluster called gke-demo-cluster (namespace default) using a Google Cloud Account
16:43:19 Verbose | “C:\tools\gcloud\version\google-cloud-sdk\bin\gcloud.cmd” container clusters get-credentials gke-demo-cluster --zone=us-central1-c
16:43:21 Error | Fetching cluster endpoint and auth data.
16:43:21 Error | ERROR: (gcloud.container.clusters.get-credentials) ResponseError: code=403, message=Required “container.clusters.get” permission(s) for “projects/mykubernetesproject/zones/us-central1-c/clusters/gke-demo-cluster”.
16:43:21 Verbose | Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Work\20230714144316-181-2 exited with code 1
16:43:21 Verbose | Exit code: 1
16:43:21 Fatal | The remote script failed with exit code 1
16:43:21 Verbose | The remote script failed with exit code 1
| Octopus.Server.Orchestration.Targets.Tasks.ActionHandlerFailedException: The remote script failed with exit code 1
| at Octopus.Server.Orchestration.ServerTasks.Deploy.ActionDispatch.SuccessArbitrator.ThrowIfNotSuccessful(IActionHandlerResult result) in ./source/Octopus.Server/Orchestration/ServerTasks/Deploy/ActionDispatch/SuccessArbitrator.cs:line 22
| at Octopus.Server.Orchestration.ServerTasks.Deploy.ActionDispatch.AdHocActionDispatcher.Dispatch(Machine machine, ActionHandlerInvocation actionHandler, ITaskLog taskLog, CancellationToken cancellationToken, VariableCollection variables) in ./source/Octopus.Server/Orchestration/ServerTasks/Deploy/ActionDispatch/AdHocActionDispatcher.cs:line 78
| at Octopus.Server.Orchestration.ServerTasks.HealthCheck.Controllers.VirtualTargetHealthController.CheckHealth(Machine machine, ITaskLog taskLog, CancellationToken cancellationToken) in ./source/Octopus.Server/Orchestration/ServerTasks/HealthCheck/Controllers/VirtualTargetHealthController.cs:line 118
| at Octopus.Server.Orchestration.ServerTasks.HealthCheck.HealthCheckService.PerformHealthCheck(Machine machine, IHealthResultCollator healthResultCollator, CancellationToken cancellationToken, ExceptionHandling exceptionHandling, Func`3 customAction) in ./source/Octopus.Server/Orchestration/ServerTasks/HealthCheck/HealthCheckService.cs:line 86
| Octopus.Server version 2023.2.12998 (2023.2.12998)
16:43:21 Verbose | Recording health check results
|
Command line info
+++++
C:\Users\NareshUmapathy>“C:\tools\gcloud\version\google-cloud-sdk\bin\gcloud.cmd” container clusters get-credentials gke-demo-cluster --zone=us-central1-c
Fetching cluster endpoint and auth data.
kubeconfig entry generated for gke-demo-cluster.
Any help or suggestions can he helpful.
BR,
Naresh