Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-36366

Google Kubernetes Engine authentication fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.1.2
    • None
    • Kubernetes

    Description

      When connecting to a Google Kubernetes Engine, a command gcloud container clusters get-credentials is used that generates a ~/.kube/config file. The distinctive trait in this config file is that it uses an auth-provider relying on gcloud to inject the keys expiry and access-token from the general Google SDK auth config, as seen here:

      users:
      - name: gke_my-project_my-region_my-cluster
        user:
          auth-provider:
            config:
              cmd-args: config config-helper --format=json
              cmd-path: /Users/user/google-cloud-sdk/bin/gcloud
              expiry-key: '{.credential.token_expiry}'
              token-key: '{.credential.access_token}'
      

      kubectl, because it uses client-go, supports the auth-provider and fetches the token and expiry from the json returne by config-helper. As Spark is using the fabric8 client, this is yet to be supported, breaking when running spark-submit:

      Exception in thread "main" io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: POST at: https://my-endpoint/api/v1/namespaces/my-namespace/pods. Message: Forbidden! User gke_my-project_my-region_my-cluster doesn't have permission. pods is forbidden: User "system:anonymous" cannot create resource "pods" in API group "" in the namespace "my-namespace".
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            tiagovrtr Tiago Reis
            Yinan Li Yinan Li
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: