Fetches kubeconfig from qbert API
Although the kubectl config command is used to manage kubeconfigs, we have no way to pull a kubeconfig from Platform9 Managed Kubernetes’ Qbert API. This aims to solve that problem by downloading and merging clusters’ kubeconfigs with existing kubeconfig files.
It’s strongly recommended to use a python virtualenv
pip install qbertconfig
qc [-h] [-k KUBECONFIG] fetch [--name cluster_name] [--uuid cluster_uuid]
Note: The client also supports all ``--os`` cli flags provided by os-client-config
Yes, really, there are tests
pip install -r requirements.txt
nosetests -v -d tests/
Here is the basic structure of a Kubeconfig:
apiVersion: v1
kind: Config
preferences: {}
current-context: default
clusters: []
contexts: []
users: []
Each of cluster, context, or user, has a name
associated with it.
This is the unique identifier for each object, and each context uses
these names to tie it all together.
Each of these sections can be managed with the kubectl config
command. [Documentation]
This utility will fetch a fresh kubeconfig from the Qbert API, and merge it’s details into the specified kubeconfig.
With the fresh kubeconfig, the following sections are renamed to resolve common collisions when managing many PMK clouds.
user
is renamed tofqdn-username
to align with unique keystone environmentscontext
is renamed to thecluster_name
cluster
is renamed to thecluster_uuid