Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update/change gcloud action to mitigate critical warning #1875

Closed
sgibson91 opened this issue Nov 4, 2022 · 2 comments
Closed

Update/change gcloud action to mitigate critical warning #1875

sgibson91 opened this issue Nov 4, 2022 · 2 comments
Assignees

Comments

@sgibson91
Copy link
Member

Context

gcloud recently made a change regarding how it authenticates with kubectl and now requires an auth plugin. Probably all the engineering staff addressed this issue for their local installations weeks if not months ago - well we need to do the same for our CI as per the below warning message!

Screenshot 2022-11-04 at 18 44 48

According to this issue, we need to use the get-gke-credentials action instead.

Proposal

No response

Updates and actions

No response

@sgibson91
Copy link
Member Author

I think we may be getting bitten by this one now https://github.com/2i2c-org/infrastructure/actions/runs/3985267967/jobs/6832521385

1 / 1: Validating authenticator config for staging...
Activated service account credentials for: [two-eye-two-see-uk-cd-sa@two-eye-two-see-uk.iam.gserviceaccount.com]
Fetching cluster endpoint and auth data.
CRITICAL: ACTION REQUIRED: gke-gcloud-auth-plugin, which is needed for continued use of kubectl, was not found or is not executable. Install gke-gcloud-auth-plugin for use with kubectl by following https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke
kubeconfig entry generated for two-eye-two-see-uk-cluster.
Deploying hub staging...
Running helm upgrade --install --create-namespace --wait --namespace=staging staging /home/runner/work/infrastructure/infrastructure/helm-charts/basehub --values=/tmp/tmpt691nf85 --values=/home/runner/work/infrastructure/infrastructure/config/clusters/2i2c-uk/staging.values.yaml
Error: Kubernetes cluster unreachable: Get "https://35.189.65.222/version": getting credentials: exec: executable gke-gcloud-auth-plugin not found

It looks like you are trying to use a client-go credential plugin that is not installed.

To learn more about this feature, consult the documentation available at:
      https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins

Install gke-gcloud-auth-plugin for use with kubectl by following https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /home/runner/work/infrastructure/infrastructure/deployer/deployer.py:234 in  │
│ deploy                                                                       │
│                                                                              │
│   231 │   │   if hub_name:                                                   │
│   232 │   │   │   hub = next((hub for hub in hubs if hub.spec["name"] == hub │
│   233 │   │   │   print_colour(f"Deploying hub ***hub.spec['name']***...")       │
│ ❱ 234 │   │   │   hub.deploy(k, dask_gateway_version)                        │
│   235 │   │   else:                                                          │
│   236 │   │   │   for i, hub in enumerate(hubs):                             │
│   237 │   │   │   │   print_colour(                                          │
│                                                                              │
│ /home/runner/work/infrastructure/infrastructure/deployer/hub.py:242 in       │
│ deploy                                                                       │
│                                                                              │
│   239 │   │   │   # join method will fail on the PosixPath element if not tr │
│   240 │   │   │   # into a string first                                      │
│   241 │   │   │   print_colour(f"Running ***' '.join([str(c) for c in cmd])***") │
│ ❱ 242 │   │   │   subprocess.check_call(cmd)                                 │
│   243                                                                        │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.9.16/x[64](https://github.com/2i2c-org/infrastructure/actions/runs/3985267967/jobs/6832521385#step:5:65)/lib/python3.9/subprocess.py:373 in    │
│ check_call                                                                   │
│                                                                              │
│    370 │   │   cmd = kwargs.get("args")                                      │
│    371 │   │   if cmd is None:                                               │
│    372 │   │   │   cmd = popenargs[0]                                        │
│ ❱  373 │   │   raise CalledProcessError(retcode, cmd)                        │
│    374 │   return 0                                                          │
│    375                                                                       │
│    376                                                                       │
╰──────────────────────────────────────────────────────────────────────────────╯
CalledProcessError: Command '['helm', 'upgrade', '--install', 
'--create-namespace', '--wait', '--namespace=staging', 'staging', 
PosixPath('/home/runner/work/infrastructure/infrastructure/helm-charts/basehub')
, '--values=/tmp/tmpt[69](https://github.com/2i2c-org/infrastructure/actions/runs/3985267967/jobs/6832521385#step:5:70)1nf[85](https://github.com/2i2c-org/infrastructure/actions/runs/3985267967/jobs/6832521385#step:5:86)', 
'--values=/home/runner/work/infrastructure/infrastructure/config/clusters/2i2c-u
k/staging.values.yaml']' returned non-zero exit status 1.
Error: Process completed with exit code 1.

@consideRatio
Copy link
Member

consideRatio commented Jan 23, 2023

I didn't implement this using the notes, but copy pasted an implementation I had working in another workflow to increase the likeleyhood of a quick success.

According to google-github-actions/setup-gcloud#561, we need to use the get-gke-credentials action instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

2 participants