# Reference shape of the kubeconfig stanza that `(=clientBin=) kube login`
# writes (or refreshes) under ~/.kube/config. The exec plugin hands
# credential issuance back to `(=clientBin=)` on every kubectl call,
# so there are no long-lived secrets in this file: the CA is public
# and short-lived X.509 certificates are minted on demand.
apiVersion: v1
kind: Config
clusters:
  - name: <proxy-cluster>
    cluster:
      server: https://<proxy-hostname>:443
      certificate-authority-data: <base64 cluster CA>
      tls-server-name: kube-almaforge-proxy-alpn.<proxy-cluster>
contexts:
  - name: <proxy-cluster>-<kube-cluster>
    context:
      cluster: <proxy-cluster>
      user: <proxy-cluster>-<kube-cluster>
      extensions:
        - name: almaforge.kube.name
          extension: <kube-cluster>
users:
  - name: <proxy-cluster>-<kube-cluster>
    user:
      exec:
        apiVersion: client.authentication.k8s.io/v1beta1
        command: (=clientBin=)
        args:
          - kube
          - credentials
          - --kube-cluster=<kube-cluster>
          - --proxy=<proxy-hostname>:443
