Open MurzNN opened 9 months ago
Here is an example of three Kubernetes config files (obfuscated), that I need to combine into one:
config_cluster1
:
apiVersion: v1
kind: Config
clusters:
- name: dgk-metal
cluster:
server: https://cp.k.somecluster.com:6443
certificate-authority-data: >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUMvakNDQWVhZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJeU1ETXdNVEV3TURFeU5
insecure-skip-tls-verify: false
- name: dgk-y
cluster:
server: https://anothercluster.com:6443
certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURCVENDQWUyZ0F3SUJBZ0lJTE1TVTNBaWlMVGN3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp
insecure-skip-tls-verify: false
users:
- name: admin-dgk-m
user:
client-certificate-data: >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURJVENDQWdtZ0F3SUJBZ0lJVUY5ZnpSa1A5dEV3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TWpBek1
client-key-data: >-
LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFb3dJQkFBS0NBUUVBcXFaK3ZCbENaNEF2RWJueGFybDZvL2h4dlQ0VlhCQnlNd2xQSmdjY0o4L2YvdVlpClFqbjhocVdTRjJTSXhHT2RzeE1EbWZCb3p
- name: admin-dgk-y
user:
client-certificate-data: >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURJVENDQWdtZ0F3SUJBZ0lJWHN6VzhnUGYxOUl3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TVRFeE1
client-key-data: >-
LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFcEFJQkFBS0NBUUVBeCsxM1o1b2xNc2Z6RmJBdXRUbGFRM1ZrZ24ya3NJc0piSVRQMCtERFFxeUhjZVRsCmVNN2Jxb2paaEE4d2RhSTRBNGZuZjhEbGN
contexts: []
preferences: {}
current-context: admin@dgk-metal
config_cluster2
:
apiVersion: v1
kind: Config
clusters:
- name: kubernetes
cluster:
server: https://cluster1:6443
certificate-authority-data: >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM1ekNDQWMrZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJeE1EY3lNakUyTlRNeU9
insecure-skip-tls-verify: false
users:
- name: kubernetes-admin
user:
client-certificate-data: >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURJVENDQWdtZ0F3SUJBZ0lJS2MyS0NDREVYQXd3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TVRBM01
client-key-data: >-
LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFcEFJQkFBS0NBUUVBd0YySVJnNUJITmZDTE9ERjBkWmc4TnBPQndIbjVZNnFuZzQ2RzdXTjdYNGFPL1ZYCnhIamRYMTg2TzZzMTJyWFNDYU1JUDloOWN
contexts: []
preferences: {}
current-context: kubernetes-admin@kubernetes
config_cluster3
:
apiVersion: v1
kind: Config
clusters:
- name: cluster.local
cluster:
server: https://1.2.3.4:6443
certificate-authority-data: >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUMvakNDQWVhZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJeU1EVXlNekUxTURZek1
insecure-skip-tls-verify: false
users:
- name: kubernetes-admin
user:
client-certificate-data: >-
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURJVENDQWdtZ0F3SUJBZ0lJRTdPa1BRaTRLOWd3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TWpBMU1
client-key-data: >-
LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFb3dJQkFBS0NBUUVBc0dRU0hEemJpNlROaWd4aFo3aGQ2a1NsTDRSRUxMV3VqQ2gzenpwVGkyUlRWUkpxCkVLVlpLTFN2UFhsRkxIYnVqbXRBTjBKdU5
contexts: []
preferences: {}
current-context: kubernetes-admin@cluster.local
And there is no fun to make this manually in a text editor!
FYI you can use the terminal feature within Lens if you need to be able to communicate with the cluster directly using kubectl
.
Other than that, thanks for the feature request.
This is the closest tool that I can find Not GUI, though https://github.com/sunny0826/kubecm
After some weeks, I just created this toy project in my spare time https://github.com/azlkiniue/conffusion This tool can be used as a GUI editor for merging kubeconfig files
What would you like to be added: An integrated editor for Kubernetes config files (
admin.conf
) with UI to automate merging, renaming, and other routine operationsWhy is this needed: Kubernetes can generate separate config files for each cluster.
Yes, there are just regular YAML text files, that can be edited in any text editor. But when it comes to managing multiple clusters or multiple accounts, it's not a lot of fun to merge such files manually in a regular text editor!
I know that in Lens we can use different config files per cluster and there is no need to merge them into one file, but not all operations are done in Lens, we still have CLI and many other tools that work with a single KUBECONFIG file and different contexts in it.
So, will be great to provide some UI that automates these operations:
I tried to search such tools, that could help automate these boring operations, but nothing was found. If you know something for this - please share!
So, please consider this and maybe integrate this editor into Lens, or publish it as a separate tool? Thanks!
Environment you are Lens application on: