From 93af1ed1c22f4bec86bfa717038660d5b9158c9a Mon Sep 17 00:00:00 2001 From: Dmitry Volodin Date: Fri, 7 Mar 2025 18:11:57 +0300 Subject: [PATCH] :sparkles: Add support to clusterctl for inserting workload kubeconfig into an existing kubeconfig file --- cmd/clusterctl/cmd/get_kubeconfig.go | 34 ++++++++ cmd/clusterctl/cmd/get_kubeconfig_test.go | 78 +++++++++++++++++++ .../cmd/testdata/existing-kubeconfig.yaml | 19 +++++ .../multiple-workload-kubeconfig.yaml | 31 ++++++++ .../testdata/single-workload-kubeconfig.yaml | 19 +++++ .../src/clusterctl/commands/get-kubeconfig.md | 8 +- 6 files changed, 188 insertions(+), 1 deletion(-) create mode 100644 cmd/clusterctl/cmd/get_kubeconfig_test.go create mode 100644 cmd/clusterctl/cmd/testdata/existing-kubeconfig.yaml create mode 100644 cmd/clusterctl/cmd/testdata/multiple-workload-kubeconfig.yaml create mode 100644 cmd/clusterctl/cmd/testdata/single-workload-kubeconfig.yaml diff --git a/cmd/clusterctl/cmd/get_kubeconfig.go b/cmd/clusterctl/cmd/get_kubeconfig.go index 1786ac49d205..5acc8be774e8 100644 --- a/cmd/clusterctl/cmd/get_kubeconfig.go +++ b/cmd/clusterctl/cmd/get_kubeconfig.go @@ -19,9 +19,11 @@ package cmd import ( "context" "fmt" + "os" "github.com/pkg/errors" "github.com/spf13/cobra" + "k8s.io/client-go/tools/clientcmd" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta2" "sigs.k8s.io/cluster-api/cmd/clusterctl/client" @@ -32,6 +34,7 @@ type getKubeconfigOptions struct { kubeconfig string kubeconfigContext string namespace string + intoKubeconfig string } var gk = &getKubeconfigOptions{} @@ -67,6 +70,8 @@ func init() { "Path to the kubeconfig file to use for accessing the management cluster. If unspecified, default discovery rules apply.") getKubeconfigCmd.Flags().StringVar(&gk.kubeconfigContext, "kubeconfig-context", "", "Context to be used within the kubeconfig file. If empty, current context will be used.") + getKubeconfigCmd.Flags().StringVar(&gk.intoKubeconfig, "into-kubeconfig", "", + "Path to the kubeconfig file where the resulting kubeconfig will be inserted.") // completions getKubeconfigCmd.ValidArgsFunction = resourceNameCompletionFunc( @@ -98,6 +103,35 @@ func runGetKubeconfig(workloadClusterName string) error { if err != nil { return err } + if gk.intoKubeconfig != "" { + return intoKubeconfig(gk.intoKubeconfig, out) + } + fmt.Println(out) return nil } + +func intoKubeconfig(path, kubeconfig string) error { + kubeconfigFile, err := os.CreateTemp("", "kubeconfig") + if err != nil { + return err + } + defer os.Remove(kubeconfigFile.Name()) + + if _, err = kubeconfigFile.WriteString(kubeconfig); err != nil { + return err + } + if err = kubeconfigFile.Close(); err != nil { + return err + } + + rules := &clientcmd.ClientConfigLoadingRules{ + Precedence: []string{path, kubeconfigFile.Name()}, + } + config, err := rules.Load() + if err != nil { + return err + } + + return clientcmd.WriteToFile(*config, rules.Precedence[0]) +} diff --git a/cmd/clusterctl/cmd/get_kubeconfig_test.go b/cmd/clusterctl/cmd/get_kubeconfig_test.go new file mode 100644 index 000000000000..caa6d6c561ea --- /dev/null +++ b/cmd/clusterctl/cmd/get_kubeconfig_test.go @@ -0,0 +1,78 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cmd + +import ( + _ "embed" + "os" + "path/filepath" + "testing" + + . "github.com/onsi/gomega" +) + +var ( + //go:embed testdata/existing-kubeconfig.yaml + existingKubeconfig string + + //go:embed testdata/single-workload-kubeconfig.yaml + singleWorkloadKubeconfig string + + //go:embed testdata/multiple-workload-kubeconfig.yaml + multipleWorkloadKubeconfig string +) + +func Test_intoKubeconfig(t *testing.T) { + tmpDir := t.TempDir() + + tt := []struct { + name string + path string + data string + expected string + }{ + { + name: "inserting into empty kubeconfig", + path: filepath.Join(tmpDir, "empty-kubeconfig"), + data: "", + expected: singleWorkloadKubeconfig, + }, + { + name: "inserting into existing kubeconfig", + path: filepath.Join(tmpDir, "existing-kubeconfig"), + data: existingKubeconfig, + expected: multipleWorkloadKubeconfig, + }, + } + + for _, tc := range tt { + t.Run(tc.name, func(t *testing.T) { + g := NewWithT(t) + if tc.data != "" { + err := os.WriteFile(tc.path, []byte(tc.data), 0600) + g.Expect(err).ToNot(HaveOccurred()) + } + + err := intoKubeconfig(tc.path, singleWorkloadKubeconfig) + g.Expect(err).ToNot(HaveOccurred()) + + expected, err := os.ReadFile(tc.path) + g.Expect(err).ToNot(HaveOccurred()) + g.Expect(string(expected)).To(Equal(tc.expected)) + }) + } +} diff --git a/cmd/clusterctl/cmd/testdata/existing-kubeconfig.yaml b/cmd/clusterctl/cmd/testdata/existing-kubeconfig.yaml new file mode 100644 index 000000000000..c8cac5d63a47 --- /dev/null +++ b/cmd/clusterctl/cmd/testdata/existing-kubeconfig.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +clusters: +- cluster: + certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURCVENDQWUyZ0F3SUJBZ0lJTzYyZzVmMHlsR2t3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TlRBek1UQXdOakF6TkRaYUZ3MHpOVEF6TURnd05qQTRORFphTUJVeApFekFSQmdOVkJBTVRDbXQxWW1WeWJtVjBaWE13Z2dFaU1BMEdDU3FHU0liM0RRRUJBUVVBQTRJQkR3QXdnZ0VLCkFvSUJBUURESzh6a1U1QWkxRTJIazNiM01PQko3Tko4YmVIRzlVMXQ0cWdkclpyMWZadHUrUDBHVlArejAzWWMKWWlTd0QzNitJWk04ZGkvQVV3VjduVXhFT0ZOUjh2Y1RRdkNqdktUUVlFWTI3RlZ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exts: +- context: + cluster: kind-caaph-e2e + user: kind-caaph-e2e + name: kind-caaph-e2e +current-context: kind-caaph-e2e +kind: Config +preferences: {} +users: +- name: kind-caaph-e2e + user: + client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURLVENDQWhHZ0F3SUJBZ0lJYklySmRLM1ZSRWN3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TlRBek1UQXdOakF6TkRaYUZ3MHlOakF6TVRBd05qQTRORFphTUR3eApIekFkQmdOVkJBb1RGbXQxWW1WaFpHMDZZMngxYzNSbGNpMWhaRzFwYm5NeEdUQVhCZ05WQkFNVEVHdDFZbVZ5CmJtVjBaWE10WVdSdGFXNHdnZ0VpTUEwR0NTcUdTSWIzRFFFQkFRVUFBNElCRHdBd2dnRUtBb0lCQVFDbnEyYkMKQnhxZGIwa3ZWRGRkMUpidUI0amdkL2RzMFhaQlBlOFBPRW8yRUs3SWF2ZkJiL3orYUxxWXdVKzFZZFZFR1EyZwphcXdUM0hTY0VYdlVkNHRvVFA0dUJMbGt6Q1lvUTh4UngzcGtpNlVIdnplbzFscXRJYm0vV0JjTmt0M2VZakhJCkxqSjBZV2JRNm5CaEtvRU4vRC9ySkNHbFMvbSs0eU9WN0tJU29uZXlsVkd6eldUVlRYelBkZVI1eVBTUk1ucmQKdUpOYXlSSldjaE1BQ1Y5aFppZTVoYlgyRnZDMkpzSXlROFZMMEMzY2h6ZStoMEFQc0syNWVYaU9QU1M0a1A2WQo4L0dHU2pySUJ3R2dZNHMyanpaQTJjUC9jN3RoYWxSTzhkVUtQNWl5cVV0ekluR25FbkQ3RUdveitaL3RXeGM3CmRGK1ByN3hBQkt1dE9KNExBZ01CQUFHalZqQlVNQTRHQTFVZER3RUIvd1FFQXdJRm9EQVRCZ05WSFNVRUREQUsKQmdnckJnRUZCUWNEQWpBTUJnTlZIUk1CQWY4RUFqQUFNQj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Q0S0oKZmhGTXdIbFlLcXJ0blpWWXRPRitiRjVRUXBpdTZxWHg0K1dQdTErQlQ0S29ySkxYZzQxSndobXMwV0ZmaWV4ZApKTWk4dzhpaEYvYWt6YmFEREUrY3dtK1l5NG9rSFVVMzdZWC9QbWRTYW81UlVDeTRseHFvWWdNL3ZWUnlkRWZqCnZ4bHE0WWtFbkpvamQ0T2s3am9qa0pjQ2dZQlpobTEyZ2w4aFg5d3EvWTMvb284UU5NM0QrTjMzaXpacWdGU2EKOHB0Y1ZPV3N6UkdYLzJsMm0rYTZkdzc4d0R3V3VObDBKd0NNZEdwaEpVakJwY0ljeGlEc3pUcUZrV1dtQjdsUgo3aXM1VTJaVGVBZFZBYm9YMGEwU2o2VGNFNDZLUzczL2M5NVM0STlkL0xDQnJxa20zNWV6cTFXUUliSW1qRHhkCitheFkzUUtCZ0VybjlxSnllU2FoREdtU2dkRFRJR09hSUtwODRYWE1OcU5wbTZ5dzdQbnF5dWxLSXJCM0Q2SFoKOEtMaTVIRDhTR2xVWkRkaU9RaUpYREJhSGdHbmt5MFJGNnNCbm9TaFNuSFZqaG9tNVc1YkZ1aHRjZnFDVmQ2eQpWckUyemxzMW5ZaUZ1Ylc1VW1iTjdrSldPQlVxbmsvNjR2cmUwZEhHUXd1TXh3OHUrT0U1Ci0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg== diff --git a/cmd/clusterctl/cmd/testdata/multiple-workload-kubeconfig.yaml b/cmd/clusterctl/cmd/testdata/multiple-workload-kubeconfig.yaml new file mode 100644 index 000000000000..663bfea7d3bd --- /dev/null +++ b/cmd/clusterctl/cmd/testdata/multiple-workload-kubeconfig.yaml @@ -0,0 +1,31 @@ +apiVersion: v1 +clusters: +- cluster: + certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM2akNDQWRLZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmR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QnRkMGsKMkdHQUUzMC8xRC9rYmhoQWVNdXNJVEJYWHRTZlM2ZjJHMFVjWFcvWGNLbjNCUVZCSjdCcXUzY2s4bnA0NWhpNwpQZ0pzVnJIWllOb1ZkdzlLY001MSt0UXMyaENmL1VuK0xCQXB2UEx4UXloeW5DL3Z3blJWMTdiSUhMaU5LYzVGCjJsQ3VCZklEMWpIVG1tQUZMZi95NkRCTXhOSjA4U1lLOEoxL1l2SlUKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= + server: https://172.18.0.4:6443 + name: create-workload-cluster-od881m +- cluster: + certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURCVENDQWUyZ0F3SUJBZ0lJTzYyZzVmMHlsR2t3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TlRBek1UQXdOakF6TkRaYUZ3MHpOVEF6TURnd05qQTRORFphTUJVeApFekFSQmdOVkJBTVRDbXQxWW1WeWJtVjBaWE13Z2dFaU1BMEdDU3FHU0liM0RRRUJBUVVBQTRJQkR3QXdnZ0VLCkFvSUJBUURESzh6a1U1QWkxRTJIazNiM01PQko3Tko4YmVIRzlVMXQ0cWdkclpyMWZadHUrUDBHVlArejAzWWMKWWlTd0QzNitJWk04ZGkvQVV3VjduVXhFT0ZOUjh2Y1RRdkNqdktUUVlFWTI3RlZxUWxNNklnbmM2Y3JOUHRQUApKZUxlNG1zeHBHMVVOa3R6YzZucGVEb1diT0ttVnVST2lUT0l3TG9TVld4YkkrR1NScS9STkROT2VVam1hM01TClJqV1VneTEyM3IxQlFCbEYyMFI4b29MZVBldzhCeWk5U2dhRUlhbXdoODhMTmhVR3VsVlJiOTNHUDZQSEQ2bkMKdzBSQ1p3MlIvTS9EdlZtakxvZEpSRnBIKytBaTkwZVNZcGtFekk2WlM5WW00TjhOZFROU3FySy9OcTBBcjNzNwpjc2NqTjc0aThCYlZsRDJIR1UxY2sxdmgyNHh0QWdNQkFBR2pXVEJYTUE0R0ExVWREd0VCL3dRRUF3SUNwREFQCkJnTlZIUk1CQWY4RUJUQURBUUgvTUIwR0ExVWREZ1FXQkJRVFhzWkkzNFFJbGtGUDk0TFNCcFU3aUZFYW9qQVYKQmdOVkhSRUVEakFNZ2dwcmRXSmxjbTVsZEdWek1BMEdDU3FHU0liM0RRRUJDd1VBQTRJQkFRQUxDeTQ5QUlWcwpuSkJ4T3ZuM2lkQUdtZ2VEbTFMbElLQ254eUtEb2FTcXlldWpVT2ozYXY3U1dzUDZaTERiNzQ1dXpuT2JEK0RiCi9STkJMSDZKTEs2dGNTRTcxTVpaeWV6N1YxWlF1MExqdXlmT2xiM2VzcEVka25uMEZyMkhibXYzbW5aU3NROTIKK3JvVUNiQXhOSElqQUY2UlV5Uzk5ZWp3cTdQRWtTU2o1U1RFNW1YYUF0OEdoQnVwODNkbTlQMklBWmZlcytucQpLNVFwUFk3bnh4bEI1TGdpcFdrdHc2djZpNGdqWCsvNUVoVDNnMUk2dW1ncXdTTkhMNHlLcFBtV2NVTXcvVkU3Ckg5c0VSa1JwbDlMNWx1SlB3TmdKcmpWRnBwQTN6bnFuNTRHa0RWeDhvN1UxLzFFK2pudUVCU1JCZ1I1alRjdTgKcDR4WkVWMXZRdG1iCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K + server: https://127.0.0.1:42341 + name: kind-caaph-e2e +contexts: +- context: + cluster: create-workload-cluster-od881m + user: create-workload-cluster-od881m-admin + name: create-workload-cluster-od881m-admin@create-workload-cluster-od881m +- context: + cluster: kind-caaph-e2e + user: kind-caaph-e2e + name: kind-caaph-e2e +current-context: kind-caaph-e2e +kind: Config +preferences: {} +users: +- name: create-workload-cluster-od881m-admin + user: + client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURFekNDQWZ1Z0F3SUJBZ0lJUDNLUUVIZERWVm93RFFZSktvWklodmNOQVFFTEJR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TXh3OHUrT0U1Ci0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg== diff --git a/cmd/clusterctl/cmd/testdata/single-workload-kubeconfig.yaml b/cmd/clusterctl/cmd/testdata/single-workload-kubeconfig.yaml new file mode 100644 index 000000000000..df03ea12db66 --- /dev/null +++ b/cmd/clusterctl/cmd/testdata/single-workload-kubeconfig.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +clusters: +- cluster: + certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM2akNDQWRLZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJMU1ETXhNREEyTURRMU9Gb1hEVE0xTURNd09EQTJNRGsxT0Zvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTURlCnk3Kzh4TGlnVXY1cFQzeWNwTlVKbG5YbGtBMjFqekl2R2EvMnFGM1NLZjVQZVBLMUdVUG9KcDFEZ1ZFbzdxYlkKL1YwbkROVE9SWFkwQ0RZUG01eFJLMEdHZ28zYXcyWE15TTNGcjl6U0RzT1hoY0NicDlrS0lTQTJXTXpLZjZhOQpDbFluNVRCY2dHbEV6SXB2cUhLKzlzcVZjVmhpS2pCQW9mQk1KUWl0K3ZuY01oTGc1VnJkQnpQUmRFcVh5cEgxCkVVaHBZS2pPRWxCSWQvR1lwdWJUZitob3ZmZXZaZ041YVBlZy96OWN3S2tmMDZjS3o2cG1peUhkYkNRaHQ2U20KVjVMdDgyUUhGWW5QbFBuTCtVN1BoNE9ldVltWHBlUU9IL3BPZ2d5UlF2MGJFV1FlbVB2Q2FHWlk3bHRyaFB6bQp2OVN5VnZZT1hqZ1Y3NGtxL1dVQ0F3RUFBYU5GTUVNd0RnWURWUjBQQVFIL0JBUURBZ0trTUJJR0ExVWRFd0VCCi93UUlNQVlCQWY4Q0FRQXdIUVlEVlIwT0JCWUVGRzZmWGpmbGQ4T1E3RDllL2dmTWlWNFJFbDVjTUEwR0NTcUcKU0liM0RRRUJDd1VBQTRJQkFRQUhRWDdZVVh5c2NseWxKQ0hvVW1WUHlMd2Q3VlJTSFdZTFB3Z1ZITWs5aE02bwphTHBndUdOenB1NFhCQnAzUkpPMC9DMk0wS2RaeEhsK2c3OW51MEsxQ3dMSnROZ00vaHg1V0NIcVZHVE11N3U2CkZGeC9Ua2JJVTk1NzNwMTgxcnZuQkR5ZWw1dlhhVFdrY0dDM21MZzVxMTZZUUZWTWxQbTVFWXpnL2VlQnRkMGsKMkdHQUUzMC8xRC9rYmhoQWVNdXNJVEJYWHRTZlM2ZjJHMFVjWFcvWGNLbjNCUVZCSjdCcXUzY2s4bnA0NWhpNwpQZ0pzVnJIWllOb1ZkdzlLY001MSt0UXMyaENmL1VuK0xCQXB2UEx4UXloeW5DL3Z3blJWMTdiSUhMaU5LYzVGCjJsQ3VCZklEMWpIVG1tQUZMZi95NkRCTXhOSjA4U1lLOEoxL1l2SlUKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= + server: https://172.18.0.4:6443 + name: create-workload-cluster-od881m +contexts: +- context: + cluster: create-workload-cluster-od881m + user: create-workload-cluster-od881m-admin + name: create-workload-cluster-od881m-admin@create-workload-cluster-od881m +current-context: create-workload-cluster-od881m-admin@create-workload-cluster-od881m +kind: Config +preferences: {} +users: +- name: create-workload-cluster-od881m-admin + user: + client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURFekNDQWZ1Z0F3SUJBZ0lJUDNLUUVIZERWVm93RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TlRBek1UQXdOakEwTlRoYUZ3MHlOakF6TVRBd05qQTVOVGhhTURReApGekFWQmdO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WcWx2VnFUNk5yVkxtRWRUSUl1VzdzUjNkUVpQYzAyc2FWdnFydm9RR3JYVmJzCmNIZXQzYUVDZ1lCSTk0cm1XdGpLVjlCeS9uaU11WGtWb0lFb1BpeXJha3JBZjgyVkFvSTcrSkEyMVp5eURMTlYKck9kdDdJSDViRERLSllTVGROL3lQVjRJRFJ6VWpIN1VBRGlvVzQ1alNyUjlTVitKamZLTDFXT05BWDIrVDB0dgprZ3NWdk9FaDVKVnV3eG5BcEs1UksvTkpuVXBKdnFyVExNRU1TaWxTdzk2Z2JKMTllNlRZK0E9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo= diff --git a/docs/book/src/clusterctl/commands/get-kubeconfig.md b/docs/book/src/clusterctl/commands/get-kubeconfig.md index cde31b429a10..befa2e8d8c44 100644 --- a/docs/book/src/clusterctl/commands/get-kubeconfig.md +++ b/docs/book/src/clusterctl/commands/get-kubeconfig.md @@ -1,6 +1,6 @@ # clusterctl get kubeconfig -This command prints the kubeconfig of an existing workload cluster into stdout. +This command prints the kubeconfig of an existing workload cluster into stdout or inserts it into the specified kubeconfig file. This functionality is available in clusterctl v0.3.9 or newer. ## Examples @@ -11,6 +11,12 @@ Get the kubeconfig of a workload cluster named foo. clusterctl get kubeconfig foo ``` +Get the kubeconfig of a workload cluster named foo and insert it into the specified (default) kubeconfig file. + +```bash +clusterctl get kubeconfig foo --into-kubeconfig ~/.kube/config +``` + Get the kubeconfig of a workload cluster named foo in the namespace bar ```bash