coreos / tectonic-forum

Apache License 2.0
30 stars 9 forks source link

kubectl-config should assign unique names for users and contexts #210

Open mluedke opened 6 years ago

mluedke commented 6 years ago

Tectonic Version

1.7.5 and earlier

Environment

AWS and Bare Metal

Expected Behavior

The downloaded kubectl-config should be easily merge-able for folks who work on multiple different clusters.

Actual Behavior

The downloaded kubectl-config specifies a unique name for cluster, however the name of the user is always tectonic-oidc and the name of the context is always tectonic. This makes it difficult to merge configs together as the user and context conflict.

Reproduction Steps

  1. Log into the tectonic console
  2. Under the "My Account" menu item, click "Download Configuration" and follow the steps.
  3. The resulting file contains static values for context and user name:
    contexts:
    - context:
      cluster: <redacted>
      user: tectonic-oidc
    name: tectonic
    users:
    - name: tectonic-oidc
    user:
    auth-provider:
      config:
        client-id: tectonic-kubectl
        client-secret: <redacted>
        id-token: <redacted>
        idp-certificate-authority-data: <redacted>
        idp-issuer-url: <redacted>
        refresh-token: <redacted>
        extra-scopes: groups
      name: oidc

Desired Feature

Please make context name and user name unique, perhaps incorporating the cluster name.

kbrwn commented 6 years ago

@rithujohn191 may have some thoughts on this.

mluedke commented 6 years ago

It would also be nice if the filename it produced was unique. We store each of these in a directory and the filename is appended to the KUBECONFIG environment variable for easy merging.

https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/#append-homekubeconfig-to-your-kubeconfig-environment-variable