CircleCI-Public / gcp-gke-orb

Interact with Google Kubernetes Engine (GKE) from CircleCI
https://circleci.com/orbs/registry/orb/circleci/gcp-gke
MIT License
7 stars 21 forks source link

GOOGLE_COMPUTE_REGION is ignored on "update-kubeconfig-with-credentials" #47

Closed sttr-asano closed 1 year ago

sttr-asano commented 2 years ago

Orb version: 1.4.0

What happened:

Environment variable $GOOGLE_COMPUTE_REGION is ignored, and command update-kubeconfig-with-credentials fails for asia-northeast1 cluster.

e.g.

jobs:
  gke-test:
    environment:
      GOOGLE_COMPUTE_REGION: asia-northeast1
      GOOGLE_PROJECT_ID: my_project_name
    machine:
      image: ubuntu-2004:202111-01
    working_directory: ~/repo
    steps:
      - gcp-gke/update-kubeconfig-with-credentials:
          cluster: my-cluster-name
          install-kubectl: true
          perform-login: true

Expected behavior:

kubeconfig update success

Additional Information:

It succeeds by specifying region in cluster name cluster: "my-cluster-name --region=asia-northeast1"

sttr-asano commented 2 years ago

I found get-credentials succeeds with newer version of gcloud. so I want newer gcloud version bundled...

      - gcp-gke/update-kubeconfig-with-credentials:
          cluster: my-cluster-name
          install-kubectl: true
          perform-login: true
      # It fails
      - run:
           name: update kubeconfig
          command: |
            gcloud container clusters get-credentials my-cluster-name
          when: always
      # Install newer version of gcloud
      - gcp-cli/install:
          version: 371.0.0
      # It succeeds
      - run:
          name: update kubeconfig
          command: |
            gcloud container clusters get-credentials my-cluster-name
          when: always
EricRibeiro commented 1 year ago

Thanks for the heads-up, @sttr-asano!

We are changing the gcp-cli orb to accept a latest parameter and have it as default. This will always keep the gcloud CLI up to date.

This was implemented here. As soon as we finish making a few other changes, we will release a new version for both the CLI and the GKE orb.